From f258627e8346591f235a4d85a618f6f412e0f937 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Thu, 13 May 2004 21:59:17 +0000 Subject: [PATCH] * src/cff/cffgload.h (CFF_Builder): Remove `error' * src/cff/cffgload.c (cff_decoder_parse_charstrings): Replace `Memory_Error' with `Fail' und update all users. --- ChangeLog | 6 ++++++ src/cff/cffgload.c | 44 +++++++++++++++++++++----------------------- src/cff/cffgload.h | 6 +----- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4cffb9a09..02b6ac599 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-05-12 Werner Lemberg + + * src/cff/cffgload.h (CFF_Builder): Remove `error' + * src/cff/cffgload.c (cff_decoder_parse_charstrings): Replace + `Memory_Error' with `Fail' und update all users. + 2004-05-11 Werner Lemberg * include/freetype/internal/psaux.h (T1_ParseState): New diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c index 3df1cf7a5..934dcb07d 100644 --- a/src/cff/cffgload.c +++ b/src/cff/cffgload.c @@ -825,7 +825,7 @@ zone = decoder->zones; stack = decoder->top; - hinter = (T2_Hints_Funcs) builder->hints_funcs; + hinter = (T2_Hints_Funcs)builder->hints_funcs; builder->path_begun = 0; @@ -842,7 +842,7 @@ if ( hinter ) hinter->open( hinter->hints ); - /* now, execute loop */ + /* now execute loop */ while ( ip < limit ) { CFF_Operator op; @@ -1266,7 +1266,7 @@ if ( cff_builder_start_point ( builder, x, y ) || check_points( builder, num_args / 2 ) ) - goto Memory_Error; + goto Fail; if ( num_args < 2 || num_args & 1 ) goto Stack_Underflow; @@ -1291,9 +1291,9 @@ FT_TRACE4(( op == cff_op_hlineto ? " hlineto" : " vlineto" )); - if ( cff_builder_start_point ( builder, x, y ) || - check_points( builder, num_args ) ) - goto Memory_Error; + if ( cff_builder_start_point ( builder, x, y ) || + check_points( builder, num_args ) ) + goto Fail; args = stack; while (args < decoder->top ) @@ -1304,7 +1304,7 @@ y += args[0]; if ( cff_builder_add_point1( builder, x, y ) ) - goto Memory_Error; + goto Fail; args++; phase ^= 1; @@ -1322,7 +1322,7 @@ if ( cff_builder_start_point ( builder, x, y ) || check_points( builder, num_args / 2 ) ) - goto Memory_Error; + goto Fail; args = stack; while ( args < decoder->top ) @@ -1345,7 +1345,7 @@ FT_TRACE4(( " vvcurveto" )); if ( cff_builder_start_point( builder, x, y ) ) - goto Memory_Error; + goto Fail; args = stack; if ( num_args & 1 ) @@ -1359,7 +1359,7 @@ goto Stack_Underflow; if ( check_points( builder, 3 * ( num_args / 4 ) ) ) - goto Memory_Error; + goto Fail; while ( args < decoder->top ) { @@ -1379,7 +1379,7 @@ FT_TRACE4(( " hhcurveto" )); if ( cff_builder_start_point( builder, x, y ) ) - goto Memory_Error; + goto Fail; args = stack; if ( num_args & 1 ) @@ -1393,7 +1393,7 @@ goto Stack_Underflow; if ( check_points( builder, 3 * ( num_args / 4 ) ) ) - goto Memory_Error; + goto Fail; while ( args < decoder->top ) { @@ -1419,7 +1419,7 @@ : " hvcurveto" )); if ( cff_builder_start_point( builder, x, y ) ) - goto Memory_Error; + goto Fail; args = stack; if (num_args < 4 || ( num_args % 4 ) > 1 ) @@ -1476,7 +1476,7 @@ if ( cff_builder_start_point( builder, x, y ) || check_points( builder, num_lines + 3 ) ) - goto Memory_Error; + goto Fail; args = stack; @@ -1516,7 +1516,7 @@ if ( cff_builder_start_point ( builder, x, y ) || check_points( builder, num_curves*3 + 2 ) ) - goto Memory_Error; + goto Fail; args = stack; @@ -1555,10 +1555,10 @@ /* adding five more points; 4 control points, 1 on-curve point */ /* make sure we have enough space for the start point if it */ - /* needs to be added.. */ + /* needs to be added */ if ( cff_builder_start_point( builder, x, y ) || check_points( builder, 6 ) ) - goto Memory_Error; + goto Fail; /* Record the starting point's y postion for later use */ start_y = y; @@ -1609,7 +1609,7 @@ /* adding six more points; 4 control points, 2 on-curve points */ if ( cff_builder_start_point( builder, x, y ) || check_points( builder, 6 ) ) - goto Memory_Error; + goto Fail; /* record the starting point's y-position for later use */ start_y = y; @@ -1661,7 +1661,7 @@ /* adding six more points; 4 control points, 2 on-curve points */ if ( cff_builder_start_point( builder, x, y ) || check_points( builder, 6 ) ) - goto Memory_Error; + goto Fail; /* record the starting point's x, y postion for later use */ start_x = x; @@ -1724,7 +1724,7 @@ if ( cff_builder_start_point( builder, x, y ) || check_points( builder, 6 ) ) - goto Memory_Error; + goto Fail; args = stack; for ( count = 6; count > 0; count-- ) @@ -2175,6 +2175,7 @@ FT_TRACE4(( "..end..\n\n" )); + Fail: return error; Syntax_Error: @@ -2188,9 +2189,6 @@ Stack_Overflow: FT_TRACE4(( "cff_decoder_parse_charstrings: stack overflow!" )); return CFF_Err_Stack_Overflow; - - Memory_Error: - return builder->error; } diff --git a/src/cff/cffgload.h b/src/cff/cffgload.h index 3adfe7cc6..89ae049b5 100644 --- a/src/cff/cffgload.h +++ b/src/cff/cffgload.h @@ -4,7 +4,7 @@ /* */ /* OpenType Glyph Loader (specification). */ /* */ -/* Copyright 1996-2001, 2002, 2003 by */ +/* Copyright 1996-2001, 2002, 2003, 2004 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -75,9 +75,6 @@ FT_BEGIN_HEADER /* */ /* no_recurse :: Set but not used. */ /* */ - /* error :: An error code that is only used to report memory */ - /* allocation problems. */ - /* */ /* metrics_only :: A boolean indicating that we only want to compute */ /* the metrics of a given glyph, not load all of its */ /* points. */ @@ -111,7 +108,6 @@ FT_BEGIN_HEADER FT_Bool load_points; FT_Bool no_recurse; - FT_Error error; /* only used for memory errors */ FT_Bool metrics_only; void* hints_funcs; /* hinter-specific */