summaryrefslogtreecommitdiffstats
path: root/src/psaux/psobjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/psaux/psobjs.c')
-rw-r--r--src/psaux/psobjs.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index b4b7d45..c7cbc67 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (body). */
/* */
-/* Copyright 1996-2014 by */
+/* Copyright 1996-2015 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -81,7 +81,7 @@
table->max_elems = count;
table->init = 0xDEADBEEFUL;
table->num_elems = 0;
- table->block = 0;
+ table->block = NULL;
table->capacity = 0;
table->cursor = 0;
@@ -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 )
{
@@ -625,8 +619,8 @@
token->type = T1_TOKEN_TYPE_NONE;
- token->start = 0;
- token->limit = 0;
+ token->start = NULL;
+ token->limit = NULL;
/* first of all, skip leading whitespace */
ps_parser_skip_spaces( parser );
@@ -707,7 +701,7 @@
if ( !token->limit )
{
- token->start = 0;
+ token->start = NULL;
token->type = T1_TOKEN_TYPE_NONE;
}
@@ -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;
@@ -1230,7 +1224,7 @@
for ( i = 0; i < 4; i++ )
{
- result = ps_tofixedarray( &cur, limit, max_objects,
+ result = ps_tofixedarray( &cur, limit, (FT_Int)max_objects,
temp + i * max_objects, 0 );
if ( result < 0 || (FT_UInt)result < max_objects )
{
@@ -1321,7 +1315,7 @@
goto Exit;
}
if ( (FT_UInt)num_elements > field->array_max )
- num_elements = field->array_max;
+ num_elements = (FT_Int)field->array_max;
old_cursor = parser->cursor;
old_limit = parser->limit;
@@ -1338,7 +1332,15 @@
{
parser->cursor = token->start;
parser->limit = token->limit;
- ps_parser_load_field( parser, &fieldrec, objects, max_objects, 0 );
+
+ error = ps_parser_load_field( parser,
+ &fieldrec,
+ objects,
+ max_objects,
+ 0 );
+ if ( error )
+ break;
+
fieldrec.offset += fieldrec.size;
}
@@ -1371,7 +1373,7 @@
ps_parser_to_bytes( PS_Parser parser,
FT_Byte* bytes,
FT_Offset max_bytes,
- FT_Long* pnum_bytes,
+ FT_ULong* pnum_bytes,
FT_Bool delimiters )
{
FT_Error error = FT_Err_Ok;
@@ -1545,7 +1547,7 @@
FT_GlyphLoader_Rewind( loader );
builder->hints_globals = size->internal;
- builder->hints_funcs = 0;
+ builder->hints_funcs = NULL;
if ( hinting )
builder->hints_funcs = glyph->internal->glyph_hints;