shithub: freetype+ttf2subf

Download patch

ref: 8c4120d0a390f00beef69859f09da3de4f731feb
parent: 6164a9d13b5127614bee9ca9228bae54eec2c065
author: Werner Lemberg <[email protected]>
date: Mon Jan 15 01:42:40 EST 2007

Fix various compiler warnings.

* src/truetype/ttdriver.c (tt_size_select), src/cff/cffobjs.h,
src/cff/cffobjs.c (cff_size_request), src/type42/t42objs.h:
s/index/strike_index/.
* src/base/ftobjs.c (FT_Match_Size): s/index/size_index/.

* src/gxvalid/gxvmorx5.c
(gxv_morx_subtable_type5_InsertList_validate): s/index/table_index/.

* src/truetype/ttinterp.c (Compute_Point_Displacement),
src/pcf/pcfread.c (pcf_seek_to_table_type): Avoid possibly
uninitialized variables.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2007-01-14  Detlef Würkner  <[email protected]>
+
+	Fix various compiler warnings.
+
+	* src/truetype/ttdriver.c (tt_size_select), src/cff/cffobjs.h,
+	src/cff/cffobjs.c (cff_size_request), src/type42/t42objs.h:
+	s/index/strike_index/.
+	* src/base/ftobjs.c (FT_Match_Size): s/index/size_index/.
+
+	* src/gxvalid/gxvmorx5.c
+	(gxv_morx_subtable_type5_InsertList_validate): s/index/table_index/.
+
+	* src/truetype/ttinterp.c (Compute_Point_Displacement),
+	src/pcf/pcfread.c (pcf_seek_to_table_type): Avoid possibly
+	uninitialized variables.
+
 2007-01-13  suzuki toshiya  <[email protected]>
 
 	* docs/CHANGES, docs/INSTALL.MAC: Improvements.
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -117,7 +117,7 @@
       OS X-only version.
 
 
-  III. MISCELLANEOUS
+  IV. MISCELLANEOUS
 
     - Various performance and memory footprint optimizations have been
       performed on  the TrueType and CFF font  loaders, sometimes with
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Auto-fitter types (specification only).                              */
 /*                                                                         */
-/*  Copyright 2003, 2004, 2005, 2006 by                                    */
+/*  Copyright 2003, 2004, 2005, 2006, 2007 by                              */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -54,7 +54,7 @@
   /*************************************************************************/
 
 #define xxAF_USE_WARPER  /* only define to use warp hinting */
-#define AF_DEBUG
+#define xxAF_DEBUG
 
 #ifdef AF_DEBUG
 
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2089,7 +2089,7 @@
   FT_Match_Size( FT_Face          face,
                  FT_Size_Request  req,
                  FT_Bool          ignore_width,
-                 FT_ULong*        index )
+                 FT_ULong*        size_index )
   {
     FT_Int   i;
     FT_Long  w, h;
@@ -2123,8 +2123,8 @@
 
       if ( w == FT_PIX_ROUND( bsize->x_ppem ) || ignore_width )
       {
-        if ( index )
-          *index = (FT_ULong)i;
+        if ( size_index )
+          *size_index = (FT_ULong)i;
 
         return FT_Err_Ok;
       }
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType objects manager (body).                                     */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -207,13 +207,13 @@
     {
       CFF_Face      cffface = (CFF_Face)size->face;
       SFNT_Service  sfnt    = (SFNT_Service)cffface->sfnt;
-      FT_ULong      index;
+      FT_ULong      strike_index;
 
 
-      if ( sfnt->set_sbit_strike( cffface, req, &index ) )
+      if ( sfnt->set_sbit_strike( cffface, req, &strike_index ) )
         cffsize->strike_index = 0xFFFFFFFFUL;
       else
-        return cff_size_select( size, index );
+        return cff_size_select( size, strike_index );
     }
 
 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
--- a/src/cff/cffobjs.h
+++ b/src/cff/cffobjs.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    OpenType objects manager (specification).                            */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2006 by                         */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2006, 2007 by                   */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -120,7 +120,7 @@
 
   FT_LOCAL( FT_Error )
   cff_size_select( FT_Size   size,
-                   FT_ULong  index );
+                   FT_ULong  strike_index );
 
 #endif
 
--- a/src/gxvalid/gxvmorx5.c
+++ b/src/gxvalid/gxvmorx5.c
@@ -5,7 +5,7 @@
 /*    TrueTypeGX/AAT morx table validation                                 */
 /*    body for type5 (Contextual Glyph Insertion) subtable.                */
 /*                                                                         */
-/*  Copyright 2005 by suzuki toshiya, Masatake YAMATO, Red Hat K.K.,       */
+/*  Copyright 2005, 2007 by suzuki toshiya, Masatake YAMATO, Red Hat K.K., */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -109,16 +109,16 @@
 
 
   static void
-  gxv_morx_subtable_type5_InsertList_validate( FT_UShort      index,
+  gxv_morx_subtable_type5_InsertList_validate( FT_UShort      table_index,
                                                FT_UShort      count,
                                                FT_Bytes       table,
                                                FT_Bytes       limit,
                                                GXV_Validator  valid )
   {
-    FT_Bytes p = table + index * 2;
+    FT_Bytes p = table + table_index * 2;
 
 
-    while ( p < table + count * 2 + index * 2 )
+    while ( p < table + count * 2 + table_index * 2 )
     {
       FT_UShort  insert_glyphID;
 
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -2,7 +2,7 @@
 
     FreeType font driver for pcf fonts
 
-  Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 by
+  Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by
   Francesco Zappa Nardelli
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -321,6 +321,7 @@
       }
 
   Fail:
+    *asize = 0;
     return error;
   }
 
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    TrueType font driver implementation (body).                          */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006 by                   */
+/*  Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007 by             */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -187,15 +187,15 @@
     {
       TT_Face       ttface = (TT_Face)size->face;
       SFNT_Service  sfnt   = (SFNT_Service) ttface->sfnt;
-      FT_ULong      index;
+      FT_ULong      strike_index;
 
 
-      error = sfnt->set_sbit_strike( ttface, req, &index );
+      error = sfnt->set_sbit_strike( ttface, req, &strike_index );
 
       if ( error )
         ttsize->strike_index = 0xFFFFFFFFUL;
       else
-        return tt_size_select( size, index );
+        return tt_size_select( size, strike_index );
     }
 
 #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -5249,6 +5249,7 @@
     {
       if ( CUR.pedantic_hinting )
         CUR.error = TT_Err_Invalid_Reference;
+      *refp = 0;
       return FAILURE;
     }
 
--- a/src/type42/t42objs.h
+++ b/src/type42/t42objs.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    Type 42 objects manager (specification).                             */
 /*                                                                         */
-/*  Copyright 2002, 2003, 2006 by Roberto Alameda.                         */
+/*  Copyright 2002, 2003, 2006, 2007 by Roberto Alameda.                   */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
 /*  modified, and distributed under the terms of the FreeType project      */
@@ -86,7 +86,7 @@
 
   FT_LOCAL( FT_Error )
   T42_Size_Select( T42_Size  size,
-                   FT_ULong  index );
+                   FT_ULong  strike_index );
 
 
   FT_LOCAL( void )