From e62c876bb0b86b8fa88fadf72d2621c79796a304 Mon Sep 17 00:00:00 2001 From: suzuki toshiya Date: Wed, 15 Jun 2011 02:48:33 +0900 Subject: [PATCH] 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'. --- ChangeLog | 29 +++++++++++++++++++++++++++++ src/bzip2/ftbzip2.c | 2 +- src/cache/ftcmru.c | 2 +- src/cff/cffdrivr.c | 2 +- src/cff/cffload.c | 4 ++-- src/cff/cffobjs.c | 4 ++-- src/gzip/ftgzip.c | 4 ++-- src/lzw/ftlzw.c | 2 +- src/pcf/pcfread.c | 10 +++++----- src/pfr/pfrload.c | 2 +- src/sfnt/ttload.c | 2 +- src/sfnt/ttsbit.c | 2 +- src/truetype/ttgxvar.c | 6 +++--- src/type1/t1load.c | 2 +- 14 files changed, 51 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7a294bfd..11801cbcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2011-06-14 suzuki toshiya + + 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 [base] Fix g++4.6 compiler warnings in src/base/*.c. diff --git a/src/bzip2/ftbzip2.c b/src/bzip2/ftbzip2.c index 1daffb77c..e443dc85e 100644 --- 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; /* diff --git a/src/cache/ftcmru.c b/src/cache/ftcmru.c index 9944b5898..5b1134652 100644 --- 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; diff --git a/src/cff/cffdrivr.c b/src/cff/cffdrivr.c index 39f04ee1b..4fd3436cc 100644 --- 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; diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 000cbe3ac..98d8e1c8d 100644 --- 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; diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index fdb58a496..cd386762d 100644 --- 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; diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c index 8d9097934..52966ece7 100644 --- 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 ) ) diff --git a/src/lzw/ftlzw.c b/src/lzw/ftlzw.c index 0b798fe54..7f254999a 100644 --- 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; /* diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c index f7326238c..f8c2a239b 100644 --- a/src/pcf/pcfread.c +++ b/src/pcf/pcfread.c @@ -399,7 +399,7 @@ THE SOFTWARE. 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 @@ THE SOFTWARE. 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 @@ THE SOFTWARE. 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, diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c index e919fa5b9..325322e98 100644 --- 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; diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index 20bac73d2..5fb9aea4e 100644 --- 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 */ diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index faa8f88fd..283ba7ef7 100644 --- 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; diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index 47bb9fcca..37bbe6d2e 100644 --- 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; diff --git a/src/type1/t1load.c b/src/type1/t1load.c index c9b6c1d0a..09fe6adf5 100644 --- 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;