From 328aa3b203fc061c207fb01e9cbabea7cb3c9272 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Mon, 27 Aug 2012 11:23:41 +0200 Subject: [PATCH] [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. --- ChangeLog | 23 +++++++++++++++++++++++ include/freetype/internal/ftdriver.h | 4 ++-- include/freetype/internal/ftobjs.h | 4 ++-- include/freetype/internal/ftserv.h | 12 ++++++------ src/autofit/afpic.c | 2 +- src/base/basepic.c | 2 +- src/base/ftinit.c | 4 ++-- src/cff/cffparse.c | 2 +- src/cff/cffpic.c | 4 ++-- src/pshinter/pshpic.c | 2 +- src/psnames/pspic.c | 2 +- src/raster/rastpic.c | 4 ++-- src/sfnt/sfntpic.c | 4 ++-- src/sfnt/ttcmap.c | 2 +- src/smooth/ftspic.c | 4 ++-- src/truetype/ttpic.c | 2 +- 16 files changed, 50 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 456abdfe0..bb715df44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2012-08-27 Werner Lemberg + + [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 [truetype] Fix compilation warning. diff --git a/include/freetype/internal/ftdriver.h b/include/freetype/internal/ftdriver.h index 8d396bea1..093b14b4f 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 a30e984e5..28132a4a1 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 12bef6f93..658b21509 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 a395faead..36a9cca99 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 912a80b23..5268e7c67 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 91f8e2a18..0d8b568be 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 3d5f8bfc7..10abcf071 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 1c19d58bc..fe4fa496f 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 914d1fea5..bf7f2009d 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 fe099a680..dc5374b0b 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 2883e3fde..853286309 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 a886b44b9..220998ecc 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 2fedef313..f1504d621 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 601bcf98a..4714828fc 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 47e0758e3..faece4e81 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;