* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,

ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
* src/base/ftcalc.c (FT_MulFix): Ditto.
* src/cff/cffdrivr.c (cff_get_name_index): Ditto.
* src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
CFF_GlyphSlot_Init): Ditto.
* src/cid/cidobjs.c (CID_GlyphSlot_Init,
CID_Size_Get_Globals_Funcs): Ditto.
* src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
Ditto.
* src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
* src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
variables.

* include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
to...
(T1_Builder_FuncsRec): This.
(T1_Builder_Funcs): New typedef.
(PSAux_Interface): Remove compiler warnings.
* src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
(t1_builder_funcs): Updated.

* src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
(PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
(PSH_AlignmentRec): Updated.

* include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
typo.
* include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
* src/base/ftstream (FT_Get_Char): Rename to...
(FT_Stream_Get_Char): This.

* src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
a built-in function in gcc, causing warning messages with gcc 3.0.
* src/autohint/ahglyph.c (ah_outline_load): Ditto.
* src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
* src/cache/ftcmanag.c (ftc_family_table_alloc,
ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
Ditto.
* src/cff/cffload.c (cff_new_index, cff_done_index,
cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
CFF_Done_Font): Ditto.
* src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
* src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
* src/pshinter/pshalgo1.c (psh1_hint_table_record,
psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
* src/pshinter/pshalgo2.c (psh2_hint_table_record,
psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
* src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
TT_Get_PS_Name): Ditto.
* src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
load_truetype_glyph): Ditto.
* src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
* src/type1/t1afm.c (T1_Get_Kerning): Ditto.
* include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
This commit is contained in:
Werner Lemberg 2002-03-07 21:59:59 +00:00
parent 83b4a4b515
commit 0d9165e1d6
33 changed files with 404 additions and 346 deletions

View File

@ -1,3 +1,66 @@
2002-03-07 Werner Lemberg <wl@gnu.org>
* src/base/ftdbgmem.c (ft_mem_table_resize, ft_mem_table_new,
ft_mem_table_set, ft_mem_debug_alloc, ft_mem_debug_free,
ft_mem_debug_realloc, ft_mem_debug_done, FT_Alloc_Debug,
FT_Realloc_Debug, FT_Free_Debug): Fix compiler warnings.
* src/base/ftcalc.c (FT_MulFix): Ditto.
* src/cff/cffdrivr.c (cff_get_name_index): Ditto.
* src/cff/cffobjs.c (CFF_Size_Get_Global_Funcs, CFF_Size_Init,
CFF_GlyphSlot_Init): Ditto.
* src/cid/cidobjs.c (CID_GlyphSlot_Init,
CID_Size_Get_Globals_Funcs): Ditto.
* src/type1/t1objs.c (T1_Size_Get_Globals_Funcs, T1_GlyphSlot_Init):
Ditto.
* src/pshinter/pshmod.c (pshinter_interface): Use `static const'.
* src/winfonts/winfnt.c (FNT_Get_Next_Char): Remove unused
variables.
* include/freetype/internal/psaux.h (T1_Builder_Funcs): Renamed
to...
(T1_Builder_FuncsRec): This.
(T1_Builder_Funcs): New typedef.
(PSAux_Interface): Remove compiler warnings.
* src/psaux/psauxmod.c (t1_builder_funcs), src/psaux/psobjs.h
(t1_builder_funcs): Updated.
* src/pshinter/pshglob.h (PSH_Blue_Align): Replaced with ...
(PSH_BLUE_ALIGN_{NONE,TOP,BOT}): New defines.
(PSH_AlignmentRec): Updated.
* include/freetype/internal/ftstream.h (GET_Char, GET_Byte): Fix
typo.
* include/freetype/internal/ftgloadr.h (FT_SubGlyph): Ditto.
* src/base/ftstream (FT_Get_Char): Rename to...
(FT_Stream_Get_Char): This.
* src/base/ftnames.c (FT_Get_Sfnt_Name): s/index/idx/ -- `index' is
a built-in function in gcc, causing warning messages with gcc 3.0.
* src/autohint/ahglyph.c (ah_outline_load): Ditto.
* src/autohint/ahglobal.c (ah_hinter_compute_blues): Ditto.
* src/cache/ftcmanag.c (ftc_family_table_alloc,
ftc_family_table_free, FTC_Manager_Done, FTC_Manager_Register_Cache):
Ditto.
* src/cff/cffload.c (cff_new_index, cff_done_index,
cff_explicit_index, CFF_Access_Element, CFF_Forget_Element,
CFF_Get_Name, CFF_Get_String, CFF_Load_SubFont, CFF_Load_Font,
CFF_Done_Font): Ditto.
* src/psaux/psobjs.c (PS_Table_Add, PS_Parser_LoadField): Ditto.
* src/psaux/t1decode.c (T1_Decoder_Parse_Charstrings): Ditto.
* src/pshinter/pshrec.c (ps_mask_test_bit, ps_mask_clear_bit,
ps_mask_set_bit, ps_dimension_add_t1stem, ps_hints_t1stem3,
* src/pshinter/pshalgo1.c (psh1_hint_table_record,
psh1_hint_table_record_mask, psh1_hint_table_activate_mask): Ditto.
* src/pshinter/pshalgo2.c (psh2_hint_table_record,
psh2_hint_table_record_mask, psh2_hint_table_activate_mask): Ditto.
* src/sfnt/ttpost.c (Load_Format_20, Load_Format_25,
TT_Get_PS_Name): Ditto.
* src/truetype/ttgload.c (TT_Get_Metrics, Get_HMetrics,
load_truetype_glyph): Ditto.
* src/type1/t1load.c (parse_subrs, T1_Open_Face): Ditto.
* src/type1/t1afm.c (T1_Get_Kerning): Ditto.
* include/freetype/cache/ftcmanag.h (ftc_family_table_free): Ditto.
2002-03-06 David Turner <david@freetype.org> 2002-03-06 David Turner <david@freetype.org>
* src/type1/t1objs.c (T1_Face_Init), src/cid/cidobjs.c (CID_Face_Init): * src/type1/t1objs.c (T1_Face_Init), src/cid/cidobjs.c (CID_Face_Init):
@ -11,7 +74,6 @@
src/base/ftobjs.c, src/base/ftinit.c: adding the new FT_Library_Version src/base/ftobjs.c, src/base/ftinit.c: adding the new FT_Library_Version
API to return the library's current version in dynamic links. API to return the library's current version in dynamic links.
2002-03-06 Werner Lemberg <wl@gnu.org> 2002-03-06 Werner Lemberg <wl@gnu.org>
* src/pshinter/pshglob.h (PSH_DimensionRec): s/std/stdw/. * src/pshinter/pshglob.h (PSH_DimensionRec): s/std/stdw/.

View File

@ -118,7 +118,7 @@ FT_BEGIN_HEADER
FT_EXPORT( void ) FT_EXPORT( void )
ftc_family_table_free( FTC_FamilyTable table, ftc_family_table_free( FTC_FamilyTable table,
FT_UInt index ); FT_UInt idx );
/*************************************************************************/ /*************************************************************************/

View File

@ -50,7 +50,7 @@ FT_BEGIN_HEADER
}; };
typedef struct FT_SubGlyph_ struct FT_SubGlyph_
{ {
FT_Int index; FT_Int index;
FT_UShort flags; FT_UShort flags;

View File

@ -265,8 +265,8 @@ FT_BEGIN_HEADER
/* */ /* */
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) ) #define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
#define GET_Char() FT_GET_MACRO( FT_Get_Char, FT_Char ) #define GET_Char() FT_GET_MACRO( FT_Stream_Get_Char, FT_Char )
#define GET_Byte() FT_GET_MACRO( FT_Get_Char, FT_Byte ) #define GET_Byte() FT_GET_MACRO( FT_Stream_Get_Char, FT_Byte )
#define GET_Short() FT_GET_MACRO( FT_Stream_Get_Short, FT_Short ) #define GET_Short() FT_GET_MACRO( FT_Stream_Get_Short, FT_Short )
#define GET_UShort() FT_GET_MACRO( FT_Stream_Get_Short, FT_UShort ) #define GET_UShort() FT_GET_MACRO( FT_Stream_Get_Short, FT_UShort )
#define GET_Offset() FT_GET_MACRO( FT_Stream_Get_Offset, FT_Long ) #define GET_Offset() FT_GET_MACRO( FT_Stream_Get_Offset, FT_Long )

View File

@ -38,9 +38,8 @@ FT_BEGIN_HEADER
/*************************************************************************/ /*************************************************************************/
typedef struct PS_TableRec_* PS_Table; typedef struct PS_TableRec_* PS_Table;
typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
typedef const struct PS_Table_FuncsRec_* PS_Table_Funcs;
/*************************************************************************/ /*************************************************************************/
/* */ /* */
@ -433,7 +432,9 @@ FT_BEGIN_HEADER
(*T1_Builder_Close_Contour_Func)( T1_Builder* builder ); (*T1_Builder_Close_Contour_Func)( T1_Builder* builder );
typedef struct T1_Builder_Funcs_ typedef const struct T1_Builder_FuncsRec_* T1_Builder_Funcs;
typedef struct T1_Builder_FuncsRec_
{ {
void void
(*init)( T1_Builder* builder, (*init)( T1_Builder* builder,
@ -452,8 +453,7 @@ FT_BEGIN_HEADER
T1_Builder_Start_Point_Func start_point; T1_Builder_Start_Point_Func start_point;
T1_Builder_Close_Contour_Func close_contour; T1_Builder_Close_Contour_Func close_contour;
} T1_Builder_Funcs; } T1_Builder_FuncsRec;
/*************************************************************************/ /*************************************************************************/
@ -514,37 +514,37 @@ FT_BEGIN_HEADER
/* */ /* */
struct T1_Builder_ struct T1_Builder_
{ {
FT_Memory memory; FT_Memory memory;
FT_Face face; FT_Face face;
FT_GlyphSlot glyph; FT_GlyphSlot glyph;
FT_GlyphLoader loader; FT_GlyphLoader loader;
FT_Outline* base; FT_Outline* base;
FT_Outline* current; FT_Outline* current;
FT_Vector last; FT_Vector last;
FT_Fixed scale_x; FT_Fixed scale_x;
FT_Fixed scale_y; FT_Fixed scale_y;
FT_Pos pos_x; FT_Pos pos_x;
FT_Pos pos_y; FT_Pos pos_y;
FT_Vector left_bearing; FT_Vector left_bearing;
FT_Vector advance; FT_Vector advance;
FT_BBox bbox; /* bounding box */ FT_BBox bbox; /* bounding box */
FT_Bool path_begun; FT_Bool path_begun;
FT_Bool load_points; FT_Bool load_points;
FT_Bool no_recurse; FT_Bool no_recurse;
FT_Bool shift; FT_Bool shift;
FT_Error error; /* only used for memory errors */ FT_Error error; /* only used for memory errors */
FT_Bool metrics_only; FT_Bool metrics_only;
void* hints_funcs; /* hinter-specific */ void* hints_funcs; /* hinter-specific */
void* hints_globals; /* hinter-specific */ void* hints_globals; /* hinter-specific */
T1_Builder_Funcs funcs; T1_Builder_FuncsRec funcs;
}; };
@ -661,10 +661,10 @@ FT_BEGIN_HEADER
typedef struct PSAux_Interface_ typedef struct PSAux_Interface_
{ {
const PS_Table_Funcs ps_table_funcs; const PS_Table_FuncsRec* ps_table_funcs;
const PS_Parser_Funcs ps_parser_funcs; const PS_Parser_FuncsRec* ps_parser_funcs;
const T1_Builder_Funcs* t1_builder_funcs; const T1_Builder_FuncsRec* t1_builder_funcs;
const T1_Decoder_Funcs t1_decoder_funcs; const T1_Decoder_FuncsRec* t1_decoder_funcs;
void void
(*t1_decrypt)( FT_Byte* buffer, (*t1_decrypt)( FT_Byte* buffer,

View File

@ -158,7 +158,7 @@
/* segment; we first need to find in which contour the extremum */ /* segment; we first need to find in which contour the extremum */
/* lies, then see its previous and next points */ /* lies, then see its previous and next points */
{ {
FT_Int index = (FT_Int)( extremum - points ); FT_Int idx = (FT_Int)( extremum - points );
FT_Int n; FT_Int n;
FT_Int first, last, prev, next, end; FT_Int first, last, prev, next, end;
FT_Pos dist; FT_Pos dist;
@ -170,7 +170,7 @@
for ( n = 0; n < glyph->outline.n_contours; n++ ) for ( n = 0; n < glyph->outline.n_contours; n++ )
{ {
end = glyph->outline.contours[n]; end = glyph->outline.contours[n];
if ( end >= index ) if ( end >= idx )
{ {
last = end; last = end;
break; break;
@ -185,7 +185,7 @@
/* now look for the previous and next points that are not on the */ /* now look for the previous and next points that are not on the */
/* same Y coordinate. Threshold the `closeness'... */ /* same Y coordinate. Threshold the `closeness'... */
prev = index; prev = idx;
next = prev; next = prev;
do do
@ -199,7 +199,7 @@
if ( dist < -5 || dist > 5 ) if ( dist < -5 || dist > 5 )
break; break;
} while ( prev != index ); } while ( prev != idx );
do do
{ {
@ -212,7 +212,7 @@
if ( dist < -5 || dist > 5 ) if ( dist < -5 || dist > 5 )
break; break;
} while ( next != index ); } while ( next != idx );
/* now, set the `round' flag depending on the segment's kind */ /* now, set the `round' flag depending on the segment's kind */
round = FT_BOOL( round = FT_BOOL(

View File

@ -552,13 +552,13 @@
AH_Point** contour = outline->contours; AH_Point** contour = outline->contours;
AH_Point** contour_limit = contour + outline->num_contours; AH_Point** contour_limit = contour + outline->num_contours;
short* end = source->contours; short* end = source->contours;
short index = 0; short idx = 0;
for ( ; contour < contour_limit; contour++, end++ ) for ( ; contour < contour_limit; contour++, end++ )
{ {
contour[0] = points + index; contour[0] = points + idx;
index = (short)( end[0] + 1 ); idx = (short)( end[0] + 1 );
} }
} }

View File

@ -427,7 +427,7 @@
( ( al * ( ub & 0xFFFF ) + 0x8000 ) >> 16 ); ( ( al * ( ub & 0xFFFF ) + 0x8000 ) >> 16 );
} }
return ( s < 0 ? -(FT_Long)ua : ua ); return ( s < 0 ? -(FT_Long)ua : (FT_Long)ua );
} }

View File

@ -199,7 +199,8 @@
FT_ULong i; FT_ULong i;
new_buckets = ft_mem_table_alloc( table, new_buckets = (FT_MemNode *)
ft_mem_table_alloc( table,
new_size * sizeof ( FT_MemNode ) ); new_size * sizeof ( FT_MemNode ) );
if ( new_buckets == NULL ) if ( new_buckets == NULL )
return; return;
@ -241,7 +242,7 @@
FT_MemTable table; FT_MemTable table;
table = memory->alloc( memory, sizeof ( *table ) ); table = (FT_MemTable)memory->alloc( memory, sizeof ( *table ) );
if ( table == NULL ) if ( table == NULL )
goto Exit; goto Exit;
@ -258,7 +259,8 @@
table->realloc = memory->realloc; table->realloc = memory->realloc;
table->free = memory->free; table->free = memory->free;
table->buckets = memory->alloc( memory, table->buckets = (FT_MemNode *)
memory->alloc( memory,
table->size * sizeof ( FT_MemNode ) ); table->size * sizeof ( FT_MemNode ) );
if ( table->buckets ) if ( table->buckets )
MEM_Set( table->buckets, 0, sizeof ( FT_MemNode ) * table->size ); MEM_Set( table->buckets, 0, sizeof ( FT_MemNode ) * table->size );
@ -395,7 +397,7 @@
} }
/* we need to create a new node in this table */ /* we need to create a new node in this table */
node = ft_mem_table_alloc( table, sizeof ( *node ) ); node = (FT_MemNode)ft_mem_table_alloc( table, sizeof ( *node ) );
if ( node == NULL ) if ( node == NULL )
ft_mem_debug_panic( "not enough memory to run memory tests" ); ft_mem_debug_panic( "not enough memory to run memory tests" );
@ -469,14 +471,14 @@
ft_mem_debug_alloc( FT_Memory memory, ft_mem_debug_alloc( FT_Memory memory,
FT_Long size ) FT_Long size )
{ {
FT_MemTable table = memory->user; FT_MemTable table = (FT_MemTable)memory->user;
FT_Byte* block; FT_Byte* block;
if ( size <= 0 ) if ( size <= 0 )
ft_mem_debug_panic( "negative block size allocation (%ld)", size ); ft_mem_debug_panic( "negative block size allocation (%ld)", size );
block = ft_mem_table_alloc( table, size ); block = (FT_Byte *)ft_mem_table_alloc( table, size );
if ( block ) if ( block )
ft_mem_table_set( table, block, (FT_ULong)size ); ft_mem_table_set( table, block, (FT_ULong)size );
@ -491,7 +493,7 @@
ft_mem_debug_free( FT_Memory memory, ft_mem_debug_free( FT_Memory memory,
FT_Pointer block ) FT_Pointer block )
{ {
FT_MemTable table = memory->user; FT_MemTable table = (FT_MemTable)memory->user;
if ( block == NULL ) if ( block == NULL )
@ -513,7 +515,7 @@
FT_Long new_size, FT_Long new_size,
FT_Pointer block ) FT_Pointer block )
{ {
FT_MemTable table = memory->user; FT_MemTable table = (FT_MemTable)memory->user;
FT_MemNode node, *pnode; FT_MemNode node, *pnode;
FT_Pointer new_block; FT_Pointer new_block;
@ -589,7 +591,7 @@
extern void extern void
ft_mem_debug_done( FT_Memory memory ) ft_mem_debug_done( FT_Memory memory )
{ {
FT_MemTable table = memory->user; FT_MemTable table = (FT_MemTable)memory->user;
if ( table ) if ( table )
@ -611,7 +613,7 @@
const char* file_name, const char* file_name,
FT_Long line_no ) FT_Long line_no )
{ {
FT_MemTable table = memory->user; FT_MemTable table = (FT_MemTable)memory->user;
if ( table ) if ( table )
@ -631,7 +633,7 @@
const char* file_name, const char* file_name,
FT_Long line_no ) FT_Long line_no )
{ {
FT_MemTable table = memory->user; FT_MemTable table = (FT_MemTable)memory->user;
if ( table ) if ( table )
@ -649,7 +651,7 @@
const char* file_name, const char* file_name,
FT_Long line_no ) FT_Long line_no )
{ {
FT_MemTable table = memory->user; FT_MemTable table = (FT_MemTable)memory->user;
if ( table ) if ( table )
@ -657,7 +659,7 @@
table->file_name = file_name; table->file_name = file_name;
table->line_no = line_no; table->line_no = line_no;
} }
FT_Free( memory, block ); FT_Free( memory, (void **)block );
} }

View File

@ -40,7 +40,7 @@
FT_EXPORT_DEF( FT_Error ) FT_EXPORT_DEF( FT_Error )
FT_Get_Sfnt_Name( FT_Face face, FT_Get_Sfnt_Name( FT_Face face,
FT_UInt index, FT_UInt idx,
FT_SfntName *aname ) FT_SfntName *aname )
{ {
FT_Error error = FT_Err_Invalid_Argument; FT_Error error = FT_Err_Invalid_Argument;
@ -51,9 +51,9 @@
TT_Face ttface = (TT_Face)face; TT_Face ttface = (TT_Face)face;
if ( index < (FT_UInt)ttface->num_names ) if ( idx < (FT_UInt)ttface->num_names )
{ {
TT_NameRec* name = ttface->name_table.names + index; TT_NameRec* name = ttface->name_table.names + idx;
aname->platform_id = name->platformID; aname->platform_id = name->platformID;

View File

@ -289,7 +289,7 @@
FT_BASE_DEF( FT_Char ) FT_BASE_DEF( FT_Char )
FT_Get_Char( FT_Stream stream ) FT_Stream_Get_Char( FT_Stream stream )
{ {
FT_Char result; FT_Char result;

16
src/cache/ftccmap.c vendored
View File

@ -177,27 +177,27 @@
if ( !error ) if ( !error )
{ {
FT_UInt count = face->num_charmaps; FT_UInt count = face->num_charmaps;
FT_UInt index = count; FT_UInt idx = count;
FT_CharMap* cur = face->charmaps; FT_CharMap* cur = face->charmaps;
switch ( desc->type ) switch ( desc->type )
{ {
case FTC_CMAP_BY_INDEX: case FTC_CMAP_BY_INDEX:
index = desc->u.index; idx = desc->u.index;
hash = index * 33; hash = idx * 33;
break; break;
case FTC_CMAP_BY_ENCODING: case FTC_CMAP_BY_ENCODING:
for ( index = 0; index < count; index++, cur++ ) for ( idx = 0; idx < count; idx++, cur++ )
if ( cur[0]->encoding == desc->u.encoding ) if ( cur[0]->encoding == desc->u.encoding )
break; break;
hash = index * 67; hash = idx * 67;
break; break;
case FTC_CMAP_BY_ID: case FTC_CMAP_BY_ID:
for ( index = 0; index < count; index++, cur++ ) for ( idx = 0; idx < count; idx++, cur++ )
{ {
if ( (FT_UInt)cur[0]->platform_id == desc->u.id.platform && if ( (FT_UInt)cur[0]->platform_id == desc->u.id.platform &&
(FT_UInt)cur[0]->encoding_id == desc->u.id.encoding ) (FT_UInt)cur[0]->encoding_id == desc->u.id.encoding )
@ -212,11 +212,11 @@
; ;
} }
if ( index >= count ) if ( idx >= count )
goto Bad_Descriptor; goto Bad_Descriptor;
/* compute hash value, both in family and query */ /* compute hash value, both in family and query */
cfam->index = index; cfam->index = idx;
cfam->hash = hash ^ FTC_FACE_ID_HASH( desc->face_id ); cfam->hash = hash ^ FTC_FACE_ID_HASH( desc->face_id );
FTC_QUERY( cquery )->hash = FTC_CMAP_HASH( cfam, cquery ); FTC_QUERY( cquery )->hash = FTC_CMAP_HASH( cfam, cquery );

36
src/cache/ftcmanag.c vendored
View File

@ -356,7 +356,7 @@
if ( table->free == FTC_FAMILY_ENTRY_NONE && table->count >= table->size ) if ( table->free == FTC_FAMILY_ENTRY_NONE && table->count >= table->size )
{ {
FT_UInt old_size = table->size; FT_UInt old_size = table->size;
FT_UInt new_size, index; FT_UInt new_size, idx;
if ( old_size == 0 ) if ( old_size == 0 )
@ -379,14 +379,14 @@
entry = table->entries + old_size; entry = table->entries + old_size;
table->free = old_size; table->free = old_size;
for ( index = old_size; index + 1 < new_size; index++, entry++ ) for ( idx = old_size; idx + 1 < new_size; idx++, entry++ )
{ {
entry->link = index + 1; entry->link = idx + 1;
entry->index = index; entry->index = idx;
} }
entry->link = FTC_FAMILY_ENTRY_NONE; entry->link = FTC_FAMILY_ENTRY_NONE;
entry->index = index; entry->index = idx;
} }
if ( table->free != FTC_FAMILY_ENTRY_NONE ) if ( table->free != FTC_FAMILY_ENTRY_NONE )
@ -414,12 +414,12 @@
FT_EXPORT_DEF( void ) FT_EXPORT_DEF( void )
ftc_family_table_free( FTC_FamilyTable table, ftc_family_table_free( FTC_FamilyTable table,
FT_UInt index ) FT_UInt idx )
{ {
/* simply add it to the linked list of free entries */ /* simply add it to the linked list of free entries */
if ( index < table->count ) if ( idx < table->count )
{ {
FTC_FamilyEntry entry = table->entries + index; FTC_FamilyEntry entry = table->entries + idx;
if ( entry->link != FTC_FAMILY_ENTRY_NONE ) if ( entry->link != FTC_FAMILY_ENTRY_NONE )
@ -521,7 +521,7 @@
FTC_Manager_Done( FTC_Manager manager ) FTC_Manager_Done( FTC_Manager manager )
{ {
FT_Memory memory; FT_Memory memory;
FT_UInt index; FT_UInt idx;
if ( !manager || !manager->library ) if ( !manager || !manager->library )
@ -530,16 +530,16 @@
memory = manager->library->memory; memory = manager->library->memory;
/* now discard all caches */ /* now discard all caches */
for (index = 0; index < FTC_MAX_CACHES; index++ ) for (idx = 0; idx < FTC_MAX_CACHES; idx++ )
{ {
FTC_Cache cache = manager->caches[index]; FTC_Cache cache = manager->caches[idx];
if ( cache ) if ( cache )
{ {
cache->clazz->cache_done( cache ); cache->clazz->cache_done( cache );
FREE( cache ); FREE( cache );
manager->caches[index] = 0; manager->caches[idx] = 0;
} }
} }
@ -697,18 +697,18 @@
if ( manager && clazz && acache ) if ( manager && clazz && acache )
{ {
FT_Memory memory = manager->library->memory; FT_Memory memory = manager->library->memory;
FT_UInt index = 0; FT_UInt idx = 0;
/* check for an empty cache slot in the manager's table */ /* check for an empty cache slot in the manager's table */
for ( index = 0; index < FTC_MAX_CACHES; index++ ) for ( idx = 0; idx < FTC_MAX_CACHES; idx++ )
{ {
if ( manager->caches[index] == 0 ) if ( manager->caches[idx] == 0 )
break; break;
} }
/* return an error if there are too many registered caches */ /* return an error if there are too many registered caches */
if ( index >= FTC_MAX_CACHES ) if ( idx >= FTC_MAX_CACHES )
{ {
error = FTC_Err_Too_Many_Caches; error = FTC_Err_Too_Many_Caches;
FT_ERROR(( "FTC_Manager_Register_Cache:" )); FT_ERROR(( "FTC_Manager_Register_Cache:" ));
@ -724,7 +724,7 @@
/* THIS IS VERY IMPORTANT! IT WILL WRETCH THE MANAGER */ /* THIS IS VERY IMPORTANT! IT WILL WRETCH THE MANAGER */
/* IF IT IS NOT SET CORRECTLY */ /* IF IT IS NOT SET CORRECTLY */
cache->cache_index = index; cache->cache_index = idx;
if ( clazz->cache_init ) if ( clazz->cache_init )
{ {
@ -739,7 +739,7 @@
} }
} }
manager->caches[index] = cache; manager->caches[idx] = cache;
} }
} }

View File

@ -393,7 +393,7 @@
FT_Int result; FT_Int result;
cff = face->extra.data; cff = (CFF_Font *)face->extra.data;
charset = &cff->charset; charset = &cff->charset;
psnames = (PSNames_Service)FT_Get_Module_Interface( psnames = (PSNames_Service)FT_Get_Module_Interface(

View File

@ -1793,16 +1793,16 @@
case cff_op_index: case cff_op_index:
{ {
FT_Int index = args[0] >> 16; FT_Int idx = args[0] >> 16;
FT_TRACE4(( " index" )); FT_TRACE4(( " index" ));
if ( index < 0 ) if ( idx < 0 )
index = 0; idx = 0;
else if ( index > num_args - 2 ) else if ( idx > num_args - 2 )
index = num_args - 2; idx = num_args - 2;
args[0] = args[-( index + 1 )]; args[0] = args[-( idx + 1 )];
args++; args++;
} }
break; break;
@ -1810,7 +1810,7 @@
case cff_op_roll: case cff_op_roll:
{ {
FT_Int count = (FT_Int)( args[0] >> 16 ); FT_Int count = (FT_Int)( args[0] >> 16 );
FT_Int index = (FT_Int)( args[1] >> 16 ); FT_Int idx = (FT_Int)( args[1] >> 16 );
FT_TRACE4(( " roll" )); FT_TRACE4(( " roll" ));
@ -1822,9 +1822,9 @@
if ( args < stack ) if ( args < stack )
goto Stack_Underflow; goto Stack_Underflow;
if ( index >= 0 ) if ( idx >= 0 )
{ {
while ( index > 0 ) while ( idx > 0 )
{ {
FT_Fixed tmp = args[count - 1]; FT_Fixed tmp = args[count - 1];
FT_Int i; FT_Int i;
@ -1833,12 +1833,12 @@
for ( i = count - 2; i >= 0; i-- ) for ( i = count - 2; i >= 0; i-- )
args[i + 1] = args[i]; args[i + 1] = args[i];
args[0] = tmp; args[0] = tmp;
index--; idx--;
} }
} }
else else
{ {
while ( index < 0 ) while ( idx < 0 )
{ {
FT_Fixed tmp = args[0]; FT_Fixed tmp = args[0];
FT_Int i; FT_Int i;
@ -1847,7 +1847,7 @@
for ( i = 0; i < count - 1; i++ ) for ( i = 0; i < count - 1; i++ )
args[i] = args[i + 1]; args[i] = args[i + 1];
args[count - 1] = tmp; args[count - 1] = tmp;
index++; idx++;
} }
} }
args += count; args += count;
@ -1863,27 +1863,27 @@
case cff_op_put: case cff_op_put:
{ {
FT_Fixed val = args[0]; FT_Fixed val = args[0];
FT_Int index = (FT_Int)( args[1] >> 16 ); FT_Int idx = (FT_Int)( args[1] >> 16 );
FT_TRACE4(( " put" )); FT_TRACE4(( " put" ));
if ( index >= 0 && index < decoder->len_buildchar ) if ( idx >= 0 && idx < decoder->len_buildchar )
decoder->buildchar[index] = val; decoder->buildchar[idx] = val;
} }
break; break;
case cff_op_get: case cff_op_get:
{ {
FT_Int index = (FT_Int)( args[0] >> 16 ); FT_Int idx = (FT_Int)( args[0] >> 16 );
FT_Fixed val = 0; FT_Fixed val = 0;
FT_TRACE4(( " get" )); FT_TRACE4(( " get" ));
if ( index >= 0 && index < decoder->len_buildchar ) if ( idx >= 0 && idx < decoder->len_buildchar )
val = decoder->buildchar[index]; val = decoder->buildchar[idx];
args[0] = val; args[0] = val;
args++; args++;
@ -1956,13 +1956,13 @@
case cff_op_callsubr: case cff_op_callsubr:
{ {
FT_UInt index = (FT_UInt)( ( args[0] >> 16 ) + FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
decoder->locals_bias ); decoder->locals_bias );
FT_TRACE4(( " callsubr(%d)", index )); FT_TRACE4(( " callsubr(%d)", idx ));
if ( index >= decoder->num_locals ) if ( idx >= decoder->num_locals )
{ {
FT_ERROR(( "CFF_Parse_CharStrings:" )); FT_ERROR(( "CFF_Parse_CharStrings:" ));
FT_ERROR(( " invalid local subr index\n" )); FT_ERROR(( " invalid local subr index\n" ));
@ -1978,8 +1978,8 @@
zone->cursor = ip; /* save current instruction pointer */ zone->cursor = ip; /* save current instruction pointer */
zone++; zone++;
zone->base = decoder->locals[index]; zone->base = decoder->locals[idx];
zone->limit = decoder->locals[index + 1]; zone->limit = decoder->locals[idx + 1];
zone->cursor = zone->base; zone->cursor = zone->base;
if ( !zone->base ) if ( !zone->base )
@ -1996,13 +1996,13 @@
case cff_op_callgsubr: case cff_op_callgsubr:
{ {
FT_UInt index = (FT_UInt)( ( args[0] >> 16 ) + FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
decoder->globals_bias ); decoder->globals_bias );
FT_TRACE4(( " callgsubr(%d)", index )); FT_TRACE4(( " callgsubr(%d)", idx ));
if ( index >= decoder->num_globals ) if ( idx >= decoder->num_globals )
{ {
FT_ERROR(( "CFF_Parse_CharStrings:" )); FT_ERROR(( "CFF_Parse_CharStrings:" ));
FT_ERROR(( " invalid global subr index\n" )); FT_ERROR(( " invalid global subr index\n" ));
@ -2018,8 +2018,8 @@
zone->cursor = ip; /* save current instruction pointer */ zone->cursor = ip; /* save current instruction pointer */
zone++; zone++;
zone->base = decoder->globals[index]; zone->base = decoder->globals[idx];
zone->limit = decoder->globals[index+1]; zone->limit = decoder->globals[idx + 1];
zone->cursor = zone->base; zone->cursor = zone->base;
if ( !zone->base ) if ( !zone->base )

View File

@ -1082,18 +1082,18 @@
static FT_Error static FT_Error
cff_new_index( CFF_Index index, cff_new_index( CFF_Index idx,
FT_Stream stream, FT_Stream stream,
FT_Bool load ) FT_Bool load )
{ {
FT_Error error; FT_Error error;
FT_Memory memory = stream->memory; FT_Memory memory = stream->memory;
FT_UShort count; FT_UShort count;
MEM_Set( index, 0, sizeof ( *index ) ); MEM_Set( idx, 0, sizeof ( *idx ) );
index->stream = stream; idx->stream = stream;
if ( !READ_UShort( count ) && if ( !READ_UShort( count ) &&
count > 0 ) count > 0 )
{ {
@ -1108,16 +1108,16 @@
if ( READ_Byte( offsize ) ) if ( READ_Byte( offsize ) )
goto Exit; goto Exit;
index->stream = stream; idx->stream = stream;
index->count = count; idx->count = count;
index->off_size = offsize; idx->off_size = offsize;
data_size = (FT_ULong)( count + 1 ) * offsize; data_size = (FT_ULong)( count + 1 ) * offsize;
if ( ALLOC_ARRAY( index->offsets, count + 1, FT_ULong ) || if ( ALLOC_ARRAY( idx->offsets, count + 1, FT_ULong ) ||
ACCESS_Frame( data_size ) ) ACCESS_Frame( data_size ) )
goto Exit; goto Exit;
poff = index->offsets; poff = idx->offsets;
p = (FT_Byte*)stream->cursor; p = (FT_Byte*)stream->cursor;
for ( ; (FT_Short)count >= 0; count-- ) for ( ; (FT_Short)count >= 0; count-- )
@ -1129,13 +1129,13 @@
FORGET_Frame(); FORGET_Frame();
index->data_offset = FILE_Pos(); idx->data_offset = FILE_Pos();
data_size = poff[-1] - 1; data_size = poff[-1] - 1;
if ( load ) if ( load )
{ {
/* load the data */ /* load the data */
if ( EXTRACT_Frame( data_size, index->bytes ) ) if ( EXTRACT_Frame( data_size, idx->bytes ) )
goto Exit; goto Exit;
} }
else else
@ -1148,52 +1148,52 @@
Exit: Exit:
if ( error ) if ( error )
FREE( index->offsets ); FREE( idx->offsets );
return error; return error;
} }
static void static void
cff_done_index( CFF_Index index ) cff_done_index( CFF_Index idx )
{ {
if ( index->stream ) if ( idx->stream )
{ {
FT_Stream stream = index->stream; FT_Stream stream = idx->stream;
FT_Memory memory = stream->memory; FT_Memory memory = stream->memory;
if ( index->bytes ) if ( idx->bytes )
RELEASE_Frame( index->bytes ); RELEASE_Frame( idx->bytes );
FREE( index->offsets ); FREE( idx->offsets );
MEM_Set( index, 0, sizeof ( *index ) ); MEM_Set( idx, 0, sizeof ( *idx ) );
} }
} }
static FT_Error static FT_Error
cff_explicit_index( CFF_Index index, cff_explicit_index( CFF_Index idx,
FT_Byte*** table ) FT_Byte*** table )
{ {
FT_Error error = 0; FT_Error error = 0;
FT_Memory memory = index->stream->memory; FT_Memory memory = idx->stream->memory;
FT_UInt n, offset, old_offset; FT_UInt n, offset, old_offset;
FT_Byte** t; FT_Byte** t;
*table = 0; *table = 0;
if ( index->count > 0 && !ALLOC_ARRAY( t, index->count + 1, FT_Byte* ) ) if ( idx->count > 0 && !ALLOC_ARRAY( t, idx->count + 1, FT_Byte* ) )
{ {
old_offset = 1; old_offset = 1;
for ( n = 0; n <= index->count; n++ ) for ( n = 0; n <= idx->count; n++ )
{ {
offset = index->offsets[n]; offset = idx->offsets[n];
if ( !offset ) if ( !offset )
offset = old_offset; offset = old_offset;
t[n] = index->bytes + offset - 1; t[n] = idx->bytes + offset - 1;
old_offset = offset; old_offset = offset;
} }
@ -1205,29 +1205,29 @@
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
CFF_Access_Element( CFF_Index index, CFF_Access_Element( CFF_Index idx,
FT_UInt element, FT_UInt element,
FT_Byte** pbytes, FT_Byte** pbytes,
FT_ULong* pbyte_len ) FT_ULong* pbyte_len )
{ {
FT_Error error = 0; FT_Error error = 0;
if ( index && index->count > element ) if ( idx && idx->count > element )
{ {
/* compute start and end offsets */ /* compute start and end offsets */
FT_ULong off1, off2 = 0; FT_ULong off1, off2 = 0;
off1 = index->offsets[element]; off1 = idx->offsets[element];
if ( off1 ) if ( off1 )
{ {
do do
{ {
element++; element++;
off2 = index->offsets[element]; off2 = idx->offsets[element];
} while ( off2 == 0 && element < index->count ); } while ( off2 == 0 && element < idx->count );
if ( !off2 ) if ( !off2 )
off1 = 0; off1 = 0;
@ -1238,18 +1238,18 @@
{ {
*pbyte_len = off2 - off1; *pbyte_len = off2 - off1;
if ( index->bytes ) if ( idx->bytes )
{ {
/* this index was completely loaded in memory, that's easy */ /* this index was completely loaded in memory, that's easy */
*pbytes = index->bytes + off1 - 1; *pbytes = idx->bytes + off1 - 1;
} }
else else
{ {
/* this index is still on disk/file, access it through a frame */ /* this index is still on disk/file, access it through a frame */
FT_Stream stream = index->stream; FT_Stream stream = idx->stream;
if ( FILE_Seek( index->data_offset + off1 - 1 ) || if ( FILE_Seek( idx->data_offset + off1 - 1 ) ||
EXTRACT_Frame( off2 - off1, *pbytes ) ) EXTRACT_Frame( off2 - off1, *pbytes ) )
goto Exit; goto Exit;
} }
@ -1270,12 +1270,12 @@
FT_LOCAL_DEF( void ) FT_LOCAL_DEF( void )
CFF_Forget_Element( CFF_Index index, CFF_Forget_Element( CFF_Index idx,
FT_Byte** pbytes ) FT_Byte** pbytes )
{ {
if ( index->bytes == 0 ) if ( idx->bytes == 0 )
{ {
FT_Stream stream = index->stream; FT_Stream stream = idx->stream;
RELEASE_Frame( *pbytes ); RELEASE_Frame( *pbytes );
@ -1284,17 +1284,17 @@
FT_LOCAL_DEF( FT_String* ) FT_LOCAL_DEF( FT_String* )
CFF_Get_Name( CFF_Index index, CFF_Get_Name( CFF_Index idx,
FT_UInt element ) FT_UInt element )
{ {
FT_Memory memory = index->stream->memory; FT_Memory memory = idx->stream->memory;
FT_Byte* bytes; FT_Byte* bytes;
FT_ULong byte_len; FT_ULong byte_len;
FT_Error error; FT_Error error;
FT_String* name = 0; FT_String* name = 0;
error = CFF_Access_Element( index, element, &bytes, &byte_len ); error = CFF_Access_Element( idx, element, &bytes, &byte_len );
if ( error ) if ( error )
goto Exit; goto Exit;
@ -1303,7 +1303,7 @@
MEM_Copy( name, bytes, byte_len ); MEM_Copy( name, bytes, byte_len );
name[byte_len] = 0; name[byte_len] = 0;
} }
CFF_Forget_Element( index, &bytes ); CFF_Forget_Element( idx, &bytes );
Exit: Exit:
return name; return name;
@ -1311,13 +1311,13 @@
FT_LOCAL_DEF( FT_String* ) FT_LOCAL_DEF( FT_String* )
CFF_Get_String( CFF_Index index, CFF_Get_String( CFF_Index idx,
FT_UInt sid, FT_UInt sid,
PSNames_Service interface ) PSNames_Service interface )
{ {
/* if it is not a standard string, return it */ /* if it is not a standard string, return it */
if ( sid > 390 ) if ( sid > 390 )
return CFF_Get_Name( index, sid - 391 ); return CFF_Get_Name( idx, sid - 391 );
/* that's a standard string, fetch a copy from the PSName module */ /* that's a standard string, fetch a copy from the PSName module */
{ {
@ -1328,7 +1328,7 @@
if ( adobe_name ) if ( adobe_name )
{ {
FT_Memory memory = index->stream->memory; FT_Memory memory = idx->stream->memory;
FT_Error error; FT_Error error;
@ -1958,7 +1958,7 @@
static FT_Error static FT_Error
CFF_Load_SubFont( CFF_SubFont* font, CFF_Load_SubFont( CFF_SubFont* font,
CFF_Index index, CFF_Index idx,
FT_UInt font_index, FT_UInt font_index,
FT_Stream stream, FT_Stream stream,
FT_ULong base_offset ) FT_ULong base_offset )
@ -1983,10 +1983,10 @@
top->font_matrix.yy = 0x10000L; top->font_matrix.yy = 0x10000L;
top->cid_count = 8720; top->cid_count = 8720;
error = CFF_Access_Element( index, font_index, &dict, &dict_len ) || error = CFF_Access_Element( idx, font_index, &dict, &dict_len ) ||
CFF_Parser_Run( &parser, dict, dict + dict_len ); CFF_Parser_Run( &parser, dict, dict + dict_len );
CFF_Forget_Element( index, &dict ); CFF_Forget_Element( idx, &dict );
if ( error ) if ( error )
goto Exit; goto Exit;
@ -2034,7 +2034,7 @@
font->num_local_subrs = font->local_subrs_index.count; font->num_local_subrs = font->local_subrs_index.count;
error = cff_explicit_index( &font->local_subrs_index, error = cff_explicit_index( &font->local_subrs_index,
&font->local_subrs ); &font->local_subrs );
if ( error ) if ( error )
goto Exit; goto Exit;
} }
@ -2137,9 +2137,9 @@
/* now, check for a CID font */ /* now, check for a CID font */
if ( dict->cid_registry ) if ( dict->cid_registry )
{ {
CFF_IndexRec fd_index; CFF_IndexRec fd_index;
CFF_SubFont* sub; CFF_SubFont* sub;
FT_UInt index; FT_UInt idx;
/* this is a CID-keyed font, we must now allocate a table of */ /* this is a CID-keyed font, we must now allocate a table of */
@ -2163,14 +2163,14 @@
goto Fail_CID; goto Fail_CID;
/* setup pointer table */ /* setup pointer table */
for ( index = 0; index < fd_index.count; index++ ) for ( idx = 0; idx < fd_index.count; idx++ )
font->subfonts[index] = sub + index; font->subfonts[idx] = sub + idx;
/* now load each sub font independently */ /* now load each sub font independently */
for ( index = 0; index < fd_index.count; index++ ) for ( idx = 0; idx < fd_index.count; idx++ )
{ {
sub = font->subfonts[index]; sub = font->subfonts[idx];
error = CFF_Load_SubFont( sub, &fd_index, index, error = CFF_Load_SubFont( sub, &fd_index, idx,
stream, base_offset ); stream, base_offset );
if ( error ) if ( error )
goto Fail_CID; goto Fail_CID;
@ -2243,7 +2243,7 @@
CFF_Done_Font( CFF_Font* font ) CFF_Done_Font( CFF_Font* font )
{ {
FT_Memory memory = font->memory; FT_Memory memory = font->memory;
FT_UInt index; FT_UInt idx;
cff_done_index( &font->global_subrs_index ); cff_done_index( &font->global_subrs_index );
@ -2256,8 +2256,8 @@
/* a CID keyed CFF font */ /* a CID keyed CFF font */
if ( font->num_subfonts > 0 ) if ( font->num_subfonts > 0 )
{ {
for ( index = 0; index < font->num_subfonts; index++ ) for ( idx = 0; idx < font->num_subfonts; idx++ )
CFF_Done_SubFont( memory, font->subfonts[index] ); CFF_Done_SubFont( memory, font->subfonts[idx] );
FREE( font->subfonts ); FREE( font->subfonts );
} }

View File

@ -59,10 +59,10 @@
static PSH_Globals_Funcs static PSH_Globals_Funcs
CFF_Size_Get_Globals_Funcs( CFF_Size size ) CFF_Size_Get_Globals_Funcs( CFF_Size size )
{ {
CFF_Face face = (CFF_Face)size->face; CFF_Face face = (CFF_Face)size->face;
CFF_Font* font = face->extra.data; CFF_Font* font = (CFF_Font *)face->extra.data;
PSHinter_Service pshinter = font->pshinter; PSHinter_Service pshinter = (PSHinter_Service)font->pshinter;
FT_Module module; FT_Module module;
module = FT_Get_Module( size->face->driver->root.library, module = FT_Get_Module( size->face->driver->root.library,
@ -101,7 +101,7 @@
{ {
PSH_Globals globals; PSH_Globals globals;
CFF_Face face = (CFF_Face)size->face; CFF_Face face = (CFF_Face)size->face;
CFF_Font* font = face->extra.data; CFF_Font* font = (CFF_Font *)face->extra.data;
CFF_SubFont* subfont = &font->top_font; CFF_SubFont* subfont = &font->top_font;
CFF_Private cpriv = &subfont->private_dict; CFF_Private cpriv = &subfont->private_dict;
@ -195,9 +195,9 @@
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
CFF_GlyphSlot_Init( CFF_GlyphSlot slot ) CFF_GlyphSlot_Init( CFF_GlyphSlot slot )
{ {
CFF_Face face = (CFF_Face)slot->root.face; CFF_Face face = (CFF_Face)slot->root.face;
CFF_Font* font = face->extra.data; CFF_Font* font = (CFF_Font *)face->extra.data;
PSHinter_Service pshinter = font->pshinter; PSHinter_Service pshinter = (PSHinter_Service)font->pshinter;
if ( pshinter ) if ( pshinter )

View File

@ -52,14 +52,14 @@
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
CID_GlyphSlot_Init( CID_GlyphSlot slot ) CID_GlyphSlot_Init( CID_GlyphSlot slot )
{ {
CID_Face face; CID_Face face;
PSHinter_Service pshinter; PSHinter_Service pshinter;
face = (CID_Face) slot->root.face; face = (CID_Face)slot->root.face;
pshinter = face->pshinter; pshinter = (PSHinter_Service)face->pshinter;
if ( pshinter ) if ( pshinter )
{ {
@ -92,9 +92,9 @@
static PSH_Globals_Funcs static PSH_Globals_Funcs
CID_Size_Get_Globals_Funcs( CID_Size size ) CID_Size_Get_Globals_Funcs( CID_Size size )
{ {
CID_Face face = (CID_Face)size->root.face; CID_Face face = (CID_Face)size->root.face;
PSHinter_Service pshinter = face->pshinter; PSHinter_Service pshinter = (PSHinter_Service)face->pshinter;
FT_Module module; FT_Module module;
module = FT_Get_Module( size->root.face->driver->root.library, module = FT_Get_Module( size->root.face->driver->root.library,

View File

@ -51,7 +51,7 @@
FT_CALLBACK_TABLE_DEF FT_CALLBACK_TABLE_DEF
const T1_Builder_Funcs t1_builder_funcs = const T1_Builder_FuncsRec t1_builder_funcs =
{ {
T1_Builder_Init, T1_Builder_Init,
T1_Builder_Done, T1_Builder_Done,

View File

@ -151,11 +151,11 @@
/* */ /* */
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
PS_Table_Add( PS_Table table, PS_Table_Add( PS_Table table,
FT_Int index, FT_Int idx,
void* object, void* object,
FT_Int length ) FT_Int length )
{ {
if ( index < 0 || index > table->max_elems ) if ( idx < 0 || idx > table->max_elems )
{ {
FT_ERROR(( "PS_Table_Add: invalid index\n" )); FT_ERROR(( "PS_Table_Add: invalid index\n" ));
return PSaux_Err_Invalid_Argument; return PSaux_Err_Invalid_Argument;
@ -185,8 +185,8 @@
} }
/* add the object to the base block and adjust offset */ /* add the object to the base block and adjust offset */
table->elements[index] = table->block + table->cursor; table->elements[idx] = table->block + table->cursor;
table->lengths [index] = length; table->lengths [idx] = length;
MEM_Copy( table->block + table->cursor, object, length ); MEM_Copy( table->block + table->cursor, object, length );
table->cursor += length; table->cursor += length;
@ -794,7 +794,7 @@
FT_Byte* cur; FT_Byte* cur;
FT_Byte* limit; FT_Byte* limit;
FT_UInt count; FT_UInt count;
FT_UInt index; FT_UInt idx;
FT_Error error; FT_Error error;
@ -803,7 +803,7 @@
goto Fail; goto Fail;
count = 1; count = 1;
index = 0; idx = 0;
cur = token.start; cur = token.start;
limit = token.limit; limit = token.limit;
@ -814,12 +814,12 @@
goto Fail; goto Fail;
count = max_objects; count = max_objects;
index = 1; idx = 1;
} }
for ( ; count > 0; count--, index++ ) for ( ; count > 0; count--, idx++ )
{ {
FT_Byte* q = (FT_Byte*)objects[index] + field->offset; FT_Byte* q = (FT_Byte*)objects[idx] + field->offset;
FT_Long val; FT_Long val;
FT_String* string; FT_String* string;

View File

@ -37,13 +37,13 @@ FT_BEGIN_HEADER
FT_CALLBACK_TABLE FT_CALLBACK_TABLE
const PS_Table_FuncsRec ps_table_funcs; const PS_Table_FuncsRec ps_table_funcs;
FT_CALLBACK_TABLE FT_CALLBACK_TABLE
const PS_Parser_FuncsRec ps_parser_funcs; const PS_Parser_FuncsRec ps_parser_funcs;
FT_CALLBACK_TABLE FT_CALLBACK_TABLE
const T1_Builder_Funcs t1_builder_funcs; const T1_Builder_FuncsRec t1_builder_funcs;
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )

View File

@ -575,7 +575,8 @@
case 2: /* add flex vectors */ case 2: /* add flex vectors */
{ {
FT_Int index; FT_Int idx;
if ( top[0] != 0 ) if ( top[0] != 0 )
goto Unexpected_OtherSubr; goto Unexpected_OtherSubr;
@ -583,12 +584,12 @@
/* note that we should not add a point for index 0; */ /* note that we should not add a point for index 0; */
/* this will move our current position to the flex */ /* this will move our current position to the flex */
/* point without adding any point to the outline */ /* point without adding any point to the outline */
index = decoder->num_flex_vectors++; idx = decoder->num_flex_vectors++;
if ( index > 0 && index < 7 ) if ( idx > 0 && idx < 7 )
add_point( builder, add_point( builder,
x, x,
y, y,
(FT_Byte)( index == 3 || index == 6 ) ); (FT_Byte)( idx == 3 || idx == 6 ) );
} }
break; break;
@ -933,13 +934,13 @@
case op_callsubr: case op_callsubr:
{ {
FT_Int index; FT_Int idx;
FT_TRACE4(( " callsubr" )); FT_TRACE4(( " callsubr" ));
index = top[0]; idx = top[0];
if ( index < 0 || index >= (FT_Int)decoder->num_subrs ) if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
{ {
FT_ERROR(( "T1_Decoder_Parse_CharStrings: " FT_ERROR(( "T1_Decoder_Parse_CharStrings: "
"invalid subrs index\n" )); "invalid subrs index\n" ));
@ -960,16 +961,16 @@
/* The Type 1 driver stores subroutines without the seed bytes. */ /* The Type 1 driver stores subroutines without the seed bytes. */
/* The CID driver stores subroutines with seed bytes. This */ /* The CID driver stores subroutines with seed bytes. This */
/* case is taken care of when decoder->subrs_len == 0. */ /* case is taken care of when decoder->subrs_len == 0. */
zone->base = decoder->subrs[index]; zone->base = decoder->subrs[idx];
if ( decoder->subrs_len ) if ( decoder->subrs_len )
zone->limit = zone->base + decoder->subrs_len[index]; zone->limit = zone->base + decoder->subrs_len[idx];
else else
{ {
/* We are using subroutines from a CID font. We must adjust */ /* We are using subroutines from a CID font. We must adjust */
/* for the seed bytes. */ /* for the seed bytes. */
zone->base += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 ); zone->base += ( decoder->lenIV >= 0 ? decoder->lenIV : 0 );
zone->limit = decoder->subrs[index + 1]; zone->limit = decoder->subrs[idx + 1];
} }
zone->cursor = zone->base; zone->cursor = zone->base;

View File

@ -84,14 +84,14 @@
/* internal function used to record a new hint */ /* internal function used to record a new hint */
static void static void
psh1_hint_table_record( PSH1_Hint_Table table, psh1_hint_table_record( PSH1_Hint_Table table,
FT_UInt index ) FT_UInt idx )
{ {
PSH1_Hint hint = table->hints + index; PSH1_Hint hint = table->hints + idx;
if ( index >= table->max_hints ) if ( idx >= table->max_hints )
{ {
FT_ERROR(( "%s.activate: invalid hint index %d\n", index )); FT_ERROR(( "%s.activate: invalid hint index %d\n", idx ));
return; return;
} }
@ -136,7 +136,7 @@
{ {
FT_Int mask = 0, val = 0; FT_Int mask = 0, val = 0;
FT_Byte* cursor = hint_mask->bytes; FT_Byte* cursor = hint_mask->bytes;
FT_UInt index, limit; FT_UInt idx, limit;
limit = hint_mask->num_bits; limit = hint_mask->num_bits;
@ -145,7 +145,7 @@
FT_ERROR(( "%s.activate_mask: invalid bit count (%d instead of %d)\n", FT_ERROR(( "%s.activate_mask: invalid bit count (%d instead of %d)\n",
"ps.fitter", hint_mask->num_bits, table->max_hints )); "ps.fitter", hint_mask->num_bits, table->max_hints ));
for ( index = 0; index < limit; index++ ) for ( idx = 0; idx < limit; idx++ )
{ {
if ( mask == 0 ) if ( mask == 0 )
{ {
@ -154,7 +154,7 @@
} }
if ( val & mask ) if ( val & mask )
psh1_hint_table_record( table, index ); psh1_hint_table_record( table, idx );
mask >>= 1; mask >>= 1;
} }
@ -238,7 +238,7 @@
{ {
FT_Int mask = 0, val = 0; FT_Int mask = 0, val = 0;
FT_Byte* cursor = hint_mask->bytes; FT_Byte* cursor = hint_mask->bytes;
FT_UInt index, limit, count; FT_UInt idx, limit, count;
limit = hint_mask->num_bits; limit = hint_mask->num_bits;
@ -246,7 +246,7 @@
psh1_hint_table_deactivate( table ); psh1_hint_table_deactivate( table );
for ( index = 0; index < limit; index++ ) for ( idx = 0; idx < limit; idx++ )
{ {
if ( mask == 0 ) if ( mask == 0 )
{ {
@ -256,7 +256,7 @@
if ( val & mask ) if ( val & mask )
{ {
PSH1_Hint hint = &table->hints[index]; PSH1_Hint hint = &table->hints[idx];
if ( !psh1_hint_is_active( hint ) ) if ( !psh1_hint_is_active( hint ) )

View File

@ -85,14 +85,14 @@
/* internal function used to record a new hint */ /* internal function used to record a new hint */
static void static void
psh2_hint_table_record( PSH2_Hint_Table table, psh2_hint_table_record( PSH2_Hint_Table table,
FT_UInt index ) FT_UInt idx )
{ {
PSH2_Hint hint = table->hints + index; PSH2_Hint hint = table->hints + idx;
if ( index >= table->max_hints ) if ( idx >= table->max_hints )
{ {
FT_ERROR(( "%s.activate: invalid hint index %d\n", index )); FT_ERROR(( "%s.activate: invalid hint index %d\n", idx ));
return; return;
} }
@ -137,12 +137,12 @@
{ {
FT_Int mask = 0, val = 0; FT_Int mask = 0, val = 0;
FT_Byte* cursor = hint_mask->bytes; FT_Byte* cursor = hint_mask->bytes;
FT_UInt index, limit; FT_UInt idx, limit;
limit = hint_mask->num_bits; limit = hint_mask->num_bits;
for ( index = 0; index < limit; index++ ) for ( idx = 0; idx < limit; idx++ )
{ {
if ( mask == 0 ) if ( mask == 0 )
{ {
@ -151,7 +151,7 @@
} }
if ( val & mask ) if ( val & mask )
psh2_hint_table_record( table, index ); psh2_hint_table_record( table, idx );
mask >>= 1; mask >>= 1;
} }
@ -235,7 +235,7 @@
{ {
FT_Int mask = 0, val = 0; FT_Int mask = 0, val = 0;
FT_Byte* cursor = hint_mask->bytes; FT_Byte* cursor = hint_mask->bytes;
FT_UInt index, limit, count; FT_UInt idx, limit, count;
limit = hint_mask->num_bits; limit = hint_mask->num_bits;
@ -243,7 +243,7 @@
psh2_hint_table_deactivate( table ); psh2_hint_table_deactivate( table );
for ( index = 0; index < limit; index++ ) for ( idx = 0; idx < limit; idx++ )
{ {
if ( mask == 0 ) if ( mask == 0 )
{ {
@ -253,7 +253,7 @@
if ( val & mask ) if ( val & mask )
{ {
PSH2_Hint hint = &table->hints[index]; PSH2_Hint hint = &table->hints[idx];
if ( !psh2_hint_is_active( hint ) ) if ( !psh2_hint_is_active( hint ) )

View File

@ -141,20 +141,16 @@ FT_BEGIN_HEADER
} PSH_GlobalsRec; } PSH_GlobalsRec;
typedef enum #define PSH_BLUE_ALIGN_NONE 0
{ #define PSH_BLUE_ALIGN_TOP 1
PSH_BLUE_ALIGN_NONE = 0, #define PSH_BLUE_ALIGN_BOT 2
PSH_BLUE_ALIGN_TOP = 1,
PSH_BLUE_ALIGN_BOT = 2
} PSH_Blue_Align;
typedef struct PSH_AlignmentRec_ typedef struct PSH_AlignmentRec_
{ {
PSH_Blue_Align align; int align;
FT_Pos align_top; FT_Pos align_top;
FT_Pos align_bot; FT_Pos align_bot;
} PSH_AlignmentRec, *PSH_Alignment; } PSH_AlignmentRec, *PSH_Alignment;

View File

@ -91,8 +91,8 @@
} }
FT_CALLBACK_DEF( PSHinter_Interface ) static
pshinter_interface = const PSHinter_Interface pshinter_interface =
{ {
pshinter_get_globals_funcs, pshinter_get_globals_funcs,
pshinter_get_t1_funcs, pshinter_get_t1_funcs,

View File

@ -151,55 +151,55 @@
/* test a bit value in a given mask */ /* test a bit value in a given mask */
static FT_Int static FT_Int
ps_mask_test_bit( PS_Mask mask, ps_mask_test_bit( PS_Mask mask,
FT_Int index ) FT_Int idx )
{ {
if ( (FT_UInt)index >= mask->num_bits ) if ( (FT_UInt)idx >= mask->num_bits )
return 0; return 0;
return mask->bytes[index >> 3] & ( 0x80 >> ( index & 7 ) ); return mask->bytes[idx >> 3] & ( 0x80 >> ( idx & 7 ) );
} }
/* clear a given bit */ /* clear a given bit */
static void static void
ps_mask_clear_bit( PS_Mask mask, ps_mask_clear_bit( PS_Mask mask,
FT_Int index ) FT_Int idx )
{ {
FT_Byte* p; FT_Byte* p;
if ( (FT_UInt)index >= mask->num_bits ) if ( (FT_UInt)idx >= mask->num_bits )
return; return;
p = mask->bytes + ( index >> 3 ); p = mask->bytes + ( idx >> 3 );
p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( index & 7 ) ) ); p[0] = (FT_Byte)( p[0] & ~( 0x80 >> ( idx & 7 ) ) );
} }
/* set a given bit, possibly grow the mask */ /* set a given bit, possibly grow the mask */
static FT_Error static FT_Error
ps_mask_set_bit( PS_Mask mask, ps_mask_set_bit( PS_Mask mask,
FT_Int index, FT_Int idx,
FT_Memory memory ) FT_Memory memory )
{ {
FT_Error error = 0; FT_Error error = 0;
FT_Byte* p; FT_Byte* p;
if ( index < 0 ) if ( idx < 0 )
goto Exit; goto Exit;
if ( (FT_UInt)index >= mask->num_bits ) if ( (FT_UInt)idx >= mask->num_bits )
{ {
error = ps_mask_ensure( mask, index + 1, memory ); error = ps_mask_ensure( mask, idx + 1, memory );
if ( error ) if ( error )
goto Exit; goto Exit;
mask->num_bits = index + 1; mask->num_bits = idx + 1;
} }
p = mask->bytes + ( index >> 3 ); p = mask->bytes + ( idx >> 3 );
p[0] = (FT_Byte)( p[0] | ( 0x80 >> ( index & 7 ) ) ); p[0] = (FT_Byte)( p[0] | ( 0x80 >> ( idx & 7 ) ) );
Exit: Exit:
return error; return error;
@ -554,7 +554,7 @@
/* set a bit at a given index in the current hint mask */ /* set a bit at a given index in the current hint mask */
static FT_Error static FT_Error
ps_dimension_set_mask_bit( PS_Dimension dim, ps_dimension_set_mask_bit( PS_Dimension dim,
FT_UInt index, FT_UInt idx,
FT_Memory memory ) FT_Memory memory )
{ {
PS_Mask mask; PS_Mask mask;
@ -566,7 +566,7 @@
if ( error ) if ( error )
goto Exit; goto Exit;
error = ps_mask_set_bit( mask, index, memory ); error = ps_mask_set_bit( mask, idx, memory );
Exit: Exit:
return error; return error;
@ -665,19 +665,19 @@
/* now, lookup stem in the current hints table */ /* now, lookup stem in the current hints table */
{ {
PS_Mask mask; PS_Mask mask;
FT_UInt index; FT_UInt idx;
FT_UInt max = dim->hints.num_hints; FT_UInt max = dim->hints.num_hints;
PS_Hint hint = dim->hints.hints; PS_Hint hint = dim->hints.hints;
for ( index = 0; index < max; index++, hint++ ) for ( idx = 0; idx < max; idx++, hint++ )
{ {
if ( hint->pos == pos && hint->len == len ) if ( hint->pos == pos && hint->len == len )
break; break;
} }
/* we need to create a new hint in the table */ /* we need to create a new hint in the table */
if ( index >= max ) if ( idx >= max )
{ {
error = ps_hint_table_alloc( &dim->hints, memory, &hint ); error = ps_hint_table_alloc( &dim->hints, memory, &hint );
if ( error ) if ( error )
@ -693,12 +693,12 @@
if ( error ) if ( error )
goto Exit; goto Exit;
error = ps_mask_set_bit( mask, index, memory ); error = ps_mask_set_bit( mask, idx, memory );
if ( error ) if ( error )
goto Exit; goto Exit;
if ( aindex ) if ( aindex )
*aindex = (FT_Int)index; *aindex = (FT_Int)idx;
} }
Exit: Exit:
@ -898,7 +898,7 @@
PS_Dimension dim; PS_Dimension dim;
FT_Memory memory = hints->memory; FT_Memory memory = hints->memory;
FT_Int count; FT_Int count;
FT_Int index[3]; FT_Int idx[3];
/* limit "dimension" to 0..1 */ /* limit "dimension" to 0..1 */
@ -918,14 +918,14 @@
for ( count = 0; count < 3; count++, stems += 2 ) for ( count = 0; count < 3; count++, stems += 2 )
{ {
error = ps_dimension_add_t1stem( dim, stems[0], stems[1], error = ps_dimension_add_t1stem( dim, stems[0], stems[1],
memory, &index[count] ); memory, &idx[count] );
if ( error ) if ( error )
goto Fail; goto Fail;
} }
/* now, add the hints to the counters table */ /* now, add the hints to the counters table */
error = ps_dimension_add_counter( dim, index[0], index[1], error = ps_dimension_add_counter( dim, idx[0], idx[1], idx[2],
index[2], memory ); memory );
if ( error ) if ( error )
goto Fail; goto Fail;
} }

View File

@ -204,15 +204,15 @@
for ( n = 0; n < num_glyphs; n++ ) for ( n = 0; n < num_glyphs; n++ )
{ {
FT_Int index; FT_Int idx;
index = glyph_indices[n]; idx = glyph_indices[n];
if ( index >= 258 ) if ( idx >= 258 )
{ {
index -= 257; idx -= 257;
if ( index > num_names ) if ( idx > num_names )
num_names = (FT_UShort)index; num_names = (FT_UShort)idx;
} }
} }
} }
@ -303,10 +303,10 @@
for ( n = 0; n < num_glyphs; n++ ) for ( n = 0; n < num_glyphs; n++ )
{ {
FT_Long index = (FT_Long)n + offset_table[n]; FT_Long idx = (FT_Long)n + offset_table[n];
if ( index < 0 || index > num_glyphs ) if ( idx < 0 || idx > num_glyphs )
{ {
error = SFNT_Err_Invalid_File_Format; error = SFNT_Err_Invalid_File_Format;
goto Fail; goto Fail;
@ -431,7 +431,7 @@
/* <Input> */ /* <Input> */
/* face :: A handle to the parent face. */ /* face :: A handle to the parent face. */
/* */ /* */
/* index :: The glyph index. */ /* idx :: The glyph index. */
/* */ /* */
/* PSname :: The address of a string pointer. Will be NULL in case */ /* PSname :: The address of a string pointer. Will be NULL in case */
/* of error, otherwise it is a pointer to the glyph name. */ /* of error, otherwise it is a pointer to the glyph name. */
@ -443,7 +443,7 @@
/* */ /* */
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
TT_Get_PS_Name( TT_Face face, TT_Get_PS_Name( TT_Face face,
FT_UInt index, FT_UInt idx,
FT_String** PSname ) FT_String** PSname )
{ {
FT_Error error; FT_Error error;
@ -457,7 +457,7 @@
if ( !face ) if ( !face )
return SFNT_Err_Invalid_Face_Handle; return SFNT_Err_Invalid_Face_Handle;
if ( index >= (FT_UInt)face->root.num_glyphs ) if ( idx >= (FT_UInt)face->root.num_glyphs )
return SFNT_Err_Invalid_Glyph_Index; return SFNT_Err_Invalid_Glyph_Index;
#ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES
@ -474,8 +474,8 @@
switch ( face->postscript.FormatType ) switch ( face->postscript.FormatType )
{ {
case 0x00010000L: case 0x00010000L:
if ( index < 258 ) /* paranoid checking */ if ( idx < 258 ) /* paranoid checking */
*PSname = MAC_NAME( index ); *PSname = MAC_NAME( idx );
break; break;
case 0x00020000L: case 0x00020000L:
@ -490,9 +490,9 @@
break; break;
} }
if ( index < (FT_UInt)table->num_glyphs ) if ( idx < (FT_UInt)table->num_glyphs )
{ {
FT_UShort name_index = table->glyph_indices[index]; FT_UShort name_index = table->glyph_indices[idx];
if ( name_index < 258 ) if ( name_index < 258 )
@ -515,10 +515,10 @@
break; break;
} }
if ( index < (FT_UInt)table->num_glyphs ) /* paranoid checking */ if ( idx < (FT_UInt)table->num_glyphs ) /* paranoid checking */
{ {
index += table->offsets[index]; idx += table->offsets[idx];
*PSname = MAC_NAME( index ); *PSname = MAC_NAME( idx );
} }
} }
break; break;

View File

@ -70,7 +70,7 @@
/* header :: A pointer to either the horizontal or vertical metrics */ /* header :: A pointer to either the horizontal or vertical metrics */
/* structure. */ /* structure. */
/* */ /* */
/* index :: The glyph index. */ /* idx :: The glyph index. */
/* */ /* */
/* <Output> */ /* <Output> */
/* bearing :: The bearing, either left side or top side. */ /* bearing :: The bearing, either left side or top side. */
@ -83,7 +83,7 @@
/* */ /* */
FT_LOCAL_DEF( void ) FT_LOCAL_DEF( void )
TT_Get_Metrics( TT_HoriHeader* header, TT_Get_Metrics( TT_HoriHeader* header,
FT_UInt index, FT_UInt idx,
FT_Short* bearing, FT_Short* bearing,
FT_UShort* advance ) FT_UShort* advance )
{ {
@ -91,15 +91,15 @@
FT_UShort k = header->number_Of_HMetrics; FT_UShort k = header->number_Of_HMetrics;
if ( index < (FT_UInt)k ) if ( idx < (FT_UInt)k )
{ {
longs_m = (TT_LongMetrics*)header->long_metrics + index; longs_m = (TT_LongMetrics*)header->long_metrics + idx;
*bearing = longs_m->bearing; *bearing = longs_m->bearing;
*advance = longs_m->advance; *advance = longs_m->advance;
} }
else else
{ {
*bearing = ((TT_ShortMetrics*)header->short_metrics)[index - k]; *bearing = ((TT_ShortMetrics*)header->short_metrics)[idx - k];
*advance = ((TT_LongMetrics*)header->long_metrics)[k - 1].advance; *advance = ((TT_LongMetrics*)header->long_metrics)[k - 1].advance;
} }
} }
@ -113,12 +113,12 @@
/* */ /* */
static void static void
Get_HMetrics( TT_Face face, Get_HMetrics( TT_Face face,
FT_UInt index, FT_UInt idx,
FT_Bool check, FT_Bool check,
FT_Short* lsb, FT_Short* lsb,
FT_UShort* aw ) FT_UShort* aw )
{ {
TT_Get_Metrics( &face->horizontal, index, lsb, aw ); TT_Get_Metrics( &face->horizontal, idx, lsb, aw );
if ( check && face->postscript.isFixedPitch ) if ( check && face->postscript.isFixedPitch )
*aw = face->horizontal.advance_Width_Max; *aw = face->horizontal.advance_Width_Max;
@ -749,22 +749,22 @@
TT_Face face = (TT_Face)loader->face; TT_Face face = (TT_Face)loader->face;
FT_ULong offset; FT_ULong offset;
FT_Int contours_count; FT_Int contours_count;
FT_UInt index, num_points, count; FT_UInt idx, num_points, count;
FT_Fixed x_scale, y_scale; FT_Fixed x_scale, y_scale;
FT_GlyphLoader gloader = loader->gloader; FT_GlyphLoader gloader = loader->gloader;
FT_Bool opened_frame = 0; FT_Bool opened_frame = 0;
/* check glyph index */ /* check glyph index */
index = glyph_index; idx = glyph_index;
if ( index >= (FT_UInt)face->root.num_glyphs ) if ( idx >= (FT_UInt)face->root.num_glyphs )
{ {
error = TT_Err_Invalid_Glyph_Index; error = TT_Err_Invalid_Glyph_Index;
goto Exit; goto Exit;
} }
loader->glyph_index = glyph_index; loader->glyph_index = glyph_index;
num_points = 0; num_points = 0;
x_scale = 0x10000L; x_scale = 0x10000L;
y_scale = 0x10000L; y_scale = 0x10000L;
@ -780,7 +780,7 @@
FT_UShort advance_width; FT_UShort advance_width;
Get_HMetrics( face, index, Get_HMetrics( face, idx,
(FT_Bool)!(loader->load_flags & (FT_Bool)!(loader->load_flags &
FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH), FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH),
&left_bearing, &left_bearing,
@ -796,11 +796,11 @@
} }
} }
offset = face->glyph_locations[index]; offset = face->glyph_locations[idx];
count = 0; count = 0;
if ( index < (FT_UInt)face->num_locations - 1 ) if ( idx < (FT_UInt)face->num_locations - 1 )
count = face->glyph_locations[index + 1] - offset; count = face->glyph_locations[idx + 1] - offset;
if ( count == 0 ) if ( count == 0 )
{ {

View File

@ -251,7 +251,7 @@
FT_Vector* kerning ) FT_Vector* kerning )
{ {
T1_Kern_Pair *min, *mid, *max; T1_Kern_Pair *min, *mid, *max;
FT_ULong index = KERN_INDEX( glyph1, glyph2 ); FT_ULong idx = KERN_INDEX( glyph1, glyph2 );
/* simple binary search */ /* simple binary search */
@ -266,13 +266,13 @@
mid = min + ( max - min ) / 2; mid = min + ( max - min ) / 2;
midi = KERN_INDEX( mid->glyph1, mid->glyph2 ); midi = KERN_INDEX( mid->glyph1, mid->glyph2 );
if ( midi == index ) if ( midi == idx )
{ {
*kerning = mid->kerning; *kerning = mid->kerning;
return; return;
} }
if ( midi < index ) if ( midi < idx )
min = mid + 1; min = mid + 1;
else else
max = mid - 1; max = mid - 1;

View File

@ -1133,7 +1133,7 @@
for ( n = 0; n < loader->num_subrs; n++ ) for ( n = 0; n < loader->num_subrs; n++ )
{ {
FT_Int index, size; FT_Int idx, size;
FT_Byte* base; FT_Byte* base;
@ -1142,7 +1142,7 @@
if ( strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 ) if ( strncmp( (char*)parser->root.cursor, "dup", 3 ) != 0 )
break; break;
index = T1_ToInt( parser ); idx = T1_ToInt( parser );
if ( !read_binary_data( parser, &size, &base ) ) if ( !read_binary_data( parser, &size, &base ) )
return; return;
@ -1177,12 +1177,12 @@
MEM_Copy( temp, base, size ); MEM_Copy( temp, base, size );
psaux->t1_decrypt( temp, size, 4330 ); psaux->t1_decrypt( temp, size, 4330 );
size -= face->type1.private_dict.lenIV; size -= face->type1.private_dict.lenIV;
error = T1_Add_Table( table, index, error = T1_Add_Table( table, idx,
temp + face->type1.private_dict.lenIV, size ); temp + face->type1.private_dict.lenIV, size );
FREE( temp ); FREE( temp );
} }
else else
error = T1_Add_Table( table, index, base, size ); error = T1_Add_Table( table, idx, base, size );
if ( error ) if ( error )
goto Fail; goto Fail;
} }
@ -1709,7 +1709,7 @@
/* array.. */ /* array.. */
if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY ) if ( type1->encoding_type == T1_ENCODING_TYPE_ARRAY )
{ {
FT_Int charcode, index, min_char, max_char; FT_Int charcode, idx, min_char, max_char;
FT_Byte* char_name; FT_Byte* char_name;
FT_Byte* glyph_name; FT_Byte* glyph_name;
@ -1730,13 +1730,13 @@
char_name = loader.encoding_table.elements[charcode]; char_name = loader.encoding_table.elements[charcode];
if ( char_name ) if ( char_name )
for ( index = 0; index < type1->num_glyphs; index++ ) for ( idx = 0; idx < type1->num_glyphs; idx++ )
{ {
glyph_name = (FT_Byte*)type1->glyph_names[index]; glyph_name = (FT_Byte*)type1->glyph_names[idx];
if ( strcmp( (const char*)char_name, if ( strcmp( (const char*)char_name,
(const char*)glyph_name ) == 0 ) (const char*)glyph_name ) == 0 )
{ {
type1->encoding.char_index[charcode] = (FT_UShort)index; type1->encoding.char_index[charcode] = (FT_UShort)idx;
type1->encoding.char_name [charcode] = (char*)glyph_name; type1->encoding.char_name [charcode] = (char*)glyph_name;
/* Change min/max encoded char only if glyph name is */ /* Change min/max encoded char only if glyph name is */

View File

@ -58,9 +58,9 @@
static PSH_Globals_Funcs static PSH_Globals_Funcs
T1_Size_Get_Globals_Funcs( T1_Size size ) T1_Size_Get_Globals_Funcs( T1_Size size )
{ {
T1_Face face = (T1_Face) size->root.face; T1_Face face = (T1_Face)size->root.face;
PSHinter_Service pshinter = face->pshinter; PSHinter_Service pshinter = (PSHinter_Service)face->pshinter;
FT_Module module; FT_Module module;
module = FT_Get_Module( size->root.face->driver->root.library, module = FT_Get_Module( size->root.face->driver->root.library,
@ -143,15 +143,18 @@
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
T1_GlyphSlot_Init( T1_GlyphSlot slot ) T1_GlyphSlot_Init( T1_GlyphSlot slot )
{ {
T1_Face face; T1_Face face;
PSHinter_Service pshinter; PSHinter_Service pshinter;
face = (T1_Face) slot->root.face;
pshinter = face->pshinter; face = (T1_Face)slot->root.face;
if (pshinter) pshinter = (PSHinter_Service)face->pshinter;
if ( pshinter )
{ {
FT_Module module; FT_Module module;
module = FT_Get_Module( slot->root.face->driver->root.library, "pshinter" ); module = FT_Get_Module( slot->root.face->driver->root.library, "pshinter" );
if (module) if (module)
{ {

View File

@ -414,13 +414,11 @@
return result; return result;
} }
static FT_Long static FT_Long
FNT_Get_Next_Char( FT_CharMap charmap, FNT_Get_Next_Char( FT_CharMap charmap,
FT_Long char_code ) FT_Long char_code )
{ {
FT_ULong result = 0;
FT_UInt gindex = 0;
char_code++; char_code++;
if ( charmap ) if ( charmap )
{ {
@ -441,10 +439,6 @@
#endif /* !FT_CONFIG_OPTION_USE_CMAPS */ #endif /* !FT_CONFIG_OPTION_USE_CMAPS */
static void static void
FNT_Face_Done( FNT_Face face ) FNT_Face_Done( FNT_Face face )
{ {