Commit 328aa3b203fc061c207fb01e9cbabea7cb3c9272

Werner Lemberg 2012-08-27T11:23:41

[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings. * include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER), include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER, FT_DEFINE_MODULE), include/freetype/internal/ftserv.h (FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2, FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4, FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6), src/autofit/afpic.c (autofit_module_class_pic_init), src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c (ft_create_default_module_classes), src/cff/cffparse.c (FT_Create_Class_cff_field_handlers), src/cff/cffpic.c (cff_driver_class_pic_init), src/pshinter/pshpic.c (pshinter_module_class_pic_init), src/psnames/pspic.c (psnames_module_class_pic_init), src/raster/rastpic.c (ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c (sfnt_module_class_pic_init), src/sfnt/ttcmap.c (FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c (ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c (tt_driver_class_pic_init): Initialize allocation variable.

diff --git a/ChangeLog b/ChangeLog
index 456abdf..bb715df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,28 @@
 2012-08-27  Werner Lemberg  <wl@gnu.org>
 
+	[FT_CONFIG_OPTION_PIC] Fix g++ 4.6.2 compiler warnings.
+
+	* include/freetype/internal/ftdriver.h (FT_DEFINE_DRIVER),
+	include/freetype/internal/ftobjs.h (FT_DEFINE_RENDERER,
+	FT_DEFINE_MODULE), include/freetype/internal/ftserv.h
+	(FT_DEFINE_SERVICEDESCREC1, FT_DEFINE_SERVICEDESCREC2,
+	FT_DEFINE_SERVICEDESCREC3, FT_DEFINE_SERVICEDESCREC4,
+	FT_DEFINE_SERVICEDESCREC5, FT_DEFINE_SERVICEDESCREC6),
+	src/autofit/afpic.c (autofit_module_class_pic_init),
+	src/base/basepic.c (ft_base_pic_init), src/base/ftinit.c
+	(ft_create_default_module_classes), src/cff/cffparse.c
+	(FT_Create_Class_cff_field_handlers), src/cff/cffpic.c
+	(cff_driver_class_pic_init), src/pshinter/pshpic.c
+	(pshinter_module_class_pic_init), src/psnames/pspic.c
+	(psnames_module_class_pic_init), src/raster/rastpic.c
+	(ft_raster1_renderer_class_pic_init), src/sfnt/sfntpic.c
+	(sfnt_module_class_pic_init), src/sfnt/ttcmap.c
+	(FT_Create_Class_tt_cmap_classes), src/smooth/ftspic.c
+	(ft_smooth_renderer_class_pic_init), src/truetype/ttpic.c
+	(tt_driver_class_pic_init): Initialize allocation variable.
+
+2012-08-27  Werner Lemberg  <wl@gnu.org>
+
 	[truetype] Fix compilation warning.
 
 	* src/truetype/ttgload.c (IS_HINTED): Move macro to...
diff --git a/include/freetype/internal/ftdriver.h b/include/freetype/internal/ftdriver.h
index 8d396be..093b14b 100644
--- a/include/freetype/internal/ftdriver.h
+++ b/include/freetype/internal/ftdriver.h
@@ -415,7 +415,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library         library,        \
                               FT_Module_Class**  output_class )  \
   {                                                              \
-    FT_Driver_Class  clazz;                                      \
+    FT_Driver_Class  clazz  = NULL;                              \
     FT_Error         error;                                      \
     FT_Memory        memory = library->memory;                   \
                                                                  \
@@ -438,7 +438,7 @@ FT_BEGIN_HEADER
                            interface_,                           \
                            init_,                                \
                            done_,                                \
-                           get_interface_)                       \
+                           get_interface_ )                      \
                                                                  \
     clazz->face_object_size = face_object_size_;                 \
     clazz->size_object_size = size_object_size_;                 \
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index a30e984..28132a4 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -1282,7 +1282,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library         library,        \
                               FT_Module_Class**  output_class )  \
   {                                                              \
-    FT_Renderer_Class*  clazz;                                   \
+    FT_Renderer_Class*  clazz = NULL;                            \
     FT_Error            error;                                   \
     FT_Memory           memory = library->memory;                \
                                                                  \
@@ -1532,7 +1532,7 @@ FT_BEGIN_HEADER
                               FT_Module_Class**  output_class )  \
   {                                                              \
     FT_Memory         memory = library->memory;                  \
-    FT_Module_Class*  clazz;                                     \
+    FT_Module_Class*  clazz  = NULL;                             \
     FT_Error          error;                                     \
                                                                  \
                                                                  \
diff --git a/include/freetype/internal/ftserv.h b/include/freetype/internal/ftserv.h
index 12bef6f..658b215 100644
--- a/include/freetype/internal/ftserv.h
+++ b/include/freetype/internal/ftserv.h
@@ -288,7 +288,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -324,7 +324,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -363,7 +363,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -405,7 +405,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -450,7 +450,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class )           \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
@@ -498,7 +498,7 @@ FT_BEGIN_HEADER
   FT_Create_Class_ ## class_( FT_Library           library,                 \
                               FT_ServiceDescRec**  output_class)            \
   {                                                                         \
-    FT_ServiceDescRec*  clazz;                                              \
+    FT_ServiceDescRec*  clazz  = NULL;                                      \
     FT_Error            error;                                              \
     FT_Memory           memory = library->memory;                           \
                                                                             \
diff --git a/src/autofit/afpic.c b/src/autofit/afpic.c
index a395fae..36a9cca 100644
--- a/src/autofit/afpic.c
+++ b/src/autofit/afpic.c
@@ -61,7 +61,7 @@
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_UInt            ss;
     FT_Error           error         = AF_Err_Ok;
-    AFModulePIC*       container;
+    AFModulePIC*       container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
diff --git a/src/base/basepic.c b/src/base/basepic.c
index 912a80b..5268e7c 100644
--- a/src/base/basepic.c
+++ b/src/base/basepic.c
@@ -70,7 +70,7 @@
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_Error           error         = FT_Err_Ok;
-    BasePIC*           container;
+    BasePIC*           container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
diff --git a/src/base/ftinit.c b/src/base/ftinit.c
index 91f8e2a..0d8b568 100644
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType initialization layer (body).                                */
 /*                                                                         */
-/*  Copyright 1996-2001, 2002, 2005, 2007, 2009, 2012 by                   */
+/*  Copyright 1996-2002, 2005, 2007, 2009, 2012 by                         */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -156,7 +156,7 @@
   {
     FT_Error           error;
     FT_Memory          memory;
-    FT_Module_Class*  *classes;
+    FT_Module_Class*  *classes = NULL;
     FT_Module_Class*   clazz;
     FT_UInt            i;
     BasePIC*           pic_container = (BasePIC*)library->pic_container.base;
diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c
index 3d5f8bf..10abcf0 100644
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -735,7 +735,7 @@
   FT_Create_Class_cff_field_handlers( FT_Library           library,
                                       CFF_Field_Handler**  output_class )
   {
-    CFF_Field_Handler*  clazz;
+    CFF_Field_Handler*  clazz  = NULL;
     FT_Error            error;
     FT_Memory           memory = library->memory;
 
diff --git a/src/cff/cffpic.c b/src/cff/cffpic.c
index 1c19d58..fe4fa49 100644
--- a/src/cff/cffpic.c
+++ b/src/cff/cffpic.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for cff module.      */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012 by                                          */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -103,7 +103,7 @@
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_Error           error         = CFF_Err_Ok;
-    CffModulePIC*      container;
+    CffModulePIC*      container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
diff --git a/src/pshinter/pshpic.c b/src/pshinter/pshpic.c
index 914d1fe..bf7f200 100644
--- a/src/pshinter/pshpic.c
+++ b/src/pshinter/pshpic.c
@@ -50,7 +50,7 @@
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_Error           error         = PSH_Err_Ok;
-    PSHinterPIC*       container;
+    PSHinterPIC*       container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
diff --git a/src/psnames/pspic.c b/src/psnames/pspic.c
index fe099a6..dc5374b 100644
--- a/src/psnames/pspic.c
+++ b/src/psnames/pspic.c
@@ -65,7 +65,7 @@
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_Error           error         = PSnames_Err_Ok;
-    PSModulePIC*       container;
+    PSModulePIC*       container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
diff --git a/src/raster/rastpic.c b/src/raster/rastpic.c
index 2883e3f..8532863 100644
--- a/src/raster/rastpic.c
+++ b/src/raster/rastpic.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for raster module.   */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012 by                                          */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -51,7 +51,7 @@
   {
     FT_PIC_Container* pic_container = &library->pic_container;
     FT_Error          error         = Raster_Err_Ok;
-    RasterPIC*        container;
+    RasterPIC*        container     = NULL;
     FT_Memory         memory        = library->memory;
 
 
diff --git a/src/sfnt/sfntpic.c b/src/sfnt/sfntpic.c
index a886b44..220998e 100644
--- a/src/sfnt/sfntpic.c
+++ b/src/sfnt/sfntpic.c
@@ -28,7 +28,7 @@
   /* forward declaration of PIC init functions from sfdriver.c */
   FT_Error
   FT_Create_Class_sfnt_services( FT_Library           library,
-                                 FT_ServiceDescRec**  ouput_class );
+                                 FT_ServiceDescRec**  output_class );
 
   void
   FT_Destroy_Class_sfnt_services( FT_Library          library,
@@ -103,7 +103,7 @@
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_Error           error         = SFNT_Err_Ok;
-    sfntModulePIC*     container;
+    sfntModulePIC*     container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 2fedef3..f1504d6 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -3388,7 +3388,7 @@
   FT_Create_Class_tt_cmap_classes( FT_Library       library,
                                    TT_CMap_Class**  output_class )
   {
-    TT_CMap_Class*     clazz;
+    TT_CMap_Class*     clazz  = NULL;
     TT_CMap_ClassRec*  recs;
     FT_Error           error;
     FT_Memory          memory = library->memory;
diff --git a/src/smooth/ftspic.c b/src/smooth/ftspic.c
index 601bcf9..4714828 100644
--- a/src/smooth/ftspic.c
+++ b/src/smooth/ftspic.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    The FreeType position independent code services for smooth module.   */
 /*                                                                         */
-/*  Copyright 2009, 2010 by                                                */
+/*  Copyright 2009, 2010, 2012 by                                          */
 /*  Oran Agra and Mickey Gabel.                                            */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -53,7 +53,7 @@
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_Error           error         = Smooth_Err_Ok;
-    SmoothPIC*         container;
+    SmoothPIC*         container     = NULL;
     FT_Memory          memory        = library->memory;
 
 
diff --git a/src/truetype/ttpic.c b/src/truetype/ttpic.c
index 47e0758..faece4e 100644
--- a/src/truetype/ttpic.c
+++ b/src/truetype/ttpic.c
@@ -68,7 +68,7 @@
   {
     FT_PIC_Container*  pic_container = &library->pic_container;
     FT_Error           error         = TT_Err_Ok;
-    TTModulePIC*       container;
+    TTModulePIC*       container     = NULL;
     FT_Memory          memory        = library->memory;