From a0f7778bd4fb275c744436b9b0cc283893f1ecf8 Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Fri, 3 Jul 2009 18:01:32 +0900 Subject: psaux: Handle the string length by FT_Offset variables. --- ChangeLog | 17 +++++++++++++++++ src/psaux/afmparse.c | 22 +++++++++++----------- src/psaux/afmparse.h | 2 +- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index bd3572c76..aae3cd957 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2009-07-03 suzuki toshiya + + psaux: Handle the string length by FT_Offset variables. + + * src/psaux/afmparse.c (afm_parser_next_key, + afm_tokenize, afm_parse_track_kern, + afm_parse_kern_pairs, afm_parse_kern_data, + afm_parser_skip_section, afm_parser_parse): + The length of key is handled by FT_Offset, + instead of FT_UInt. Although the length of + PostScript strings or name object is 16-bit, + AFM_STREAM_KEY_LEN() calculates the length + from the pointer difference. + + * src/psaux/afmparse.h (afm_parser_next_key): + Ditto. + 2009-07-03 suzuki toshiya pcf: Fix some data types mismatching with their sources. diff --git a/src/psaux/afmparse.c b/src/psaux/afmparse.c index 44fe42fac..91a17e236 100644 --- a/src/psaux/afmparse.c +++ b/src/psaux/afmparse.c @@ -440,7 +440,7 @@ FT_LOCAL_DEF( char* ) afm_parser_next_key( AFM_Parser parser, FT_Bool line, - FT_UInt* len ) + FT_Offset* len ) { AFM_Stream stream = parser->stream; char* key = 0; /* make stupid compiler happy */ @@ -488,7 +488,7 @@ } if ( len ) - *len = ( key ) ? AFM_STREAM_KEY_LEN( stream, key ) + *len = ( key ) ? (FT_Offset)AFM_STREAM_KEY_LEN( stream, key ) : 0; return key; @@ -497,7 +497,7 @@ static AFM_Token afm_tokenize( const char* key, - FT_UInt len ) + FT_Offset len ) { int n; @@ -585,7 +585,7 @@ AFM_FontInfo fi = parser->FontInfo; AFM_TrackKern tk; char* key; - FT_UInt len; + FT_Offset len; int n = -1; @@ -686,7 +686,7 @@ AFM_FontInfo fi = parser->FontInfo; AFM_KernPair kp; char* key; - FT_UInt len; + FT_Offset len; int n = -1; @@ -774,9 +774,9 @@ static FT_Error afm_parse_kern_data( AFM_Parser parser ) { - FT_Error error; - char* key; - FT_UInt len; + FT_Error error; + char* key; + FT_Offset len; while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) @@ -818,8 +818,8 @@ FT_UInt n, AFM_Token end_section ) { - char* key; - FT_UInt len; + char* key; + FT_Offset len; while ( n-- > 0 ) @@ -850,7 +850,7 @@ AFM_FontInfo fi = parser->FontInfo; FT_Error error = PSaux_Err_Syntax_Error; char* key; - FT_UInt len; + FT_Offset len; FT_Int metrics_sets = 0; diff --git a/src/psaux/afmparse.h b/src/psaux/afmparse.h index 7772dc79d..de2a530b2 100644 --- a/src/psaux/afmparse.h +++ b/src/psaux/afmparse.h @@ -77,7 +77,7 @@ FT_BEGIN_HEADER FT_LOCAL( char* ) afm_parser_next_key( AFM_Parser parser, FT_Bool line, - FT_UInt* len ); + FT_Offset* len ); FT_END_HEADER -- cgit v1.2.1