From b5349a9b75b233b4036da594187a9959c3446890 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 19 Feb 2002 16:30:15 +0000 Subject: [PATCH] * builds/freetype.mk (FT_CFLAGS): Use $(INCLUDE_FLAGS) first. * src/cache/ftccache.c (ftc_cache_resize): Mark `error' as unused to avoid compiler warning. * src/cff/cffload.c (CFF_Get_String): Ditto. * src/cff/cffobjs.c (CFF_StrCopy): Ditto. * src/psaux/psobjs.c (PS_Table_Done): Ditto. * src/pcf/pcfread.c (pcf_seek_to_table_type): Ditto. * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Ditto. (pcf_get_bitmaps): The same for `sizebitmaps'. * src/psaux/t1decode.c (T1_Decode_Parse_Charstrings): The same for `orig_y'. (t1operator_seac): Comment out more dead code. * src/pshinter/pshalgo2.c (ps2_hints_apply): Add `DEBUG_HINTER' conditional. * src/truetype/ttgload.c (TT_Process_Simple_Glyph, load_truetype_glyph): Add `TT_CONFIG_OPTION_BYTECODE_INTERPRETER' conditional. --- ChangeLog | 21 +++++++++++++++++++++ builds/freetype.mk | 5 ++++- src/cache/ftccache.c | 2 ++ src/cff/cffload.c | 6 ++++-- src/cff/cffobjs.c | 3 +++ src/pcf/pcfread.c | 8 ++++++-- src/psaux/psobjs.c | 2 ++ src/psaux/t1decode.c | 9 ++++++++- src/pshinter/pshalgo2.c | 5 ++++- src/sfnt/sfdriver.c | 3 +++ src/truetype/ttgload.c | 13 ++++++++++++- 11 files changed, 69 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 403c5ad08..bc3c3035d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2002-02-19 Werner Lemberg + + * builds/freetype.mk (FT_CFLAGS): Use $(INCLUDE_FLAGS) first. + + * src/cache/ftccache.c (ftc_cache_resize): Mark `error' as unused + to avoid compiler warning. + * src/cff/cffload.c (CFF_Get_String): Ditto. + * src/cff/cffobjs.c (CFF_StrCopy): Ditto. + * src/psaux/psobjs.c (PS_Table_Done): Ditto. + * src/pcf/pcfread.c (pcf_seek_to_table_type): Ditto. + * src/sfnt/sfdriver.c (get_sfnt_postscript_name): Ditto. + (pcf_get_bitmaps): The same for `sizebitmaps'. + * src/psaux/t1decode.c (T1_Decode_Parse_Charstrings): The same for + `orig_y'. + (t1operator_seac): Comment out more dead code. + * src/pshinter/pshalgo2.c (ps2_hints_apply): Add `DEBUG_HINTER' + conditional. + * src/truetype/ttgload.c (TT_Process_Simple_Glyph, + load_truetype_glyph): Add `TT_CONFIG_OPTION_BYTECODE_INTERPRETER' + conditional. + 2002-02-18 Werner Lemberg * src/autohint/ahglyph.c (ah_outline_link_segments): Remove unused diff --git a/builds/freetype.mk b/builds/freetype.mk index 53f0e8537..426f6f601 100644 --- a/builds/freetype.mk +++ b/builds/freetype.mk @@ -139,7 +139,10 @@ INCLUDE_FLAGS = $(INCLUDES:%=$I%) # least the paths for the `base' and `builds/' directories; # debug/optimization/warning flags + ansi compliance if needed. # -FT_CFLAGS = $(CFLAGS) $(INCLUDE_FLAGS) +# $(INCLUDE_FLAGS) should come before $(CFLAGS) to avoid problems with +# old FreeType versions. +# +FT_CFLAGS = $(INCLUDE_FLAGS) $(CFLAGS) FT_CC = $(CC) $(FT_CFLAGS) FT_COMPILE = $(CC) $(ANSIFLAGS) $(FT_CFLAGS) diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c index bd334aa7d..4d1d197e7 100644 --- a/src/cache/ftccache.c +++ b/src/cache/ftccache.c @@ -383,6 +383,8 @@ cache->buckets = new_buckets; cache->size = new_size; + + FT_UNUSED( error ); } } diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 8d144d03b..155bba4a9 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -1328,8 +1328,8 @@ if ( adobe_name ) { - FT_Memory memory = index->stream->memory; - FT_Error error; + FT_Memory memory = index->stream->memory; + FT_Error error; len = (FT_UInt)strlen( adobe_name ); @@ -1338,6 +1338,8 @@ MEM_Copy( name, adobe_name, len ); name[len] = 0; } + + FT_UNUSED( error ); } return name; diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index 0211b8e56..a8698397d 100644 --- a/src/cff/cffobjs.c +++ b/src/cff/cffobjs.c @@ -241,6 +241,9 @@ MEM_Copy( result, source, len ); result[len] = 0; } + + FT_UNUSED( error ); + return result; } diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c index 407613c7e..272b46737 100644 --- a/src/pcf/pcfread.c +++ b/src/pcf/pcfread.c @@ -252,8 +252,8 @@ THE SOFTWARE. FT_ULong *aformat, FT_ULong *asize ) { - FT_Error error; - FT_Int i; + FT_Error error; + FT_Int i; for ( i = 0; i < ntables; i++ ) @@ -271,6 +271,8 @@ THE SOFTWARE. return PCF_Err_Ok; } + FT_UNUSED( error ); + return PCF_Err_Invalid_File_Format; } @@ -618,6 +620,8 @@ THE SOFTWARE. PCF_GLYPH_PAD_INDEX( format ) )); FT_TRACE4(( "bitmap size = %d\n", sizebitmaps )); + FT_UNUSED( sizebitmaps ); /* only used for debugging */ + for ( i = 0; i < nbitmaps; i++ ) face->metrics[i].bits = stream->pos + offsets[i]; diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c index 5c5fbe0b0..c497190b0 100644 --- a/src/psaux/psobjs.c +++ b/src/psaux/psobjs.c @@ -227,6 +227,8 @@ table->capacity = table->cursor; FREE( old_base ); + + FT_UNUSED( error ); } diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c index 7280781ce..0a90394ed 100644 --- a/src/psaux/t1decode.c +++ b/src/psaux/t1decode.c @@ -183,8 +183,11 @@ FT_Int achar ) { FT_Error error; - FT_Int bchar_index, achar_index, n_base_points; + FT_Int bchar_index, achar_index; +#if 0 + FT_Int n_base_points; FT_Outline* base = decoder->builder.base; +#endif FT_Vector left_bearing, advance; @@ -258,7 +261,9 @@ if ( error ) goto Exit; +#if 0 n_base_points = base->n_points; +#endif /* save the left bearing and width of the base character */ /* as they will be erased by the next load. */ @@ -761,6 +766,8 @@ orig_x = builder->last.x = x = builder->pos_x + top[0]; orig_y = builder->last.y = y = builder->pos_y; + FT_UNUSED( orig_y ); + /* the `metrics_only' indicates that we only want to compute */ /* the glyph's metrics (lsb + advance width), not load the */ /* rest of it; so exit immediately */ diff --git a/src/pshinter/pshalgo2.c b/src/pshinter/pshalgo2.c index 27ee5c1be..a1d874cae 100644 --- a/src/pshinter/pshalgo2.c +++ b/src/pshinter/pshalgo2.c @@ -1500,12 +1500,15 @@ PSH2_GlyphRec glyphrec; PSH2_Glyph glyph = &glyphrec; FT_Error error; +#ifdef DEBUG_HINTER FT_Memory memory; +#endif FT_Int dimension; - memory = globals->memory; #ifdef DEBUG_HINTER + memory = globals->memory; + if ( ps2_debug_glyph ) { psh2_glyph_done( ps2_debug_glyph ); diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c index 48fa643a1..e023c0b16 100644 --- a/src/sfnt/sfdriver.c +++ b/src/sfnt/sfdriver.c @@ -151,6 +151,9 @@ face->root.internal->postscript_name = result; } + + FT_UNUSED( error ); + return result; } } diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 7b2a0f6fc..d7104d789 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -609,14 +609,18 @@ FT_GlyphLoader* gloader = load->gloader; FT_Outline* outline = &gloader->current.outline; FT_UInt n_points = outline->n_points; +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER FT_UInt n_ins; +#endif TT_GlyphZone* zone = &load->zone; FT_Error error = TT_Err_Ok; FT_UNUSED( debug ); /* used by truetype interpreter only */ +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER n_ins = load->glyph->control_len; +#endif /* add shadow points */ @@ -915,19 +919,26 @@ else { TT_GlyphSlot glyph = (TT_GlyphSlot)loader->glyph; - FT_UInt start_point, start_contour; + FT_UInt start_point; +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER + FT_UInt start_contour; FT_ULong ins_pos; /* position of composite instructions, if any */ +#endif /* for each subglyph, read composite header */ start_point = gloader->base.outline.n_points; +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER start_contour = gloader->base.outline.n_contours; +#endif error = face->read_composite_glyph( loader ); if ( error ) goto Fail; +#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER ins_pos = loader->ins_pos; +#endif face->forget_glyph_frame( loader ); opened_frame = 0;