Commit b5349a9b75b233b4036da594187a9959c3446890

Werner Lemberg 2002-02-19T16:30:15

* 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.

diff --git a/ChangeLog b/ChangeLog
index 403c5ad..bc3c303 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2002-02-19  Werner Lemberg  <wl@gnu.org>
+
+	* 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  <wl@gnu.org>
 
 	* src/autohint/ahglyph.c (ah_outline_link_segments): Remove unused
diff --git a/builds/freetype.mk b/builds/freetype.mk
index 53f0e85..426f6f6 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/<system>' 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 bd334aa..4d1d197 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 8d144d0..155bba4 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 0211b8e..a869839 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 407613c..272b467 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 5c5fbe0..c497190 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 7280781..0a90394 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 27ee5c1..a1d874c 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 48fa643..e023c0b 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 7b2a0f6..d7104d7 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;