shithub: freetype+ttf2subf

Download patch

ref: e62c876bb0b86b8fa88fadf72d2621c79796a304
parent: dc185ee2c26f389e45000dd42fce1f8a7062d743
author: suzuki toshiya <[email protected]>
date: Tue Jun 14 22:48:33 EDT 2011

Fix g++4.6 compiler warnings in module drivers.

The background is same with previous commit.

* src/truetype/ttgxvar.c (ft_var_readpackedpoints):
Init `points'.  (TT_Vary_Get_Glyph_Deltas): Init
`delta_xy'.  (TT_Get_MM_Var): Init `mmvar'.
* src/type1/t1load.c (T1_Get_MM_Var): Ditto.
* src/cff/cffdrivr.c (cff_ps_get_font_info): Init
`font_info'.
* src/cff/cffload.c (cff_index_get_pointers): Init `t'.
(cff_font_load): Init `sub'.
* src/cff/cffobjs.c (cff_size_init): Init `internal'.
(cff_face_init): Init `cff'.
* src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps):
Init `snaps'.
* src/pcf/pcfread.c (pcf_get_properties): Init `properties'.
(pcf_get_bitmaps): Init `offsets'.  (pcf_get_encodings):
Init `tmpEncoding'.
* src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'.
* src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'.
* src/cache/ftcmru.c (FTC_MruList_New): Init `node'.
* src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and
`zip_buff'.
* src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'.
* src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,34 @@
 2011-06-14  suzuki toshiya  <[email protected]>
 
+	Fix g++4.6 compiler warnings in module drivers.
+
+	The background is same with previous commit.
+
+	* src/truetype/ttgxvar.c (ft_var_readpackedpoints):
+	Init `points'.  (TT_Vary_Get_Glyph_Deltas): Init
+	`delta_xy'.  (TT_Get_MM_Var): Init `mmvar'.
+	* src/type1/t1load.c (T1_Get_MM_Var): Ditto.
+	* src/cff/cffdrivr.c (cff_ps_get_font_info): Init
+	`font_info'.
+	* src/cff/cffload.c (cff_index_get_pointers): Init `t'.
+	(cff_font_load): Init `sub'.
+	* src/cff/cffobjs.c (cff_size_init): Init `internal'.
+	(cff_face_init): Init `cff'.
+	* src/pfr/pfrload.c (pfr_extra_item_load_stem_snaps):
+	Init `snaps'.
+	* src/pcf/pcfread.c (pcf_get_properties): Init `properties'.
+	(pcf_get_bitmaps): Init `offsets'.  (pcf_get_encodings):
+	Init `tmpEncoding'.
+	* src/sfnt/ttload.c (tt_face_load_gasp): Init `gaspranges'.
+	* src/sfnt/ttsbit.c (Load_SBit_Image): Init `components'.
+	* src/cache/ftcmru.c (FTC_MruList_New): Init `node'.
+	* src/gzip/ftgzip.c (FT_Stream_OpenGzip): Init `zip' and
+	`zip_buff'.
+	* src/lzw/ftlzw.c (FT_Stream_OpenLZW): Init `zip'.
+	* src/bzip2/ftbzip2.c (FT_Stream_OpenBzip2): Init `zip'.
+
+2011-06-14  suzuki toshiya  <[email protected]>
+
 	[base] Fix g++4.6 compiler warnings in src/base/*.c.
 
 	Passing uninitialized pointer to FT_NEW() families is
--- a/src/bzip2/ftbzip2.c
+++ b/src/bzip2/ftbzip2.c
@@ -456,7 +456,7 @@
   {
     FT_Error      error;
     FT_Memory     memory = source->memory;
-    FT_BZip2File  zip;
+    FT_BZip2File  zip = NULL;
 
 
     /*
--- a/src/cache/ftcmru.c
+++ b/src/cache/ftcmru.c
@@ -238,7 +238,7 @@
                    FTC_MruNode  *anode )
   {
     FT_Error     error;
-    FTC_MruNode  node;
+    FTC_MruNode  node = NULL;
     FT_Memory    memory = list->memory;
 
 
--- a/src/cff/cffdrivr.c
+++ b/src/cff/cffdrivr.c
@@ -328,7 +328,7 @@
     if ( cff && cff->font_info == NULL )
     {
       CFF_FontRecDict  dict   = &cff->top_font.font_dict;
-      PS_FontInfoRec  *font_info;
+      PS_FontInfoRec  *font_info = NULL;
       FT_Memory        memory = face->root.memory;
 
 
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -387,7 +387,7 @@
   {
     FT_Error   error     = CFF_Err_Ok;
     FT_Memory  memory    = idx->stream->memory;
-    FT_Byte**  t;
+    FT_Byte**  t = NULL;
     FT_Byte*   new_bytes = NULL;
 
 
@@ -1514,7 +1514,7 @@
     if ( dict->cid_registry != 0xFFFFU )
     {
       CFF_IndexRec  fd_index;
-      CFF_SubFont   sub;
+      CFF_SubFont   sub = NULL;
       FT_UInt       idx;
 
 
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -161,7 +161,7 @@
     {
       CFF_Face      face     = (CFF_Face)cffsize->face;
       CFF_Font      font     = (CFF_Font)face->extra.data;
-      CFF_Internal  internal;
+      CFF_Internal  internal = NULL;
 
       PS_PrivateRec  priv;
       FT_Memory      memory = cffsize->face->memory;
@@ -568,7 +568,7 @@
 
     /* now load and parse the CFF table in the file */
     {
-      CFF_Font         cff;
+      CFF_Font         cff = NULL;
       CFF_FontRecDict  dict;
       FT_Memory        memory = cffface->memory;
       FT_Int32         flags;
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -588,7 +588,7 @@
   {
     FT_Error     error;
     FT_Memory    memory = source->memory;
-    FT_GZipFile  zip;
+    FT_GZipFile  zip = NULL;
 
 
     /*
@@ -628,7 +628,7 @@
 
       if ( zip_size != 0 && zip_size < 40 * 1024 )
       {
-        FT_Byte*  zip_buff;
+        FT_Byte*  zip_buff = NULL;
 
 
         if ( !FT_ALLOC( zip_buff, zip_size ) )
--- a/src/lzw/ftlzw.c
+++ b/src/lzw/ftlzw.c
@@ -349,7 +349,7 @@
   {
     FT_Error    error;
     FT_Memory   memory = source->memory;
-    FT_LZWFile  zip;
+    FT_LZWFile  zip = NULL;
 
 
     /*
--- a/src/pcf/pcfread.c
+++ b/src/pcf/pcfread.c
@@ -399,7 +399,7 @@
                       PCF_Face   face )
   {
     PCF_ParseProperty  props      = 0;
-    PCF_Property       properties;
+    PCF_Property       properties = NULL;
     FT_ULong           nprops, i;
     FT_ULong           format, size;
     FT_Error           error;
@@ -663,9 +663,9 @@
   pcf_get_bitmaps( FT_Stream  stream,
                    PCF_Face   face )
   {
-    FT_Error   error  = PCF_Err_Ok;
-    FT_Memory  memory = FT_FACE(face)->memory;
-    FT_Long*   offsets;
+    FT_Error   error   = PCF_Err_Ok;
+    FT_Memory  memory  = FT_FACE(face)->memory;
+    FT_Long*   offsets = NULL;
     FT_Long    bitmapSizes[GLYPHPADOPTIONS];
     FT_ULong   format, size;
     FT_ULong   nbitmaps, i, sizebitmaps = 0;
@@ -772,7 +772,7 @@
     int           firstRow, lastRow;
     int           nencoding, encodingOffset;
     int           i, j;
-    PCF_Encoding  tmpEncoding, encoding = 0;
+    PCF_Encoding  tmpEncoding = NULL, encoding = 0;
 
 
     error = pcf_seek_to_table_type( stream,
--- a/src/pfr/pfrload.c
+++ b/src/pfr/pfrload.c
@@ -476,7 +476,7 @@
                                   PFR_PhyFont  phy_font )
   {
     FT_UInt    count, num_vert, num_horz;
-    FT_Int*    snaps;
+    FT_Int*    snaps  = NULL;
     FT_Error   error  = PFR_Err_Ok;
     FT_Memory  memory = phy_font->memory;
 
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -1213,7 +1213,7 @@
     FT_Memory  memory = stream->memory;
 
     FT_UInt        j,num_ranges;
-    TT_GaspRange   gaspranges;
+    TT_GaspRange   gaspranges = NULL;
 
 
     /* the gasp table is optional */
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -1343,7 +1343,7 @@
     /* All right, we have a compound format.  First of all, read */
     /* the array of elements.                                    */
     {
-      TT_SBit_Component  components;
+      TT_SBit_Component  components = NULL;
       TT_SBit_Component  comp;
       FT_UShort          num_components, count;
 
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -123,7 +123,7 @@
   ft_var_readpackedpoints( FT_Stream  stream,
                            FT_UInt   *point_cnt )
   {
-    FT_UShort *points;
+    FT_UShort *points = NULL;
     FT_Int     n;
     FT_Int     runcnt;
     FT_Int     i;
@@ -622,7 +622,7 @@
     FT_Error             error  = TT_Err_Ok;
     FT_ULong             fvar_start;
     FT_Int               i, j;
-    FT_MM_Var*           mmvar;
+    FT_MM_Var*           mmvar = NULL;
     FT_Fixed*            next_coords;
     FT_String*           next_name;
     FT_Var_Axis*         a;
@@ -1325,7 +1325,7 @@
     FT_Stream   stream = face->root.stream;
     FT_Memory   memory = stream->memory;
     GX_Blend    blend  = face->blend;
-    FT_Vector*  delta_xy;
+    FT_Vector*  delta_xy = NULL;
 
     FT_Error    error;
     FT_ULong    glyph_start;
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -303,7 +303,7 @@
                  FT_MM_Var*  *master )
   {
     FT_Memory        memory = face->root.memory;
-    FT_MM_Var       *mmvar;
+    FT_MM_Var       *mmvar = NULL;
     FT_Multi_Master  mmaster;
     FT_Error         error;
     FT_UInt          i;