/* only used internally */
static FT_Pointer
-_hb_ftglue_qalloc( FT_Memory memory,
- FT_ULong size,
- HB_Error *perror )
+_hb_ftglue_qalloc( FT_ULong size,
+ HB_Error *perror )
{
HB_Error error = 0;
FT_Pointer block = NULL;
if ( size > 0 )
{
- block = memory->alloc( memory, size );
+ block = malloc( size );
if ( !block )
error = HB_Err_Out_Of_Memory;
}
}
#undef QALLOC /* just in case */
-#define QALLOC(ptr,size) ( (ptr) = _hb_ftglue_qalloc( memory, (size), &error ), error != 0 )
+#define QALLOC(ptr,size) ( (ptr) = _hb_ftglue_qalloc( (size), &error ), error != 0 )
FTGLUE_APIDEF( FT_Pointer )
-_hb_ftglue_alloc( FT_Memory memory,
- FT_ULong size,
- HB_Error *perror )
+_hb_ftglue_alloc( FT_ULong size,
+ HB_Error *perror )
{
HB_Error error = 0;
FT_Pointer block = NULL;
if ( size > 0 )
{
- block = memory->alloc( memory, size );
+ block = malloc( size );
if ( !block )
error = HB_Err_Out_Of_Memory;
else
FTGLUE_APIDEF( FT_Pointer )
-_hb_ftglue_realloc( FT_Memory memory,
- FT_Pointer block,
- FT_ULong old_size,
- FT_ULong new_size,
- HB_Error *perror )
+_hb_ftglue_realloc( FT_Pointer block,
+ FT_ULong new_size,
+ HB_Error *perror )
{
FT_Pointer block2 = NULL;
HB_Error error = 0;
- if ( old_size == 0 || block == NULL )
- {
- block2 = _hb_ftglue_alloc( memory, new_size, &error );
- }
- else if ( new_size == 0 )
- {
- _hb_ftglue_free( memory, block );
- }
- else
- {
- block2 = memory->realloc( memory, old_size, new_size, block );
- if ( block2 == NULL )
- error = HB_Err_Out_Of_Memory;
- else if ( new_size > old_size )
- memset( (char*)block2 + old_size, 0, (size_t)(new_size - old_size) );
- }
+ block2 = realloc( block, new_size );
+ if ( block2 == NULL && new_size != 0 )
+ error = HB_Err_Out_Of_Memory;
if ( !error )
block = block2;
FTGLUE_APIDEF( void )
-_hb_ftglue_free( FT_Memory memory,
- FT_Pointer block )
+_hb_ftglue_free( FT_Pointer block )
{
if ( block )
- memory->free( memory, block );
+ free( block );
}
if ( stream->read )
{
/* allocate the frame in memory */
- FT_Memory memory = stream->memory;
-
if ( QALLOC( stream->base, count ) )
goto Exit;
{
if ( stream->read )
{
- FT_Memory memory = stream->memory;
-
FREE( stream->base );
}
stream->cursor = NULL;
/* memory macros used by the OpenType parser */
#define ALLOC(_ptr,_size) \
- ( (_ptr) = _hb_ftglue_alloc( memory, _size, &error ), error != 0 )
+ ( (_ptr) = _hb_ftglue_alloc( _size, &error ), error != 0 )
-#define REALLOC(_ptr,_oldsz,_newsz) \
- ( (_ptr) = _hb_ftglue_realloc( memory, (_ptr), (_oldsz), (_newsz), &error ), error != 0 )
+#define REALLOC(_ptr,_newsz) \
+ ( (_ptr) = _hb_ftglue_realloc( (_ptr), (_newsz), &error ), error != 0 )
#define FREE(_ptr) \
do { \
if ( (_ptr) ) \
{ \
- _hb_ftglue_free( memory, _ptr ); \
+ _hb_ftglue_free( _ptr ); \
_ptr = NULL; \
} \
} while (0)
#define ALLOC_ARRAY(_ptr,_count,_type) \
ALLOC(_ptr,(_count)*sizeof(_type))
-#define REALLOC_ARRAY(_ptr,_oldcnt,_newcnt,_type) \
- REALLOC(_ptr,(_oldcnt)*sizeof(_type),(_newcnt)*sizeof(_type))
+#define REALLOC_ARRAY(_ptr,_newcnt,_type) \
+ REALLOC(_ptr,(_newcnt)*sizeof(_type))
#define MEM_Copy(dest,source,count) memcpy( (char*)(dest), (const char*)(source), (size_t)(count) )
FTGLUE_API( FT_Pointer )
-_hb_ftglue_alloc( FT_Memory memory,
- FT_ULong size,
- HB_Error *perror_ );
+_hb_ftglue_alloc( FT_ULong size,
+ HB_Error *perror_ );
FTGLUE_API( FT_Pointer )
-_hb_ftglue_realloc( FT_Memory memory,
- FT_Pointer block,
- FT_ULong old_size,
- FT_ULong new_size,
- HB_Error *perror_ );
+_hb_ftglue_realloc( FT_Pointer block,
+ FT_ULong new_size,
+ HB_Error *perror_ );
FTGLUE_API( void )
-_hb_ftglue_free( FT_Memory memory,
- FT_Pointer block );
+_hb_ftglue_free( FT_Pointer block );
/* abuse these private header/source files */
hb_buffer_ensure( HB_Buffer buffer,
FT_ULong size )
{
- FT_Memory memory = buffer->memory;
FT_ULong new_allocated = buffer->allocated;
if (size > new_allocated)
while (size > new_allocated)
new_allocated += (new_allocated >> 1) + 8;
- if ( REALLOC_ARRAY( buffer->positions, buffer->allocated, new_allocated, HB_PositionRec ) )
+ if ( REALLOC_ARRAY( buffer->positions, new_allocated, HB_PositionRec ) )
return error;
- if ( REALLOC_ARRAY( buffer->in_string, buffer->allocated, new_allocated, HB_GlyphItemRec ) )
+ if ( REALLOC_ARRAY( buffer->in_string, new_allocated, HB_GlyphItemRec ) )
return error;
if ( buffer->inplace )
{
if ( buffer->alt_string )
{
- if ( REALLOC_ARRAY( buffer->alt_string, buffer->allocated, new_allocated, HB_GlyphItemRec ) )
+ if ( REALLOC_ARRAY( buffer->alt_string, new_allocated, HB_GlyphItemRec ) )
return error;
}
}
else
{
- if ( REALLOC_ARRAY( buffer->alt_string, buffer->allocated, new_allocated, HB_GlyphItemRec ) )
+ if ( REALLOC_ARRAY( buffer->alt_string, new_allocated, HB_GlyphItemRec ) )
return error;
buffer->out_string = buffer->alt_string;
{
if ( !buffer->alt_string )
{
- FT_Memory memory = buffer->memory;
HB_Error error;
if ( ALLOC_ARRAY( buffer->alt_string, buffer->allocated, HB_GlyphItemRec ) )
}
HB_Error
-hb_buffer_new( FT_Memory memory,
- HB_Buffer *buffer )
+hb_buffer_new( HB_Buffer *buffer )
{
HB_Error error;
if ( ALLOC( *buffer, sizeof( HB_BufferRec ) ) )
return error;
- (*buffer)->memory = memory;
(*buffer)->in_length = 0;
(*buffer)->out_length = 0;
(*buffer)->allocated = 0;
void
hb_buffer_free( HB_Buffer buffer )
{
- FT_Memory memory = buffer->memory;
-
FREE( buffer->in_string );
FREE( buffer->alt_string );
buffer->out_string = NULL;
typedef struct HB_BufferRec_{
- FT_Memory memory;
FT_ULong allocated;
FT_ULong in_length;
} HB_BufferRec, *HB_Buffer;
HB_Error
-hb_buffer_new( FT_Memory memory,
- HB_Buffer *buffer );
+hb_buffer_new( HB_Buffer *buffer );
void
hb_buffer_swap( HB_Buffer buffer );
static HB_Error Load_LigCaretList( HB_LigCaretList* lcl,
FT_Stream stream );
-static void Free_AttachList( HB_AttachList* al,
- FT_Memory memory );
-static void Free_LigCaretList( HB_LigCaretList* lcl,
- FT_Memory memory );
-
-static void Free_NewGlyphClasses( HB_GDEFHeader* gdef,
- FT_Memory memory );
+static void Free_AttachList( HB_AttachList* al );
+static void Free_LigCaretList( HB_LigCaretList* lcl );
+static void Free_NewGlyphClasses( HB_GDEFHeader* gdef );
if ( gdef->loaded )
{
- Free_LigCaretList( &gdef->LigCaretList, memory );
- Free_AttachList( &gdef->AttachList, memory );
- _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef, memory );
- _HB_OPEN_Free_ClassDefinition( &gdef->MarkAttachClassDef, memory );
+ Free_LigCaretList( &gdef->LigCaretList );
+ Free_AttachList( &gdef->AttachList );
+ _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef );
+ _HB_OPEN_Free_ClassDefinition( &gdef->MarkAttachClassDef );
- Free_NewGlyphClasses( gdef, memory );
+ Free_NewGlyphClasses( gdef );
}
return HB_Err_Ok;
-HB_Error HB_New_GDEF_Table( FT_Face face,
- HB_GDEFHeader** retptr )
+HB_Error HB_New_GDEF_Table( HB_GDEFHeader** retptr )
{
HB_Error error;
- FT_Memory memory = face->memory;
HB_GDEFHeader* gdef;
if ( ALLOC( gdef, sizeof( *gdef ) ) )
return error;
- gdef->memory = face->memory;
-
gdef->GlyphClassDef.loaded = FALSE;
gdef->AttachList.loaded = FALSE;
gdef->LigCaretList.loaded = FALSE;
HB_GDEFHeader** retptr )
{
HB_Error error;
- FT_Memory memory = face->memory;
FT_Stream stream = face->stream;
FT_ULong cur_offset, new_offset, base_offset;
if (( error = _hb_ftglue_face_goto_table( face, TTAG_GDEF, stream ) ))
return error;
- if (( error = HB_New_GDEF_Table ( face, &gdef ) ))
+ if (( error = HB_New_GDEF_Table ( &gdef ) ))
return error;
base_offset = FILE_Pos();
return HB_Err_Ok;
Fail3:
- Free_LigCaretList( &gdef->LigCaretList, memory );
+ Free_LigCaretList( &gdef->LigCaretList );
Fail2:
- Free_AttachList( &gdef->AttachList, memory );
+ Free_AttachList( &gdef->AttachList );
Fail1:
- _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef );
Fail0:
FREE( gdef );
HB_Error HB_Done_GDEF_Table ( HB_GDEFHeader* gdef )
{
- FT_Memory memory = gdef->memory;
-
- Free_LigCaretList( &gdef->LigCaretList, memory );
- Free_AttachList( &gdef->AttachList, memory );
- _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef, memory );
- _HB_OPEN_Free_ClassDefinition( &gdef->MarkAttachClassDef, memory );
+ Free_LigCaretList( &gdef->LigCaretList );
+ Free_AttachList( &gdef->AttachList );
+ _HB_OPEN_Free_ClassDefinition( &gdef->GlyphClassDef );
+ _HB_OPEN_Free_ClassDefinition( &gdef->MarkAttachClassDef );
- Free_NewGlyphClasses( gdef, memory );
+ Free_NewGlyphClasses( gdef );
FREE( gdef );
static HB_Error Load_AttachPoint( HB_AttachPoint* ap,
FT_Stream stream )
{
- FT_Memory memory = stream->memory;
HB_Error error;
FT_UShort n, count;
}
-static void Free_AttachPoint( HB_AttachPoint* ap,
- FT_Memory memory )
+static void Free_AttachPoint( HB_AttachPoint* ap )
{
FREE( ap->PointIndex );
}
static HB_Error Load_AttachList( HB_AttachList* al,
FT_Stream stream )
{
- FT_Memory memory = stream->memory;
HB_Error error;
FT_UShort n, m, count;
Fail1:
for ( m = 0; m < n; m++ )
- Free_AttachPoint( &ap[m], memory );
+ Free_AttachPoint( &ap[m] );
FREE( ap );
Fail2:
- _HB_OPEN_Free_Coverage( &al->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &al->Coverage );
return error;
}
-static void Free_AttachList( HB_AttachList* al,
- FT_Memory memory )
+static void Free_AttachList( HB_AttachList* al )
{
FT_UShort n, count;
ap = al->AttachPoint;
for ( n = 0; n < count; n++ )
- Free_AttachPoint( &ap[n], memory );
+ Free_AttachPoint( &ap[n] );
FREE( ap );
}
- _HB_OPEN_Free_Coverage( &al->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &al->Coverage );
}
}
-static void Free_CaretValue( HB_CaretValue* cv,
- FT_Memory memory )
+static void Free_CaretValue( HB_CaretValue* cv )
{
if ( cv->CaretValueFormat == 3 )
- _HB_OPEN_Free_Device( &cv->cvf.cvf3.Device, memory );
+ _HB_OPEN_Free_Device( &cv->cvf.cvf3.Device );
}
static HB_Error Load_LigGlyph( HB_LigGlyph* lg,
FT_Stream stream )
{
- FT_Memory memory = stream->memory;
HB_Error error;
FT_UShort n, m, count;
Fail:
for ( m = 0; m < n; m++ )
- Free_CaretValue( &cv[m], memory );
+ Free_CaretValue( &cv[m] );
FREE( cv );
return error;
}
-static void Free_LigGlyph( HB_LigGlyph* lg,
- FT_Memory memory )
+static void Free_LigGlyph( HB_LigGlyph* lg )
{
FT_UShort n, count;
cv = lg->CaretValue;
for ( n = 0; n < count; n++ )
- Free_CaretValue( &cv[n], memory );
+ Free_CaretValue( &cv[n] );
FREE( cv );
}
static HB_Error Load_LigCaretList( HB_LigCaretList* lcl,
FT_Stream stream )
{
- FT_Memory memory = stream->memory;
HB_Error error;
FT_UShort m, n, count;
Fail1:
for ( m = 0; m < n; m++ )
- Free_LigGlyph( &lg[m], memory );
+ Free_LigGlyph( &lg[m] );
FREE( lg );
Fail2:
- _HB_OPEN_Free_Coverage( &lcl->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &lcl->Coverage );
return error;
}
-static void Free_LigCaretList( HB_LigCaretList* lcl,
- FT_Memory memory )
+static void Free_LigCaretList( HB_LigCaretList* lcl )
{
FT_UShort n, count;
lg = lcl->LigGlyph;
for ( n = 0; n < count; n++ )
- Free_LigGlyph( &lg[n], memory );
+ Free_LigGlyph( &lg[n] );
FREE( lg );
}
- _HB_OPEN_Free_Coverage( &lcl->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &lcl->Coverage );
}
static HB_Error Make_ClassRange( HB_ClassDefinition* cd,
FT_UShort start,
FT_UShort end,
- FT_UShort class,
- FT_Memory memory )
+ FT_UShort class )
{
HB_Error error;
FT_UShort index;
cdf2 = &cd->cd.cd2;
if ( REALLOC_ARRAY( cdf2->ClassRangeRecord,
- cdf2->ClassRangeCount,
cdf2->ClassRangeCount + 1 ,
HB_ClassRangeRecord ) )
return error;
FT_UShort start, curr_glyph, curr_class;
FT_UShort n, m, count;
HB_Error error;
- FT_Memory memory;
HB_ClassDefinition* gcd;
HB_ClassRangeRecord* gcrr;
if ( !gdef || !glyph_array || !class_array )
return HB_Err_Invalid_Argument;
- memory = gdef->memory;
gcd = &gdef->GlyphClassDef;
/* We build a format 2 table */
{
if ( ( error = Make_ClassRange( gcd, start,
curr_glyph,
- curr_class,
- memory ) ) != HB_Err_Ok )
+ curr_class ) ) != HB_Err_Ok )
goto Fail3;
}
else
{
if ( ( error = Make_ClassRange( gcd, start,
curr_glyph - 1,
- curr_class,
- memory ) ) != HB_Err_Ok )
+ curr_class ) ) != HB_Err_Ok )
goto Fail3;
if ( curr_glyph > glyph_array[n] )
{
if ( ( error = Make_ClassRange( gcd, start,
curr_glyph,
- curr_class,
- memory ) ) != HB_Err_Ok )
+ curr_class ) ) != HB_Err_Ok )
goto Fail3;
}
else
}
-static void Free_NewGlyphClasses( HB_GDEFHeader* gdef,
- FT_Memory memory )
+static void Free_NewGlyphClasses( HB_GDEFHeader* gdef )
{
FT_UShort** ngc;
FT_UShort n, count;
struct HB_GDEFHeader_
{
- FT_Memory memory;
FT_ULong offset;
FT_Fixed Version;
typedef struct HB_GDEFHeader_* HB_GDEF;
-HB_Error HB_New_GDEF_Table( FT_Face face,
- HB_GDEFHeader** retptr );
+HB_Error HB_New_GDEF_Table( HB_GDEFHeader** retptr );
-HB_Error HB_Load_GDEF_Table( FT_Face face,
+HB_Error HB_Load_GDEF_Table( FT_Face face,
HB_GDEFHeader** gdef );
FT_UShort lookup_type );
void _HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st,
- FT_Memory memory,
FT_UShort lookup_type );
FT_END_HEADER
FT_Stream stream = face->stream;
HB_Error error;
- FT_Memory memory = face->memory;
if ( !retptr )
if ( ALLOC ( gpos, sizeof( *gpos ) ) )
return error;
- gpos->memory = memory;
gpos->gfunc = FT_Load_Glyph;
gpos->mmfunc = default_mmfunc;
return HB_Err_Ok;
Fail1:
- _HB_OPEN_Free_LookupList( &gpos->LookupList, HB_Type_GPOS, memory );
+ _HB_OPEN_Free_LookupList( &gpos->LookupList, HB_Type_GPOS );
Fail2:
- _HB_OPEN_Free_FeatureList( &gpos->FeatureList, memory );
+ _HB_OPEN_Free_FeatureList( &gpos->FeatureList );
Fail3:
- _HB_OPEN_Free_ScriptList( &gpos->ScriptList, memory );
+ _HB_OPEN_Free_ScriptList( &gpos->ScriptList );
Fail4:
FREE( gpos );
HB_Error HB_Done_GPOS_Table( HB_GPOSHeader* gpos )
{
- FT_Memory memory = gpos->memory;
-
- _HB_OPEN_Free_LookupList( &gpos->LookupList, HB_Type_GPOS, memory );
- _HB_OPEN_Free_FeatureList( &gpos->FeatureList, memory );
- _HB_OPEN_Free_ScriptList( &gpos->ScriptList, memory );
+ _HB_OPEN_Free_LookupList( &gpos->LookupList, HB_Type_GPOS );
+ _HB_OPEN_Free_FeatureList( &gpos->FeatureList );
+ _HB_OPEN_Free_ScriptList( &gpos->ScriptList );
FREE( gpos );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_ULong cur_offset, new_offset;
return HB_Err_Ok;
Fail1:
- _HB_OPEN_Free_Device( &vr->YAdvanceDevice, memory );
+ _HB_OPEN_Free_Device( &vr->YAdvanceDevice );
Fail2:
- _HB_OPEN_Free_Device( &vr->XAdvanceDevice, memory );
+ _HB_OPEN_Free_Device( &vr->XAdvanceDevice );
Fail3:
- _HB_OPEN_Free_Device( &vr->YPlacementDevice, memory );
+ _HB_OPEN_Free_Device( &vr->YPlacementDevice );
return error;
}
static void Free_ValueRecord( HB_ValueRecord* vr,
- FT_UShort format,
- FT_Memory memory )
+ FT_UShort format )
{
if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE )
- _HB_OPEN_Free_Device( &vr->YAdvanceDevice, memory );
+ _HB_OPEN_Free_Device( &vr->YAdvanceDevice );
if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE )
- _HB_OPEN_Free_Device( &vr->XAdvanceDevice, memory );
+ _HB_OPEN_Free_Device( &vr->XAdvanceDevice );
if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE )
- _HB_OPEN_Free_Device( &vr->YPlacementDevice, memory );
+ _HB_OPEN_Free_Device( &vr->YPlacementDevice );
if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE )
- _HB_OPEN_Free_Device( &vr->XPlacementDevice, memory );
+ _HB_OPEN_Free_Device( &vr->XPlacementDevice );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_ULong cur_offset, new_offset, base_offset;
return HB_Err_Ok;
Fail:
- _HB_OPEN_Free_Device( &an->af.af3.XDeviceTable, memory );
+ _HB_OPEN_Free_Device( &an->af.af3.XDeviceTable );
return error;
}
-static void Free_Anchor( HB_Anchor* an,
- FT_Memory memory)
+static void Free_Anchor( HB_Anchor* an )
{
if ( an->PosFormat == 3 )
{
- _HB_OPEN_Free_Device( &an->af.af3.YDeviceTable, memory );
- _HB_OPEN_Free_Device( &an->af.af3.XDeviceTable, memory );
+ _HB_OPEN_Free_Device( &an->af.af3.YDeviceTable );
+ _HB_OPEN_Free_Device( &an->af.af3.XDeviceTable );
}
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_Anchor( &mr[m].MarkAnchor, memory );
+ Free_Anchor( &mr[m].MarkAnchor );
FREE( mr );
return error;
}
-static void Free_MarkArray( HB_MarkArray* ma,
- FT_Memory memory )
+static void Free_MarkArray( HB_MarkArray* ma )
{
FT_UShort n, count;
mr = ma->MarkRecord;
for ( n = 0; n < count; n++ )
- Free_Anchor( &mr[n].MarkAnchor, memory );
+ Free_Anchor( &mr[n].MarkAnchor );
FREE( mr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_SinglePos* sp = &st->single;
FT_UShort n, m, count, format;
Fail1:
for ( m = 0; m < n; m++ )
- Free_ValueRecord( &vr[m], format, memory );
+ Free_ValueRecord( &vr[m], format );
FREE( vr );
Fail2:
- _HB_OPEN_Free_Coverage( &sp->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &sp->Coverage );
return error;
}
-static void Free_SinglePos( HB_GPOS_SubTable* st,
- FT_Memory memory )
+static void Free_SinglePos( HB_GPOS_SubTable* st )
{
FT_UShort n, count, format;
HB_SinglePos* sp = &st->single;
switch ( sp->PosFormat )
{
case 1:
- Free_ValueRecord( &sp->spf.spf1.Value, format, memory );
+ Free_ValueRecord( &sp->spf.spf1.Value, format );
break;
case 2:
v = sp->spf.spf2.Value;
for ( n = 0; n < count; n++ )
- Free_ValueRecord( &v[n], format, memory );
+ Free_ValueRecord( &v[n], format );
FREE( v );
}
break;
}
- _HB_OPEN_Free_Coverage( &sp->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &sp->Coverage );
}
static HB_Error Lookup_SinglePos( GPOS_Instance* gpi,
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong base_offset;
if ( error )
{
if ( format1 )
- Free_ValueRecord( &pvr[n].Value1, format1, memory );
+ Free_ValueRecord( &pvr[n].Value1, format1 );
goto Fail;
}
}
for ( m = 0; m < n; m++ )
{
if ( format1 )
- Free_ValueRecord( &pvr[m].Value1, format1, memory );
+ Free_ValueRecord( &pvr[m].Value1, format1 );
if ( format2 )
- Free_ValueRecord( &pvr[m].Value2, format2, memory );
+ Free_ValueRecord( &pvr[m].Value2, format2 );
}
FREE( pvr );
static void Free_PairSet( HB_PairSet* ps,
FT_UShort format1,
- FT_UShort format2,
- FT_Memory memory )
+ FT_UShort format2 )
{
FT_UShort n, count;
for ( n = 0; n < count; n++ )
{
if ( format1 )
- Free_ValueRecord( &pvr[n].Value1, format1, memory );
+ Free_ValueRecord( &pvr[n].Value1, format1 );
if ( format2 )
- Free_ValueRecord( &pvr[n].Value2, format2, memory );
+ Free_ValueRecord( &pvr[n].Value2, format2 );
}
FREE( pvr );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_PairSet( &ps[m], format1, format2, memory );
+ Free_PairSet( &ps[m], format1, format2 );
FREE( ps );
return error;
static void Free_PairPos1( HB_PairPosFormat1* ppf1,
FT_UShort format1,
- FT_UShort format2,
- FT_Memory memory )
+ FT_UShort format2 )
{
FT_UShort n, count;
ps = ppf1->PairSet;
for ( n = 0; n < count; n++ )
- Free_PairSet( &ps[n], format1, format2, memory );
+ Free_PairSet( &ps[n], format1, format2 );
FREE( ps );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort m, n, k, count1, count2;
FT_ULong cur_offset, new_offset1, new_offset2, base_offset;
if ( error )
{
if ( format1 )
- Free_ValueRecord( &c2r[n].Value1, format1, memory );
+ Free_ValueRecord( &c2r[n].Value1, format1 );
goto Fail0;
}
}
for ( k = 0; k < n; k++ )
{
if ( format1 )
- Free_ValueRecord( &c2r[k].Value1, format1, memory );
+ Free_ValueRecord( &c2r[k].Value1, format1 );
if ( format2 )
- Free_ValueRecord( &c2r[k].Value2, format2, memory );
+ Free_ValueRecord( &c2r[k].Value2, format2 );
}
goto Fail1;
}
for ( n = 0; n < count2; n++ )
{
if ( format1 )
- Free_ValueRecord( &c2r[n].Value1, format1, memory );
+ Free_ValueRecord( &c2r[n].Value1, format1 );
if ( format2 )
- Free_ValueRecord( &c2r[n].Value2, format2, memory );
+ Free_ValueRecord( &c2r[n].Value2, format2 );
}
FREE( c2r );
FREE( c1r );
Fail2:
- _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef2, memory );
+ _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef2 );
Fail3:
- _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef1, memory );
+ _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef1 );
return error;
}
static void Free_PairPos2( HB_PairPosFormat2* ppf2,
FT_UShort format1,
- FT_UShort format2,
- FT_Memory memory )
+ FT_UShort format2 )
{
FT_UShort m, n, count1, count2;
for ( n = 0; n < count2; n++ )
{
if ( format1 )
- Free_ValueRecord( &c2r[n].Value1, format1, memory );
+ Free_ValueRecord( &c2r[n].Value1, format1 );
if ( format2 )
- Free_ValueRecord( &c2r[n].Value2, format2, memory );
+ Free_ValueRecord( &c2r[n].Value2, format2 );
}
FREE( c2r );
FREE( c1r );
- _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef2, memory );
- _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef1, memory );
+ _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef2 );
+ _HB_OPEN_Free_ClassDefinition( &ppf2->ClassDef1 );
}
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_PairPos* pp = &st->pair;
FT_UShort format1, format2;
return HB_Err_Ok;
Fail:
- _HB_OPEN_Free_Coverage( &pp->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &pp->Coverage );
return error;
}
-static void Free_PairPos( HB_GPOS_SubTable* st,
- FT_Memory memory )
+static void Free_PairPos( HB_GPOS_SubTable* st )
{
FT_UShort format1, format2;
HB_PairPos* pp = &st->pair;
switch ( pp->PosFormat )
{
case 1:
- Free_PairPos1( &pp->ppf.ppf1, format1, format2, memory );
+ Free_PairPos1( &pp->ppf.ppf1, format1, format2 );
break;
case 2:
- Free_PairPos2( &pp->ppf.ppf2, format1, format2, memory );
+ Free_PairPos2( &pp->ppf.ppf2, format1, format2 );
break;
default:
break;
}
- _HB_OPEN_Free_Coverage( &pp->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &pp->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_CursivePos* cp = &st->cursive;
FT_UShort n, m, count;
stream ) ) != HB_Err_Ok )
{
if ( entry_offset )
- Free_Anchor( &eer[n].EntryAnchor, memory );
+ Free_Anchor( &eer[n].EntryAnchor );
goto Fail1;
}
(void)FILE_Seek( cur_offset );
Fail1:
for ( m = 0; m < n; m++ )
{
- Free_Anchor( &eer[m].EntryAnchor, memory );
- Free_Anchor( &eer[m].ExitAnchor, memory );
+ Free_Anchor( &eer[m].EntryAnchor );
+ Free_Anchor( &eer[m].ExitAnchor );
}
FREE( eer );
Fail2:
- _HB_OPEN_Free_Coverage( &cp->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &cp->Coverage );
return error;
}
-static void Free_CursivePos( HB_GPOS_SubTable* st,
- FT_Memory memory )
+static void Free_CursivePos( HB_GPOS_SubTable* st )
{
FT_UShort n, count;
HB_CursivePos* cp = &st->cursive;
for ( n = 0; n < count; n++ )
{
- Free_Anchor( &eer[n].EntryAnchor, memory );
- Free_Anchor( &eer[n].ExitAnchor, memory );
+ Free_Anchor( &eer[n].EntryAnchor );
+ Free_Anchor( &eer[n].ExitAnchor );
}
FREE( eer );
}
- _HB_OPEN_Free_Coverage( &cp->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &cp->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort m, n, k, count;
FT_ULong cur_offset, new_offset, base_offset;
continue;
Fail0:
for ( k = 0; k < n; k++ )
- Free_Anchor( &ban[k], memory );
+ Free_Anchor( &ban[k] );
goto Fail;
}
ban = br[k].BaseAnchor;
for ( n = 0; n < num_classes; n++ )
- Free_Anchor( &ban[n], memory );
+ Free_Anchor( &ban[n] );
FREE( ban );
}
static void Free_BaseArray( HB_BaseArray* ba,
- FT_UShort num_classes,
- FT_Memory memory )
+ FT_UShort num_classes )
{
FT_UShort m, n, count;
ban = br[m].BaseAnchor;
for ( n = 0; n < num_classes; n++ )
- Free_Anchor( &ban[n], memory );
+ Free_Anchor( &ban[n] );
FREE( ban );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_MarkBasePos* mbp = &st->markbase;
FT_ULong cur_offset, new_offset, base_offset;
return HB_Err_Ok;
Fail1:
- Free_MarkArray( &mbp->MarkArray, memory );
+ Free_MarkArray( &mbp->MarkArray );
Fail2:
- _HB_OPEN_Free_Coverage( &mbp->BaseCoverage, memory );
+ _HB_OPEN_Free_Coverage( &mbp->BaseCoverage );
Fail3:
- _HB_OPEN_Free_Coverage( &mbp->MarkCoverage, memory );
+ _HB_OPEN_Free_Coverage( &mbp->MarkCoverage );
return error;
}
-static void Free_MarkBasePos( HB_GPOS_SubTable* st,
- FT_Memory memory )
+static void Free_MarkBasePos( HB_GPOS_SubTable* st )
{
HB_MarkBasePos* mbp = &st->markbase;
- Free_BaseArray( &mbp->BaseArray, mbp->ClassCount, memory );
- Free_MarkArray( &mbp->MarkArray, memory );
- _HB_OPEN_Free_Coverage( &mbp->BaseCoverage, memory );
- _HB_OPEN_Free_Coverage( &mbp->MarkCoverage, memory );
+ Free_BaseArray( &mbp->BaseArray, mbp->ClassCount );
+ Free_MarkArray( &mbp->MarkArray );
+ _HB_OPEN_Free_Coverage( &mbp->BaseCoverage );
+ _HB_OPEN_Free_Coverage( &mbp->MarkCoverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort m, n, k, count;
FT_ULong cur_offset, new_offset, base_offset;
continue;
Fail0:
for ( k = 0; k < n; k++ )
- Free_Anchor( &lan[k], memory );
+ Free_Anchor( &lan[k] );
goto Fail;
}
lan = cr[k].LigatureAnchor;
for ( n = 0; n < num_classes; n++ )
- Free_Anchor( &lan[n], memory );
+ Free_Anchor( &lan[n] );
FREE( lan );
}
static void Free_LigatureAttach( HB_LigatureAttach* lat,
- FT_UShort num_classes,
- FT_Memory memory )
+ FT_UShort num_classes )
{
FT_UShort m, n, count;
lan = cr[m].LigatureAnchor;
for ( n = 0; n < num_classes; n++ )
- Free_Anchor( &lan[n], memory );
+ Free_Anchor( &lan[n] );
FREE( lan );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_LigatureAttach( &lat[m], num_classes, memory );
+ Free_LigatureAttach( &lat[m], num_classes );
FREE( lat );
return error;
static void Free_LigatureArray( HB_LigatureArray* la,
- FT_UShort num_classes,
- FT_Memory memory )
+ FT_UShort num_classes )
{
FT_UShort n, count;
lat = la->LigatureAttach;
for ( n = 0; n < count; n++ )
- Free_LigatureAttach( &lat[n], num_classes, memory );
+ Free_LigatureAttach( &lat[n], num_classes );
FREE( lat );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_MarkLigPos* mlp = &st->marklig;
FT_ULong cur_offset, new_offset, base_offset;
return HB_Err_Ok;
Fail1:
- Free_MarkArray( &mlp->MarkArray, memory );
+ Free_MarkArray( &mlp->MarkArray );
Fail2:
- _HB_OPEN_Free_Coverage( &mlp->LigatureCoverage, memory );
+ _HB_OPEN_Free_Coverage( &mlp->LigatureCoverage );
Fail3:
- _HB_OPEN_Free_Coverage( &mlp->MarkCoverage, memory );
+ _HB_OPEN_Free_Coverage( &mlp->MarkCoverage );
return error;
}
-static void Free_MarkLigPos( HB_GPOS_SubTable* st,
- FT_Memory memory)
+static void Free_MarkLigPos( HB_GPOS_SubTable* st )
{
HB_MarkLigPos* mlp = &st->marklig;
- Free_LigatureArray( &mlp->LigatureArray, mlp->ClassCount, memory );
- Free_MarkArray( &mlp->MarkArray, memory );
- _HB_OPEN_Free_Coverage( &mlp->LigatureCoverage, memory );
- _HB_OPEN_Free_Coverage( &mlp->MarkCoverage, memory );
+ Free_LigatureArray( &mlp->LigatureArray, mlp->ClassCount );
+ Free_MarkArray( &mlp->MarkArray );
+ _HB_OPEN_Free_Coverage( &mlp->LigatureCoverage );
+ _HB_OPEN_Free_Coverage( &mlp->MarkCoverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort k, m, n, count;
FT_ULong cur_offset, new_offset, base_offset;
continue;
Fail0:
for ( k = 0; k < n; k++ )
- Free_Anchor( &m2an[k], memory );
+ Free_Anchor( &m2an[k] );
goto Fail;
}
m2an = m2r[k].Mark2Anchor;
for ( n = 0; n < num_classes; n++ )
- Free_Anchor( &m2an[n], memory );
+ Free_Anchor( &m2an[n] );
FREE( m2an );
}
static void Free_Mark2Array( HB_Mark2Array* m2a,
- FT_UShort num_classes,
- FT_Memory memory )
+ FT_UShort num_classes )
{
FT_UShort m, n, count;
m2an = m2r[m].Mark2Anchor;
for ( n = 0; n < num_classes; n++ )
- Free_Anchor( &m2an[n], memory );
+ Free_Anchor( &m2an[n] );
FREE( m2an );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_MarkMarkPos* mmp = &st->markmark;
FT_ULong cur_offset, new_offset, base_offset;
return HB_Err_Ok;
Fail1:
- Free_MarkArray( &mmp->Mark1Array, memory );
+ Free_MarkArray( &mmp->Mark1Array );
Fail2:
- _HB_OPEN_Free_Coverage( &mmp->Mark2Coverage, memory );
+ _HB_OPEN_Free_Coverage( &mmp->Mark2Coverage );
Fail3:
- _HB_OPEN_Free_Coverage( &mmp->Mark1Coverage, memory );
+ _HB_OPEN_Free_Coverage( &mmp->Mark1Coverage );
return error;
}
-static void Free_MarkMarkPos( HB_GPOS_SubTable* st,
- FT_Memory memory)
+static void Free_MarkMarkPos( HB_GPOS_SubTable* st )
{
HB_MarkMarkPos* mmp = &st->markmark;
- Free_Mark2Array( &mmp->Mark2Array, mmp->ClassCount, memory );
- Free_MarkArray( &mmp->Mark1Array, memory );
- _HB_OPEN_Free_Coverage( &mmp->Mark2Coverage, memory );
- _HB_OPEN_Free_Coverage( &mmp->Mark1Coverage, memory );
+ Free_Mark2Array( &mmp->Mark2Array, mmp->ClassCount );
+ Free_MarkArray( &mmp->Mark1Array );
+ _HB_OPEN_Free_Coverage( &mmp->Mark2Coverage );
+ _HB_OPEN_Free_Coverage( &mmp->Mark1Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_UShort* i;
}
-static void Free_PosRule( HB_PosRule* pr,
- FT_Memory memory )
+static void Free_PosRule( HB_PosRule* pr )
{
FREE( pr->PosLookupRecord );
FREE( pr->Input );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_PosRule( &pr[m], memory );
+ Free_PosRule( &pr[m] );
FREE( pr );
return error;
}
-static void Free_PosRuleSet( HB_PosRuleSet* prs,
- FT_Memory memory )
+static void Free_PosRuleSet( HB_PosRuleSet* prs )
{
FT_UShort n, count;
pr = prs->PosRule;
for ( n = 0; n < count; n++ )
- Free_PosRule( &pr[n], memory );
+ Free_PosRule( &pr[n] );
FREE( pr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail1:
for ( m = 0; m < n; m++ )
- Free_PosRuleSet( &prs[m], memory );
+ Free_PosRuleSet( &prs[m] );
FREE( prs );
Fail2:
- _HB_OPEN_Free_Coverage( &cpf1->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &cpf1->Coverage );
return error;
}
-static void Free_ContextPos1( HB_ContextPosFormat1* cpf1,
- FT_Memory memory )
+static void Free_ContextPos1( HB_ContextPosFormat1* cpf1 )
{
FT_UShort n, count;
prs = cpf1->PosRuleSet;
for ( n = 0; n < count; n++ )
- Free_PosRuleSet( &prs[n], memory );
+ Free_PosRuleSet( &prs[n] );
FREE( prs );
}
- _HB_OPEN_Free_Coverage( &cpf1->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &cpf1->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_PosClassRule( HB_PosClassRule* pcr,
- FT_Memory memory )
+static void Free_PosClassRule( HB_PosClassRule* pcr )
{
FREE( pcr->PosLookupRecord );
FREE( pcr->Class );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_PosClassRule( &pcr[m], memory );
+ Free_PosClassRule( &pcr[m] );
FREE( pcr );
return error;
}
-static void Free_PosClassSet( HB_PosClassSet* pcs,
- FT_Memory memory )
+static void Free_PosClassSet( HB_PosClassSet* pcs )
{
FT_UShort n, count;
pcr = pcs->PosClassRule;
for ( n = 0; n < count; n++ )
- Free_PosClassRule( &pcr[n], memory );
+ Free_PosClassRule( &pcr[n] );
FREE( pcr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail1:
for ( m = 0; m < n; n++ )
- Free_PosClassSet( &pcs[m], memory );
+ Free_PosClassSet( &pcs[m] );
FREE( pcs );
Fail2:
- _HB_OPEN_Free_ClassDefinition( &cpf2->ClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &cpf2->ClassDef );
Fail3:
- _HB_OPEN_Free_Coverage( &cpf2->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &cpf2->Coverage );
return error;
}
-static void Free_ContextPos2( HB_ContextPosFormat2* cpf2,
- FT_Memory memory )
+static void Free_ContextPos2( HB_ContextPosFormat2* cpf2 )
{
FT_UShort n, count;
pcs = cpf2->PosClassSet;
for ( n = 0; n < count; n++ )
- Free_PosClassSet( &pcs[n], memory );
+ Free_PosClassSet( &pcs[n] );
FREE( pcs );
}
- _HB_OPEN_Free_ClassDefinition( &cpf2->ClassDef, memory );
- _HB_OPEN_Free_Coverage( &cpf2->Coverage, memory );
+ _HB_OPEN_Free_ClassDefinition( &cpf2->ClassDef );
+ _HB_OPEN_Free_Coverage( &cpf2->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail2:
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
return error;
}
-static void Free_ContextPos3( HB_ContextPosFormat3* cpf3,
- FT_Memory memory )
+static void Free_ContextPos3( HB_ContextPosFormat3* cpf3 )
{
FT_UShort n, count;
c = cpf3->Coverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
}
-static void Free_ContextPos( HB_GPOS_SubTable* st,
- FT_Memory memory )
+static void Free_ContextPos( HB_GPOS_SubTable* st )
{
HB_ContextPos* cp = &st->context;
switch ( cp->PosFormat )
{
- case 1: Free_ContextPos1( &cp->cpf.cpf1, memory ); break;
- case 2: Free_ContextPos2( &cp->cpf.cpf2, memory ); break;
- case 3: Free_ContextPos3( &cp->cpf.cpf3, memory ); break;
+ case 1: Free_ContextPos1( &cp->cpf.cpf1 ); break;
+ case 2: Free_ContextPos2( &cp->cpf.cpf2 ); break;
+ case 3: Free_ContextPos3( &cp->cpf.cpf3 ); break;
default: break;
}
}
{
FT_UShort index, property;
HB_Error error;
- FT_Memory memory = gpi->face->memory;
FT_UShort i, j, k, known_classes;
FT_UShort* classes;
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_UShort* b;
}
-static void Free_ChainPosRule( HB_ChainPosRule* cpr,
- FT_Memory memory )
+static void Free_ChainPosRule( HB_ChainPosRule* cpr )
{
FREE( cpr->PosLookupRecord );
FREE( cpr->Lookahead );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_ChainPosRule( &cpr[m], memory );
+ Free_ChainPosRule( &cpr[m] );
FREE( cpr );
return error;
}
-static void Free_ChainPosRuleSet( HB_ChainPosRuleSet* cprs,
- FT_Memory memory )
+static void Free_ChainPosRuleSet( HB_ChainPosRuleSet* cprs )
{
FT_UShort n, count;
cpr = cprs->ChainPosRule;
for ( n = 0; n < count; n++ )
- Free_ChainPosRule( &cpr[n], memory );
+ Free_ChainPosRule( &cpr[n] );
FREE( cpr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail1:
for ( m = 0; m < n; m++ )
- Free_ChainPosRuleSet( &cprs[m], memory );
+ Free_ChainPosRuleSet( &cprs[m] );
FREE( cprs );
Fail2:
- _HB_OPEN_Free_Coverage( &ccpf1->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ccpf1->Coverage );
return error;
}
-static void Free_ChainContextPos1( HB_ChainContextPosFormat1* ccpf1,
- FT_Memory memory )
+static void Free_ChainContextPos1( HB_ChainContextPosFormat1* ccpf1 )
{
FT_UShort n, count;
cprs = ccpf1->ChainPosRuleSet;
for ( n = 0; n < count; n++ )
- Free_ChainPosRuleSet( &cprs[n], memory );
+ Free_ChainPosRuleSet( &cprs[n] );
FREE( cprs );
}
- _HB_OPEN_Free_Coverage( &ccpf1->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ccpf1->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_ChainPosClassRule( HB_ChainPosClassRule* cpcr,
- FT_Memory memory )
+static void Free_ChainPosClassRule( HB_ChainPosClassRule* cpcr )
{
FREE( cpcr->PosLookupRecord );
FREE( cpcr->Lookahead );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_ChainPosClassRule( &cpcr[m], memory );
+ Free_ChainPosClassRule( &cpcr[m] );
FREE( cpcr );
return error;
}
-static void Free_ChainPosClassSet( HB_ChainPosClassSet* cpcs,
- FT_Memory memory )
+static void Free_ChainPosClassSet( HB_ChainPosClassSet* cpcs )
{
FT_UShort n, count;
cpcr = cpcs->ChainPosClassRule;
for ( n = 0; n < count; n++ )
- Free_ChainPosClassRule( &cpcr[n], memory );
+ Free_ChainPosClassRule( &cpcr[n] );
FREE( cpcr );
}
}
-static HB_Error GPOS_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd,
- FT_UShort limit,
- FT_ULong class_offset,
- FT_ULong base_offset,
- FT_Stream stream )
-{
- HB_Error error;
- FT_ULong cur_offset;
-
- cur_offset = FILE_Pos();
-
- if ( class_offset )
- {
- if ( !FILE_Seek( class_offset + base_offset ) )
- error = _HB_OPEN_Load_ClassDefinition( cd, limit, stream );
- }
- else
- error = _HB_OPEN_Load_EmptyClassDefinition ( cd, stream );
-
- if (error == HB_Err_Ok)
- (void)FILE_Seek( cur_offset ); /* Changes error as a side-effect */
-
- return error;
-}
-
/* ChainContextPosFormat2 */
static HB_Error Load_ChainContextPos2( HB_ChainContextPosFormat2* ccpf2,
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
FORGET_Frame();
- if ( ( error = GPOS_Load_EmptyOrClassDefinition( &ccpf2->BacktrackClassDef, 65535,
+ if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->BacktrackClassDef, 65535,
backtrack_offset, base_offset,
stream ) ) != HB_Err_Ok )
goto Fail5;
- if ( ( error = GPOS_Load_EmptyOrClassDefinition( &ccpf2->InputClassDef, count,
+ if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->InputClassDef, count,
input_offset, base_offset,
stream ) ) != HB_Err_Ok )
goto Fail4;
- if ( ( error = GPOS_Load_EmptyOrClassDefinition( &ccpf2->LookaheadClassDef, 65535,
+ if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccpf2->LookaheadClassDef, 65535,
lookahead_offset, base_offset,
stream ) ) != HB_Err_Ok )
goto Fail3;
Fail1:
for ( m = 0; m < n; m++ )
- Free_ChainPosClassSet( &cpcs[m], memory );
+ Free_ChainPosClassSet( &cpcs[m] );
FREE( cpcs );
Fail2:
- _HB_OPEN_Free_ClassDefinition( &ccpf2->LookaheadClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &ccpf2->LookaheadClassDef );
Fail3:
- _HB_OPEN_Free_ClassDefinition( &ccpf2->InputClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &ccpf2->InputClassDef );
Fail4:
- _HB_OPEN_Free_ClassDefinition( &ccpf2->BacktrackClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &ccpf2->BacktrackClassDef );
Fail5:
- _HB_OPEN_Free_Coverage( &ccpf2->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ccpf2->Coverage );
return error;
}
-static void Free_ChainContextPos2( HB_ChainContextPosFormat2* ccpf2,
- FT_Memory memory )
+static void Free_ChainContextPos2( HB_ChainContextPosFormat2* ccpf2 )
{
FT_UShort n, count;
cpcs = ccpf2->ChainPosClassSet;
for ( n = 0; n < count; n++ )
- Free_ChainPosClassSet( &cpcs[n], memory );
+ Free_ChainPosClassSet( &cpcs[n] );
FREE( cpcs );
}
- _HB_OPEN_Free_ClassDefinition( &ccpf2->LookaheadClassDef, memory );
- _HB_OPEN_Free_ClassDefinition( &ccpf2->InputClassDef, memory );
- _HB_OPEN_Free_ClassDefinition( &ccpf2->BacktrackClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &ccpf2->LookaheadClassDef );
+ _HB_OPEN_Free_ClassDefinition( &ccpf2->InputClassDef );
+ _HB_OPEN_Free_ClassDefinition( &ccpf2->BacktrackClassDef );
- _HB_OPEN_Free_Coverage( &ccpf2->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ccpf2->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, nb, ni, nl, m, count;
FT_UShort backtrack_count, input_count, lookahead_count;
Fail2:
for ( m = 0; m < nl; m++ )
- _HB_OPEN_Free_Coverage( &l[m], memory );
+ _HB_OPEN_Free_Coverage( &l[m] );
FREE( l );
Fail3:
for ( m = 0; m < ni; m++ )
- _HB_OPEN_Free_Coverage( &i[m], memory );
+ _HB_OPEN_Free_Coverage( &i[m] );
FREE( i );
Fail4:
for ( m = 0; m < nb; m++ )
- _HB_OPEN_Free_Coverage( &b[m], memory );
+ _HB_OPEN_Free_Coverage( &b[m] );
FREE( b );
return error;
}
-static void Free_ChainContextPos3( HB_ChainContextPosFormat3* ccpf3,
- FT_Memory memory )
+static void Free_ChainContextPos3( HB_ChainContextPosFormat3* ccpf3 )
{
FT_UShort n, count;
c = ccpf3->LookaheadCoverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
c = ccpf3->InputCoverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
c = ccpf3->BacktrackCoverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
}
-static void Free_ChainContextPos( HB_GPOS_SubTable* st,
- FT_Memory memory )
+static void Free_ChainContextPos( HB_GPOS_SubTable* st )
{
HB_ChainContextPos* ccp = &st->chain;
switch ( ccp->PosFormat )
{
- case 1: Free_ChainContextPos1( &ccp->ccpf.ccpf1, memory ); break;
- case 2: Free_ChainContextPos2( &ccp->ccpf.ccpf2, memory ); break;
- case 3: Free_ChainContextPos3( &ccp->ccpf.ccpf3, memory ); break;
+ case 1: Free_ChainContextPos1( &ccp->ccpf.ccpf1 ); break;
+ case 2: Free_ChainContextPos2( &ccp->ccpf.ccpf2 ); break;
+ case 3: Free_ChainContextPos3( &ccp->ccpf.ccpf3 ); break;
default: break;
}
}
int nesting_level )
{
FT_UShort index, property;
- FT_Memory memory = gpi->face->memory;
HB_Error error;
FT_UShort i, j, k;
FT_UShort bgc, igc, lgc;
FT_ULong** script_tag_list )
{
HB_Error error;
- FT_Memory memory;
FT_UShort n;
FT_ULong* stl;
if ( !gpos || !script_tag_list )
return HB_Err_Invalid_Argument;
- memory = gpos->memory;
sl = &gpos->ScriptList;
sr = sl->ScriptRecord;
FT_ULong** language_tag_list )
{
HB_Error error;
- FT_Memory memory;
FT_UShort n;
FT_ULong* ltl;
if ( !gpos || !language_tag_list )
return HB_Err_Invalid_Argument;
- memory = gpos->memory;
sl = &gpos->ScriptList;
sr = sl->ScriptRecord;
{
FT_UShort n;
HB_Error error;
- FT_Memory memory;
FT_ULong* ftl;
HB_ScriptList* sl;
if ( !gpos || !feature_tag_list )
return HB_Err_Invalid_Argument;
- memory = gpos->memory;
sl = &gpos->ScriptList;
sr = sl->ScriptRecord;
void _HB_GPOS_Free_SubTable( HB_GPOS_SubTable* st,
- FT_Memory memory,
FT_UShort lookup_type )
{
switch ( lookup_type ) {
- case HB_GPOS_LOOKUP_SINGLE: Free_SinglePos ( st, memory ); return;
- case HB_GPOS_LOOKUP_PAIR: Free_PairPos ( st, memory ); return;
- case HB_GPOS_LOOKUP_CURSIVE: Free_CursivePos ( st, memory ); return;
- case HB_GPOS_LOOKUP_MARKBASE: Free_MarkBasePos ( st, memory ); return;
- case HB_GPOS_LOOKUP_MARKLIG: Free_MarkLigPos ( st, memory ); return;
- case HB_GPOS_LOOKUP_MARKMARK: Free_MarkMarkPos ( st, memory ); return;
- case HB_GPOS_LOOKUP_CONTEXT: Free_ContextPos ( st, memory ); return;
- case HB_GPOS_LOOKUP_CHAIN: Free_ChainContextPos ( st, memory ); return;
- /*case HB_GPOS_LOOKUP_EXTENSION: Free_ExtensionPos ( st, memory ); return;*/
+ case HB_GPOS_LOOKUP_SINGLE: Free_SinglePos ( st ); return;
+ case HB_GPOS_LOOKUP_PAIR: Free_PairPos ( st ); return;
+ case HB_GPOS_LOOKUP_CURSIVE: Free_CursivePos ( st ); return;
+ case HB_GPOS_LOOKUP_MARKBASE: Free_MarkBasePos ( st ); return;
+ case HB_GPOS_LOOKUP_MARKLIG: Free_MarkLigPos ( st ); return;
+ case HB_GPOS_LOOKUP_MARKMARK: Free_MarkMarkPos ( st ); return;
+ case HB_GPOS_LOOKUP_CONTEXT: Free_ContextPos ( st ); return;
+ case HB_GPOS_LOOKUP_CHAIN: Free_ChainContextPos ( st ); return;
+ /*case HB_GPOS_LOOKUP_EXTENSION: Free_ExtensionPos ( st ); return;*/
default: return;
}
}
lookup_count = gpos->LookupList.LookupCount;
+ if ( gpos->FeatureList.ApplyCount )
+ {
+ memset (buffer->positions, 0, sizeof (buffer->positions[0]) * buffer->in_length);
+ }
+
for ( i = 0; i < gpos->FeatureList.ApplyCount; i++ )
{
FT_UShort feature_index = gpos->FeatureList.ApplyOrder[i];
}
}
- error = Position_CursiveChain ( buffer );
- if ( error )
- return error;
+ if ( gpos->FeatureList.ApplyCount )
+ {
+ error = Position_CursiveChain ( buffer );
+ if ( error )
+ return error;
+ }
return retError;
}
struct HB_GPOSHeader_
{
- FT_Memory memory;
-
FT_Fixed Version;
HB_ScriptList ScriptList;
FT_UShort lookup_type );
void _HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st,
- FT_Memory memory,
FT_UShort lookup_type );
FT_END_HEADER
HB_GDEFHeader* gdef )
{
FT_Stream stream = face->stream;
- FT_Memory memory = face->memory;
HB_Error error;
FT_ULong cur_offset, new_offset, base_offset;
if ( ALLOC ( gsub, sizeof( *gsub ) ) )
return error;
- gsub->memory = memory;
/* skip version */
return HB_Err_Ok;
Fail1:
- _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB, memory );
+ _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB );
Fail2:
- _HB_OPEN_Free_FeatureList( &gsub->FeatureList, memory );
+ _HB_OPEN_Free_FeatureList( &gsub->FeatureList );
Fail3:
- _HB_OPEN_Free_ScriptList( &gsub->ScriptList, memory );
+ _HB_OPEN_Free_ScriptList( &gsub->ScriptList );
Fail4:
FREE ( gsub );
HB_Error HB_Done_GSUB_Table( HB_GSUBHeader* gsub )
{
- FT_Memory memory = gsub->memory;
-
- _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB, memory );
- _HB_OPEN_Free_FeatureList( &gsub->FeatureList, memory );
- _HB_OPEN_Free_ScriptList( &gsub->ScriptList, memory );
+ _HB_OPEN_Free_LookupList( &gsub->LookupList, HB_Type_GSUB );
+ _HB_OPEN_Free_FeatureList( &gsub->FeatureList );
+ _HB_OPEN_Free_ScriptList( &gsub->ScriptList );
FREE( gsub );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_SingleSubst* ss = &st->single;
FT_UShort n, count;
FREE( s );
Fail2:
- _HB_OPEN_Free_Coverage( &ss->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ss->Coverage );
return error;
}
-static void Free_SingleSubst( HB_GSUB_SubTable* st,
- FT_Memory memory )
+static void Free_SingleSubst( HB_GSUB_SubTable* st )
{
HB_SingleSubst* ss = &st->single;
break;
}
- _HB_OPEN_Free_Coverage( &ss->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ss->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_UShort* sub;
}
-static void Free_Sequence( HB_Sequence* s,
- FT_Memory memory )
+static void Free_Sequence( HB_Sequence* s )
{
FREE( s->Substitute );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_MultipleSubst* ms = &st->multiple;
FT_UShort n = 0, m, count;
Fail1:
for ( m = 0; m < n; m++ )
- Free_Sequence( &s[m], memory );
+ Free_Sequence( &s[m] );
FREE( s );
Fail2:
- _HB_OPEN_Free_Coverage( &ms->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ms->Coverage );
return error;
}
-static void Free_MultipleSubst( HB_GSUB_SubTable* st,
- FT_Memory memory )
+static void Free_MultipleSubst( HB_GSUB_SubTable* st )
{
FT_UShort n, count;
HB_MultipleSubst* ms = &st->multiple;
s = ms->Sequence;
for ( n = 0; n < count; n++ )
- Free_Sequence( &s[n], memory );
+ Free_Sequence( &s[n] );
FREE( s );
}
- _HB_OPEN_Free_Coverage( &ms->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ms->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_UShort* a;
}
-static void Free_AlternateSet( HB_AlternateSet* as,
- FT_Memory memory )
+static void Free_AlternateSet( HB_AlternateSet* as )
{
FREE( as->Alternate );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_AlternateSubst* as = &st->alternate;
FT_UShort n = 0, m, count;
Fail1:
for ( m = 0; m < n; m++ )
- Free_AlternateSet( &aset[m], memory );
+ Free_AlternateSet( &aset[m] );
FREE( aset );
Fail2:
- _HB_OPEN_Free_Coverage( &as->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &as->Coverage );
return error;
}
-static void Free_AlternateSubst( HB_GSUB_SubTable* st,
- FT_Memory memory )
+static void Free_AlternateSubst( HB_GSUB_SubTable* st )
{
FT_UShort n, count;
HB_AlternateSubst* as = &st->alternate;
aset = as->AlternateSet;
for ( n = 0; n < count; n++ )
- Free_AlternateSet( &aset[n], memory );
+ Free_AlternateSet( &aset[n] );
FREE( aset );
}
- _HB_OPEN_Free_Coverage( &as->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &as->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_UShort* c;
}
-static void Free_Ligature( HB_Ligature* l,
- FT_Memory memory )
+static void Free_Ligature( HB_Ligature* l )
{
FREE( l->Component );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_Ligature( &l[m], memory );
+ Free_Ligature( &l[m] );
FREE( l );
return error;
}
-static void Free_LigatureSet( HB_LigatureSet* ls,
- FT_Memory memory )
+static void Free_LigatureSet( HB_LigatureSet* ls )
{
FT_UShort n, count;
l = ls->Ligature;
for ( n = 0; n < count; n++ )
- Free_Ligature( &l[n], memory );
+ Free_Ligature( &l[n] );
FREE( l );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_LigatureSubst* ls = &st->ligature;
FT_UShort n = 0, m, count;
Fail1:
for ( m = 0; m < n; m++ )
- Free_LigatureSet( &lset[m], memory );
+ Free_LigatureSet( &lset[m] );
FREE( lset );
Fail2:
- _HB_OPEN_Free_Coverage( &ls->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ls->Coverage );
return error;
}
-static void Free_LigatureSubst( HB_GSUB_SubTable* st,
- FT_Memory memory )
+static void Free_LigatureSubst( HB_GSUB_SubTable* st )
{
FT_UShort n, count;
HB_LigatureSubst* ls = &st->ligature;
lset = ls->LigatureSet;
for ( n = 0; n < count; n++ )
- Free_LigatureSet( &lset[n], memory );
+ Free_LigatureSet( &lset[n] );
FREE( lset );
}
- _HB_OPEN_Free_Coverage( &ls->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ls->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_UShort* i;
}
-static void Free_SubRule( HB_SubRule* sr,
- FT_Memory memory )
+static void Free_SubRule( HB_SubRule* sr )
{
FREE( sr->SubstLookupRecord );
FREE( sr->Input );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_SubRule( &sr[m], memory );
+ Free_SubRule( &sr[m] );
FREE( sr );
return error;
}
-static void Free_SubRuleSet( HB_SubRuleSet* srs,
- FT_Memory memory )
+static void Free_SubRuleSet( HB_SubRuleSet* srs )
{
FT_UShort n, count;
sr = srs->SubRule;
for ( n = 0; n < count; n++ )
- Free_SubRule( &sr[n], memory );
+ Free_SubRule( &sr[n] );
FREE( sr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail1:
for ( m = 0; m < n; m++ )
- Free_SubRuleSet( &srs[m], memory );
+ Free_SubRuleSet( &srs[m] );
FREE( srs );
Fail2:
- _HB_OPEN_Free_Coverage( &csf1->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &csf1->Coverage );
return error;
}
-static void Free_ContextSubst1( HB_ContextSubstFormat1* csf1,
- FT_Memory memory )
+static void Free_ContextSubst1( HB_ContextSubstFormat1* csf1 )
{
FT_UShort n, count;
srs = csf1->SubRuleSet;
for ( n = 0; n < count; n++ )
- Free_SubRuleSet( &srs[n], memory );
+ Free_SubRuleSet( &srs[n] );
FREE( srs );
}
- _HB_OPEN_Free_Coverage( &csf1->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &csf1->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_SubClassRule( HB_SubClassRule* scr,
- FT_Memory memory )
+static void Free_SubClassRule( HB_SubClassRule* scr )
{
FREE( scr->SubstLookupRecord );
FREE( scr->Class );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_SubClassRule( &scr[m], memory );
+ Free_SubClassRule( &scr[m] );
FREE( scr );
return error;
}
-static void Free_SubClassSet( HB_SubClassSet* scs,
- FT_Memory memory )
+static void Free_SubClassSet( HB_SubClassSet* scs )
{
FT_UShort n, count;
scr = scs->SubClassRule;
for ( n = 0; n < count; n++ )
- Free_SubClassRule( &scr[n], memory );
+ Free_SubClassRule( &scr[n] );
FREE( scr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail1:
for ( m = 0; m < n; m++ )
- Free_SubClassSet( &scs[m], memory );
+ Free_SubClassSet( &scs[m] );
FREE( scs );
Fail2:
- _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef );
Fail3:
- _HB_OPEN_Free_Coverage( &csf2->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &csf2->Coverage );
return error;
}
-static void Free_ContextSubst2( HB_ContextSubstFormat2* csf2,
- FT_Memory memory )
+static void Free_ContextSubst2( HB_ContextSubstFormat2* csf2 )
{
FT_UShort n, count;
scs = csf2->SubClassSet;
for ( n = 0; n < count; n++ )
- Free_SubClassSet( &scs[n], memory );
+ Free_SubClassSet( &scs[n] );
FREE( scs );
}
- _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef, memory );
- _HB_OPEN_Free_Coverage( &csf2->Coverage, memory );
+ _HB_OPEN_Free_ClassDefinition( &csf2->ClassDef );
+ _HB_OPEN_Free_Coverage( &csf2->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail2:
for ( m = 0; m < n; m++ )
- _HB_OPEN_Free_Coverage( &c[m], memory );
+ _HB_OPEN_Free_Coverage( &c[m] );
FREE( c );
return error;
}
-static void Free_ContextSubst3( HB_ContextSubstFormat3* csf3,
- FT_Memory memory )
+static void Free_ContextSubst3( HB_ContextSubstFormat3* csf3 )
{
FT_UShort n, count;
c = csf3->Coverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
}
-static void Free_ContextSubst( HB_GSUB_SubTable* st,
- FT_Memory memory )
+static void Free_ContextSubst( HB_GSUB_SubTable* st )
{
HB_ContextSubst* cs = &st->context;
switch ( cs->SubstFormat )
{
- case 1: Free_ContextSubst1( &cs->csf.csf1, memory ); break;
- case 2: Free_ContextSubst2( &cs->csf.csf2, memory ); break;
- case 3: Free_ContextSubst3( &cs->csf.csf3, memory ); break;
+ case 1: Free_ContextSubst1( &cs->csf.csf1 ); break;
+ case 2: Free_ContextSubst2( &cs->csf.csf2 ); break;
+ case 3: Free_ContextSubst3( &cs->csf.csf3 ); break;
default: break;
}
}
{
FT_UShort index, property;
HB_Error error;
- FT_Memory memory = gsub->memory;
FT_UShort i, j, k, known_classes;
FT_UShort* classes;
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_UShort* b;
}
-static void Free_ChainSubRule( HB_ChainSubRule* csr,
- FT_Memory memory )
+static void Free_ChainSubRule( HB_ChainSubRule* csr )
{
FREE( csr->SubstLookupRecord );
FREE( csr->Lookahead );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_ChainSubRule( &csr[m], memory );
+ Free_ChainSubRule( &csr[m] );
FREE( csr );
return error;
}
-static void Free_ChainSubRuleSet( HB_ChainSubRuleSet* csrs,
- FT_Memory memory )
+static void Free_ChainSubRuleSet( HB_ChainSubRuleSet* csrs )
{
FT_UShort n, count;
csr = csrs->ChainSubRule;
for ( n = 0; n < count; n++ )
- Free_ChainSubRule( &csr[n], memory );
+ Free_ChainSubRule( &csr[n] );
FREE( csr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail1:
for ( m = 0; m < n; m++ )
- Free_ChainSubRuleSet( &csrs[m], memory );
+ Free_ChainSubRuleSet( &csrs[m] );
FREE( csrs );
Fail2:
- _HB_OPEN_Free_Coverage( &ccsf1->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ccsf1->Coverage );
return error;
}
-static void Free_ChainContextSubst1( HB_ChainContextSubstFormat1* ccsf1,
- FT_Memory memory )
+static void Free_ChainContextSubst1( HB_ChainContextSubstFormat1* ccsf1 )
{
FT_UShort n, count;
csrs = ccsf1->ChainSubRuleSet;
for ( n = 0; n < count; n++ )
- Free_ChainSubRuleSet( &csrs[n], memory );
+ Free_ChainSubRuleSet( &csrs[n] );
FREE( csrs );
}
- _HB_OPEN_Free_Coverage( &ccsf1->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ccsf1->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_ChainSubClassRule( HB_ChainSubClassRule* cscr,
- FT_Memory memory )
+static void Free_ChainSubClassRule( HB_ChainSubClassRule* cscr )
{
FREE( cscr->SubstLookupRecord );
FREE( cscr->Lookahead );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_ChainSubClassRule( &cscr[m], memory );
+ Free_ChainSubClassRule( &cscr[m] );
FREE( cscr );
return error;
}
-static void Free_ChainSubClassSet( HB_ChainSubClassSet* cscs,
- FT_Memory memory )
+static void Free_ChainSubClassSet( HB_ChainSubClassSet* cscs )
{
FT_UShort n, count;
cscr = cscs->ChainSubClassRule;
for ( n = 0; n < count; n++ )
- Free_ChainSubClassRule( &cscr[n], memory );
+ Free_ChainSubClassRule( &cscr[n] );
FREE( cscr );
}
}
-static HB_Error GSUB_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd,
- FT_UShort limit,
- FT_ULong class_offset,
- FT_ULong base_offset,
- FT_Stream stream )
-{
- HB_Error error;
- FT_ULong cur_offset;
-
- cur_offset = FILE_Pos();
-
- if ( class_offset )
- {
- if ( !FILE_Seek( class_offset + base_offset ) )
- error = _HB_OPEN_Load_ClassDefinition( cd, limit, stream );
- }
- else
- error = _HB_OPEN_Load_EmptyClassDefinition ( cd, stream );
-
- if (error == HB_Err_Ok)
- (void)FILE_Seek( cur_offset ); /* Changes error as a side-effect */
-
- return error;
-}
-
/* ChainContextSubstFormat2 */
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n = 0, m, count;
FT_ULong cur_offset, new_offset, base_offset;
FORGET_Frame();
- if ( ( error = GSUB_Load_EmptyOrClassDefinition( &ccsf2->BacktrackClassDef, 65535,
+ if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->BacktrackClassDef, 65535,
backtrack_offset, base_offset,
stream ) ) != HB_Err_Ok )
goto Fail5;
- if ( ( error = GSUB_Load_EmptyOrClassDefinition( &ccsf2->InputClassDef, count,
+ if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->InputClassDef, count,
input_offset, base_offset,
stream ) ) != HB_Err_Ok )
goto Fail4;
- if ( ( error = GSUB_Load_EmptyOrClassDefinition( &ccsf2->LookaheadClassDef, 65535,
+ if ( ( error = _HB_OPEN_Load_EmptyOrClassDefinition( &ccsf2->LookaheadClassDef, 65535,
lookahead_offset, base_offset,
stream ) ) != HB_Err_Ok )
goto Fail3;
Fail1:
for ( m = 0; m < n; m++ )
- Free_ChainSubClassSet( &cscs[m], memory );
+ Free_ChainSubClassSet( &cscs[m] );
FREE( cscs );
Fail2:
- _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef );
Fail3:
- _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef );
Fail4:
- _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef );
Fail5:
- _HB_OPEN_Free_Coverage( &ccsf2->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ccsf2->Coverage );
return error;
}
-static void Free_ChainContextSubst2( HB_ChainContextSubstFormat2* ccsf2,
- FT_Memory memory )
+static void Free_ChainContextSubst2( HB_ChainContextSubstFormat2* ccsf2 )
{
FT_UShort n, count;
cscs = ccsf2->ChainSubClassSet;
for ( n = 0; n < count; n++ )
- Free_ChainSubClassSet( &cscs[n], memory );
+ Free_ChainSubClassSet( &cscs[n] );
FREE( cscs );
}
- _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef, memory );
- _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef, memory );
- _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef, memory );
+ _HB_OPEN_Free_ClassDefinition( &ccsf2->LookaheadClassDef );
+ _HB_OPEN_Free_ClassDefinition( &ccsf2->InputClassDef );
+ _HB_OPEN_Free_ClassDefinition( &ccsf2->BacktrackClassDef );
- _HB_OPEN_Free_Coverage( &ccsf2->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &ccsf2->Coverage );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, nb = 0, ni =0, nl = 0, m, count;
FT_UShort backtrack_count, input_count, lookahead_count;
Fail2:
for ( m = 0; m < nl; m++ )
- _HB_OPEN_Free_Coverage( &l[m], memory );
+ _HB_OPEN_Free_Coverage( &l[m] );
FREE( l );
Fail3:
for ( m = 0; m < ni; m++ )
- _HB_OPEN_Free_Coverage( &i[m], memory );
+ _HB_OPEN_Free_Coverage( &i[m] );
FREE( i );
Fail4:
for ( m = 0; m < nb; m++ )
- _HB_OPEN_Free_Coverage( &b[m], memory );
+ _HB_OPEN_Free_Coverage( &b[m] );
FREE( b );
return error;
}
-static void Free_ChainContextSubst3( HB_ChainContextSubstFormat3* ccsf3,
- FT_Memory memory )
+static void Free_ChainContextSubst3( HB_ChainContextSubstFormat3* ccsf3 )
{
FT_UShort n, count;
c = ccsf3->LookaheadCoverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
c = ccsf3->InputCoverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
c = ccsf3->BacktrackCoverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
}
-static void Free_ChainContextSubst( HB_GSUB_SubTable* st,
- FT_Memory memory )
+static void Free_ChainContextSubst( HB_GSUB_SubTable* st )
{
HB_ChainContextSubst* ccs = &st->chain;
switch ( ccs->SubstFormat ) {
- case 1: Free_ChainContextSubst1( &ccs->ccsf.ccsf1, memory ); break;
- case 2: Free_ChainContextSubst2( &ccs->ccsf.ccsf2, memory ); break;
- case 3: Free_ChainContextSubst3( &ccs->ccsf.ccsf3, memory ); break;
+ case 1: Free_ChainContextSubst1( &ccs->ccsf.ccsf1 ); break;
+ case 2: Free_ChainContextSubst2( &ccs->ccsf.ccsf2 ); break;
+ case 3: Free_ChainContextSubst3( &ccs->ccsf.ccsf3 ); break;
default: break;
}
}
int nesting_level )
{
FT_UShort index, property;
- FT_Memory memory;
HB_Error error;
FT_UShort i, j, k;
FT_UShort bgc, igc, lgc;
gdef = gsub->gdef;
- memory = gsub->memory;
if ( CHECK_Property( gdef, IN_CURITEM(), flags, &property ) )
return error;
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
HB_ReverseChainContextSubst* rccs = &st->reverse;
FT_UShort m, count;
Fail2:
for ( m = 0; m < nl; m++ )
- _HB_OPEN_Free_Coverage( &l[m], memory );
+ _HB_OPEN_Free_Coverage( &l[m] );
FREE( l );
Fail3:
for ( m = 0; m < nb; m++ )
- _HB_OPEN_Free_Coverage( &b[m], memory );
+ _HB_OPEN_Free_Coverage( &b[m] );
FREE( b );
Fail4:
- _HB_OPEN_Free_Coverage( &rccs->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &rccs->Coverage );
return error;
}
-static void Free_ReverseChainContextSubst( HB_GSUB_SubTable* st,
- FT_Memory memory )
+static void Free_ReverseChainContextSubst( HB_GSUB_SubTable* st )
{
FT_UShort n, count;
HB_ReverseChainContextSubst* rccs = &st->reverse;
HB_Coverage* c;
- _HB_OPEN_Free_Coverage( &rccs->Coverage, memory );
+ _HB_OPEN_Free_Coverage( &rccs->Coverage );
if ( rccs->LookaheadCoverage )
{
c = rccs->LookaheadCoverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
c = rccs->BacktrackCoverage;
for ( n = 0; n < count; n++ )
- _HB_OPEN_Free_Coverage( &c[n], memory );
+ _HB_OPEN_Free_Coverage( &c[n] );
FREE( c );
}
{
FT_UShort n;
HB_Error error;
- FT_Memory memory;
FT_ULong* stl;
HB_ScriptList* sl;
if ( !gsub || !script_tag_list )
return HB_Err_Invalid_Argument;
- memory = gsub->memory;
-
sl = &gsub->ScriptList;
sr = sl->ScriptRecord;
{
FT_UShort n;
HB_Error error;
- FT_Memory memory;
FT_ULong* ltl;
HB_ScriptList* sl;
if ( !gsub || !language_tag_list )
return HB_Err_Invalid_Argument;
- memory = gsub->memory;
-
sl = &gsub->ScriptList;
sr = sl->ScriptRecord;
{
FT_UShort n;
HB_Error error;
- FT_Memory memory;
FT_ULong* ftl;
HB_ScriptList* sl;
if ( !gsub || !feature_tag_list )
return HB_Err_Invalid_Argument;
- memory = gsub->memory;
-
sl = &gsub->ScriptList;
sr = sl->ScriptRecord;
void _HB_GSUB_Free_SubTable( HB_GSUB_SubTable* st,
- FT_Memory memory,
FT_UShort lookup_type )
{
switch ( lookup_type ) {
- case HB_GSUB_LOOKUP_SINGLE: Free_SingleSubst ( st, memory ); return;
- case HB_GSUB_LOOKUP_MULTIPLE: Free_MultipleSubst ( st, memory ); return;
- case HB_GSUB_LOOKUP_ALTERNATE: Free_AlternateSubst ( st, memory ); return;
- case HB_GSUB_LOOKUP_LIGATURE: Free_LigatureSubst ( st, memory ); return;
- case HB_GSUB_LOOKUP_CONTEXT: Free_ContextSubst ( st, memory ); return;
- case HB_GSUB_LOOKUP_CHAIN: Free_ChainContextSubst ( st, memory ); return;
- /*case HB_GSUB_LOOKUP_EXTENSION: Free_ExtensionSubst ( st, memory ); return;*/
- case HB_GSUB_LOOKUP_REVERSE_CHAIN: Free_ReverseChainContextSubst ( st, memory ); return;
- default: return;
+ case HB_GSUB_LOOKUP_SINGLE: Free_SingleSubst ( st ); return;
+ case HB_GSUB_LOOKUP_MULTIPLE: Free_MultipleSubst ( st ); return;
+ case HB_GSUB_LOOKUP_ALTERNATE: Free_AlternateSubst ( st ); return;
+ case HB_GSUB_LOOKUP_LIGATURE: Free_LigatureSubst ( st ); return;
+ case HB_GSUB_LOOKUP_CONTEXT: Free_ContextSubst ( st ); return;
+ case HB_GSUB_LOOKUP_CHAIN: Free_ChainContextSubst ( st ); return;
+ /*case HB_GSUB_LOOKUP_EXTENSION: Free_ExtensionSubst ( st ); return;*/
+ case HB_GSUB_LOOKUP_REVERSE_CHAIN: Free_ReverseChainContextSubst ( st ); return;
+ default: return;
};
}
struct HB_GSUBHeader_
{
- FT_Memory memory;
-
FT_ULong offset;
FT_Fixed Version;
HB_Error _HB_OPEN_Load_ClassDefinition( HB_ClassDefinition* cd,
FT_UShort limit,
FT_Stream input );
-HB_Error _HB_OPEN_Load_EmptyClassDefinition( HB_ClassDefinition* cd,
- FT_Stream input );
+HB_Error _HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd,
+ FT_UShort limit,
+ FT_ULong class_offset,
+ FT_ULong base_offset,
+ FT_Stream stream );
HB_Error _HB_OPEN_Load_Device( HB_Device* d,
FT_Stream input );
-void _HB_OPEN_Free_ScriptList( HB_ScriptList* sl,
- FT_Memory memory );
-void _HB_OPEN_Free_FeatureList( HB_FeatureList* fl,
- FT_Memory memory );
+void _HB_OPEN_Free_ScriptList( HB_ScriptList* sl );
+void _HB_OPEN_Free_FeatureList( HB_FeatureList* fl );
void _HB_OPEN_Free_LookupList( HB_LookupList* ll,
- HB_Type type,
- FT_Memory memory );
+ HB_Type type );
-void _HB_OPEN_Free_Coverage( HB_Coverage* c,
- FT_Memory memory );
-void _HB_OPEN_Free_ClassDefinition( HB_ClassDefinition* cd,
- FT_Memory memory );
-void _HB_OPEN_Free_Device( HB_Device* d,
- FT_Memory memory );
+void _HB_OPEN_Free_Coverage( HB_Coverage* c );
+void _HB_OPEN_Free_ClassDefinition( HB_ClassDefinition* cd );
+void _HB_OPEN_Free_Device( HB_Device* d );
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
FT_UShort* fi;
}
-static void Free_LangSys( HB_LangSys* ls,
- FT_Memory memory )
+static void Free_LangSys( HB_LangSys* ls )
{
FREE( ls->FeatureIndex );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail1:
for ( m = 0; m < n; m++ )
- Free_LangSys( &lsr[m].LangSys, memory );
+ Free_LangSys( &lsr[m].LangSys );
FREE( s->LangSysRecord );
Fail2:
- Free_LangSys( &s->DefaultLangSys, memory );
+ Free_LangSys( &s->DefaultLangSys );
return error;
}
-static void Free_Script( HB_Script* s,
- FT_Memory memory )
+static void Free_Script( HB_Script* s )
{
FT_UShort n, count;
HB_LangSysRecord* lsr;
- Free_LangSys( &s->DefaultLangSys, memory );
+ Free_LangSys( &s->DefaultLangSys );
if ( s->LangSysRecord )
{
lsr = s->LangSysRecord;
for ( n = 0; n < count; n++ )
- Free_LangSys( &lsr[n].LangSys, memory );
+ Free_LangSys( &lsr[n].LangSys );
FREE( lsr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, script_count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( n = 0; n < sl->ScriptCount; n++ )
- Free_Script( &sr[n].Script, memory );
+ Free_Script( &sr[n].Script );
FREE( sl->ScriptRecord );
return error;
}
-void _HB_OPEN_Free_ScriptList( HB_ScriptList* sl,
- FT_Memory memory )
+void _HB_OPEN_Free_ScriptList( HB_ScriptList* sl )
{
FT_UShort n, count;
sr = sl->ScriptRecord;
for ( n = 0; n < count; n++ )
- Free_Script( &sr[n].Script, memory );
+ Free_Script( &sr[n].Script );
FREE( sr );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_Feature( HB_Feature* f,
- FT_Memory memory )
+static void Free_Feature( HB_Feature* f )
{
FREE( f->LookupListIndex );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail1:
for ( m = 0; m < n; m++ )
- Free_Feature( &fr[m].Feature, memory );
+ Free_Feature( &fr[m].Feature );
FREE( fl->ApplyOrder );
}
-void _HB_OPEN_Free_FeatureList( HB_FeatureList* fl,
- FT_Memory memory)
+void _HB_OPEN_Free_FeatureList( HB_FeatureList* fl )
{
FT_UShort n, count;
fr = fl->FeatureRecord;
for ( n = 0; n < count; n++ )
- Free_Feature( &fr[n].Feature, memory );
+ Free_Feature( &fr[n].Feature );
FREE( fr );
}
static void Free_SubTable( HB_SubTable* st,
HB_Type table_type,
- FT_UShort lookup_type,
- FT_Memory memory )
+ FT_UShort lookup_type )
{
if ( table_type == HB_Type_GSUB )
- _HB_GSUB_Free_SubTable ( &st->st.gsub, memory, lookup_type );
+ _HB_GSUB_Free_SubTable ( &st->st.gsub, lookup_type );
else
- _HB_GPOS_Free_SubTable ( &st->st.gpos, memory, lookup_type );
+ _HB_GPOS_Free_SubTable ( &st->st.gpos, lookup_type );
}
HB_Type type )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
Fail:
for ( m = 0; m < n; m++ )
- Free_SubTable( &st[m], type, l->LookupType, memory );
+ Free_SubTable( &st[m], type, l->LookupType );
FREE( l->SubTable );
return error;
static void Free_Lookup( HB_Lookup* l,
- HB_Type type,
- FT_Memory memory)
+ HB_Type type )
{
FT_UShort n, count;
st = l->SubTable;
for ( n = 0; n < count; n++ )
- Free_SubTable( &st[n], type, l->LookupType, memory );
+ Free_SubTable( &st[n], type, l->LookupType );
FREE( st );
}
HB_Type type )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, m, count;
FT_ULong cur_offset, new_offset, base_offset;
FREE( ll->Properties );
for ( m = 0; m < n; m++ )
- Free_Lookup( &l[m], type, memory );
+ Free_Lookup( &l[m], type );
Fail2:
FREE( ll->Lookup );
void _HB_OPEN_Free_LookupList( HB_LookupList* ll,
- HB_Type type,
- FT_Memory memory )
+ HB_Type type )
{
FT_UShort n, count;
l = ll->Lookup;
for ( n = 0; n < count; n++ )
- Free_Lookup( &l[n], type, memory );
+ Free_Lookup( &l[n], type );
FREE( l );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_Coverage1( HB_CoverageFormat1* cf1,
- FT_Memory memory)
+static void Free_Coverage1( HB_CoverageFormat1* cf1 )
{
FREE( cf1->GlyphArray );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_Coverage2( HB_CoverageFormat2* cf2,
- FT_Memory memory )
+static void Free_Coverage2( HB_CoverageFormat2* cf2 )
{
FREE( cf2->RangeRecord );
}
}
-void _HB_OPEN_Free_Coverage( HB_Coverage* c,
- FT_Memory memory )
+void _HB_OPEN_Free_Coverage( HB_Coverage* c )
{
switch ( c->CoverageFormat )
{
- case 1: Free_Coverage1( &c->cf.cf1, memory ); break;
- case 2: Free_Coverage2( &c->cf.cf2, memory ); break;
+ case 1: Free_Coverage1( &c->cf.cf1 ); break;
+ case 2: Free_Coverage2( &c->cf.cf2 ); break;
default: break;
}
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_ClassDef1( HB_ClassDefFormat1* cdf1,
- FT_Memory memory )
+static void Free_ClassDef1( HB_ClassDefFormat1* cdf1 )
{
FREE( cdf1->ClassValueArray );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-static void Free_ClassDef2( HB_ClassDefFormat2* cdf2,
- FT_Memory memory )
+static void Free_ClassDef2( HB_ClassDefFormat2* cdf2 )
{
FREE( cdf2->ClassRangeRecord );
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
-
if ( ALLOC_ARRAY( cd->Defined, limit, FT_Bool ) )
return error;
}
-HB_Error _HB_OPEN_Load_EmptyClassDefinition( HB_ClassDefinition* cd,
- FT_Stream stream )
+static HB_Error _HB_OPEN_Load_EmptyClassDefinition( HB_ClassDefinition* cd )
{
HB_Error error;
- FT_Memory memory = stream->memory;
-
if ( ALLOC_ARRAY( cd->Defined, 1, FT_Bool ) )
return error;
return error;
}
-void _HB_OPEN_Free_ClassDefinition( HB_ClassDefinition* cd,
- FT_Memory memory )
+HB_Error _HB_OPEN_Load_EmptyOrClassDefinition( HB_ClassDefinition* cd,
+ FT_UShort limit,
+ FT_ULong class_offset,
+ FT_ULong base_offset,
+ FT_Stream stream )
+{
+ HB_Error error;
+ FT_ULong cur_offset;
+
+ cur_offset = FILE_Pos();
+
+ if ( class_offset )
+ {
+ if ( !FILE_Seek( class_offset + base_offset ) )
+ error = _HB_OPEN_Load_ClassDefinition( cd, limit, stream );
+ }
+ else
+ error = _HB_OPEN_Load_EmptyClassDefinition ( cd );
+
+ if (error == HB_Err_Ok)
+ (void)FILE_Seek( cur_offset ); /* Changes error as a side-effect */
+
+ return error;
+}
+
+void _HB_OPEN_Free_ClassDefinition( HB_ClassDefinition* cd )
{
if ( !cd->loaded )
return;
switch ( cd->ClassFormat )
{
- case 1: Free_ClassDef1( &cd->cd.cd1, memory ); break;
- case 2: Free_ClassDef2( &cd->cd.cd2, memory ); break;
- default: break;
+ case 1: Free_ClassDef1( &cd->cd.cd1 ); break;
+ case 2: Free_ClassDef2( &cd->cd.cd2 ); break;
+ default: break;
}
}
FT_Stream stream )
{
HB_Error error;
- FT_Memory memory = stream->memory;
FT_UShort n, count;
}
-void _HB_OPEN_Free_Device( HB_Device* d,
- FT_Memory memory )
+void _HB_OPEN_Free_Device( HB_Device* d )
{
FREE( d->DeltaValue );
}