diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cid/cidload.c | 10 | ||||
-rw-r--r-- | src/pfr/pfrload.c | 6 | ||||
-rw-r--r-- | src/psaux/psobjs.c | 18 | ||||
-rw-r--r-- | src/psaux/psobjs.h | 8 | ||||
-rw-r--r-- | src/type1/t1load.c | 28 | ||||
-rw-r--r-- | src/type42/t42parse.c | 20 |
6 files changed, 42 insertions, 48 deletions
diff --git a/src/cid/cidload.c b/src/cid/cidload.c index 4f8009f53..a82a82f93 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -342,11 +342,11 @@ /* look for immediates */ if ( *cur == '/' && cur + 2 < limit ) { - FT_PtrDist len; + FT_UInt len; cur++; - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); if ( len > 0 && len < 22 ) { @@ -363,10 +363,10 @@ if ( !name ) break; - if ( cur[0] == name[0] && - len == (FT_PtrDist)ft_strlen( (const char*)name ) ) + if ( cur[0] == name[0] && + len == ft_strlen( (const char*)name ) ) { - FT_PtrDist n; + FT_UInt n; for ( n = 1; n < len; n++ ) diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c index 9831662e6..31177c0e2 100644 --- a/src/pfr/pfrload.c +++ b/src/pfr/pfrload.c @@ -449,9 +449,9 @@ FT_Byte* limit, PFR_PhyFont phy_font ) { - FT_Error error = FT_Err_Ok; - FT_Memory memory = phy_font->memory; - FT_PtrDist len = limit - p; + FT_Error error = FT_Err_Ok; + FT_Memory memory = phy_font->memory; + FT_UInt len = (FT_UInt)( limit - p ); if ( phy_font->font_id != NULL ) diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c index 1c3ff72d3..750e37d58 100644 --- a/src/psaux/psobjs.c +++ b/src/psaux/psobjs.c @@ -165,10 +165,10 @@ /* reallocation fails. */ /* */ FT_LOCAL_DEF( FT_Error ) - ps_table_add( PS_Table table, - FT_Int idx, - void* object, - FT_PtrDist length ) + ps_table_add( PS_Table table, + FT_Int idx, + void* object, + FT_UInt length ) { if ( idx < 0 || idx >= table->max_elems ) { @@ -176,12 +176,6 @@ return FT_THROW( Invalid_Argument ); } - if ( length < 0 ) - { - FT_ERROR(( "ps_table_add: invalid length\n" )); - return FT_THROW( Invalid_Argument ); - } - /* grow the base block if needed */ if ( table->cursor + length > table->capacity ) { @@ -932,7 +926,7 @@ FT_Memory memory ) { FT_Byte* cur = *cursor; - FT_PtrDist len = 0; + FT_UInt len = 0; FT_Int count; FT_String* result; FT_Error error; @@ -972,7 +966,7 @@ } } - len = cur - *cursor; + len = (FT_UInt)( cur - *cursor ); if ( cur >= limit || FT_ALLOC( result, len + 1 ) ) return 0; diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h index aa2d7390c..8bfb9ea6c 100644 --- a/src/psaux/psobjs.h +++ b/src/psaux/psobjs.h @@ -52,10 +52,10 @@ FT_BEGIN_HEADER FT_Memory memory ); FT_LOCAL( FT_Error ) - ps_table_add( PS_Table table, - FT_Int idx, - void* object, - FT_PtrDist length ); + ps_table_add( PS_Table table, + FT_Int idx, + void* object, + FT_UInt length ); FT_LOCAL( void ) ps_table_done( PS_Table table ); diff --git a/src/type1/t1load.c b/src/type1/t1load.c index b3721d45f..bd3eca651 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -599,23 +599,23 @@ /* each token is an immediate containing the name of the axis */ for ( n = 0; n < num_axis; n++ ) { - T1_Token token = axis_tokens + n; - FT_Byte* name; - FT_PtrDist len; + T1_Token token = axis_tokens + n; + FT_Byte* name; + FT_UInt len; /* skip first slash, if any */ if ( token->start[0] == '/' ) token->start++; - len = token->limit - token->start; + len = (FT_UInt)( token->limit - token->start ); if ( len == 0 ) { error = FT_THROW( Invalid_File_Format ); goto Exit; } - if ( FT_ALLOC( blend->axis_names[n], (FT_Long)( len + 1 ) ) ) + if ( FT_ALLOC( blend->axis_names[n], len + 1 ) ) goto Exit; name = (FT_Byte*)blend->axis_names[n]; @@ -1285,7 +1285,7 @@ if ( cur + 2 < limit && *cur == '/' && n < count ) { - FT_PtrDist len; + FT_UInt len; cur++; @@ -1297,7 +1297,7 @@ if ( parser->root.error ) return; - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); parser->root.error = T1_Add_Table( char_table, charcode, cur, len + 1 ); @@ -1606,7 +1606,7 @@ if ( *cur == '/' ) { - FT_PtrDist len; + FT_UInt len; if ( cur + 2 >= limit ) @@ -1616,7 +1616,7 @@ } cur++; /* skip `/' */ - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); if ( !read_binary_data( parser, &size, &base, IS_INCREMENTAL ) ) return; @@ -1928,7 +1928,7 @@ /* look for immediates */ else if ( *cur == '/' && cur + 2 < limit ) { - FT_PtrDist len; + FT_UInt len; cur++; @@ -1938,7 +1938,7 @@ if ( parser->root.error ) goto Exit; - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); if ( len > 0 && len < 22 && parser->root.cursor < limit ) { @@ -1955,9 +1955,9 @@ if ( !name ) break; - if ( cur[0] == name[0] && - len == (FT_PtrDist)ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) + if ( cur[0] == name[0] && + len == ft_strlen( (const char *)name ) && + ft_memcmp( cur, name, len ) == 0 ) { /* We found it -- run the parsing callback! */ /* We record every instance of every field */ diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c index 7d9ccb6ad..c0d795425 100644 --- a/src/type42/t42parse.c +++ b/src/type42/t42parse.c @@ -433,7 +433,7 @@ if ( cur + 2 < limit && *cur == '/' && n < count ) { - FT_PtrDist len; + FT_UInt len; cur++; @@ -445,7 +445,7 @@ if ( parser->root.error ) return; - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); parser->root.error = T1_Add_Table( char_table, charcode, cur, len + 1 ); @@ -873,7 +873,7 @@ if ( *cur == '/' ) { - FT_PtrDist len; + FT_UInt len; if ( cur + 2 >= limit ) @@ -884,7 +884,7 @@ } cur++; /* skip `/' */ - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); error = T1_Add_Table( name_table, n, cur, len + 1 ); if ( error ) @@ -914,7 +914,7 @@ goto Fail; } - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); error = T1_Add_Table( code_table, n, cur, len + 1 ); if ( error ) @@ -1135,7 +1135,7 @@ /* look for immediates */ else if ( *cur == '/' && cur + 2 < limit ) { - FT_PtrDist len; + FT_UInt len; cur++; @@ -1145,7 +1145,7 @@ if ( parser->root.error ) goto Exit; - len = parser->root.cursor - cur; + len = (FT_UInt)( parser->root.cursor - cur ); if ( len > 0 && len < 22 && parser->root.cursor < limit ) { @@ -1164,9 +1164,9 @@ if ( !name ) continue; - if ( cur[0] == name[0] && - len == (FT_PtrDist)ft_strlen( (const char *)name ) && - ft_memcmp( cur, name, len ) == 0 ) + if ( cur[0] == name[0] && + len == ft_strlen( (const char *)name ) && + ft_memcmp( cur, name, len ) == 0 ) { /* we found it -- run the parsing callback! */ parser->root.error = t42_load_keyword( face, |