diff options
author | Werner Lemberg <wl@gnu.org> | 2015-02-18 09:22:06 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2015-02-18 09:22:06 +0100 |
commit | 6bd7d28fc7ff083a4825fcca250bafd6d532b9d3 (patch) | |
tree | c8f6c7967938860685709ce093fa15bbe4587742 /src/psaux | |
parent | 6a0ded7641bdf4be45df1b09334faa5ea3887e3f (diff) | |
download | freetype2-6bd7d28fc7ff083a4825fcca250bafd6d532b9d3.tar.gz |
Don't use `FT_PtrDist' for lengths.
Use FT_UInt instead.
* include/internal/psaux.h (PS_Table_FuncsRec, PS_TableRec,
T1_DecoderRec): Do it.
* include/internal/t1types.h (T1_FontRec): Ditto.
* src/cid/cidload.c (cid_parse_dict): Updated.
* src/pfr/pfrload.c (pfr_extra_item_load_font_id): Ditto.
* src/psaux/psobjs.c (ps_table_add), src/psaux/psobjs.h: Ditto.
* src/type1/t1load.c (parse_blend_axis_types, parse_encoding,
parse_chharstrings, parse_dict): Ditto.
* src/type42/t42parse.c (t42_parse_encoding, t42_parse_charstrings,
t42_parse_dict): Ditto.
Diffstat (limited to 'src/psaux')
-rw-r--r-- | src/psaux/psobjs.c | 18 | ||||
-rw-r--r-- | src/psaux/psobjs.h | 8 |
2 files changed, 10 insertions, 16 deletions
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 ); |