Remove C++ warnings.

*/*: Initialize pointers where necessary to make g++ happy.
This commit is contained in:
Werner Lemberg 2010-07-12 21:13:22 +02:00
parent f4e6c155f0
commit c8f5b98be2
18 changed files with 49 additions and 41 deletions

View File

@ -1,3 +1,9 @@
2010-07-12 Werner Lemberg <wl@gnu.org>
Remove C++ warnings.
*/*: Initialize pointers where necessary to make g++ happy.
2010-07-12 malc <av1474@comtv.ru>
Fix type-punning issues with C++.

View File

@ -186,7 +186,7 @@
{
FT_Error error;
FT_Memory memory;
AF_FaceGlobals globals;
AF_FaceGlobals globals = NULL;
memory = face->memory;

View File

@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (body). */
/* */
/* Copyright 2002, 2003, 2004, 2005, 2006 by */
/* Copyright 2002, 2003, 2004, 2005, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -69,7 +69,7 @@
FT_GlyphLoader_New( FT_Memory memory,
FT_GlyphLoader *aloader )
{
FT_GlyphLoader loader;
FT_GlyphLoader loader = NULL;
FT_Error error;

View File

@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2007, 2008 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -282,7 +282,7 @@
{
FT_Memory memory = library->memory;
FT_Error error;
FT_Glyph glyph;
FT_Glyph glyph = NULL;
*aglyph = 0;

View File

@ -229,11 +229,11 @@
static FT_Error
ft_glyphslot_init( FT_GlyphSlot slot )
{
FT_Driver driver = slot->face->driver;
FT_Driver_Class clazz = driver->clazz;
FT_Memory memory = driver->root.memory;
FT_Error error = FT_Err_Ok;
FT_Slot_Internal internal;
FT_Driver driver = slot->face->driver;
FT_Driver_Class clazz = driver->clazz;
FT_Memory memory = driver->root.memory;
FT_Error error = FT_Err_Ok;
FT_Slot_Internal internal = NULL;
slot->library = driver->root.library;
@ -3723,7 +3723,7 @@
FT_Library library = module->library;
FT_Memory memory = library->memory;
FT_Error error;
FT_ListNode node;
FT_ListNode node = NULL;
if ( FT_NEW( node ) )

View File

@ -4,7 +4,7 @@
/* */
/* Embedded resource forks accessor (body). */
/* */
/* Copyright 2004, 2005, 2006, 2007, 2008, 2009 by */
/* Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010 by */
/* Masatake YAMATO and Redhat K.K. */
/* */
/* FT_Raccess_Get_HeaderInfo() and raccess_guess_darwin_hfsplus() are */
@ -751,7 +751,7 @@
const char *original_name,
const char *insertion )
{
char* new_name;
char* new_name = NULL;
const char* tmp;
const char* slash;
size_t new_length;

View File

@ -2289,7 +2289,7 @@
bdf_font_t* *font )
{
unsigned long lineno = 0; /* make compiler happy */
_bdf_parse_t *p;
_bdf_parse_t *p = NULL;
FT_Memory memory = extmemory;
FT_Error error = BDF_Err_Ok;

5
src/cache/ftccmap.c vendored
View File

@ -4,7 +4,8 @@
/* */
/* FreeType CharMap cache (body) */
/* */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -153,7 +154,7 @@
FTC_CMapQuery query = (FTC_CMapQuery)ftcquery;
FT_Error error;
FT_Memory memory = cache->memory;
FTC_CMapNode node;
FTC_CMapNode node = NULL;
FT_UInt nn;

View File

@ -4,7 +4,7 @@
/* */
/* FreeType Image cache (body). */
/* */
/* Copyright 2000-2001, 2003, 2004, 2006 by */
/* Copyright 2000-2001, 2003, 2004, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -61,7 +61,7 @@
{
FT_Memory memory = cache->memory;
FT_Error error;
FTC_INode inode;
FTC_INode inode = NULL;
if ( !FT_NEW( inode ) )

View File

@ -107,7 +107,7 @@
{
FT_ULong sz = (FT_ULong)size * items;
FT_Error error;
FT_Pointer p;
FT_Pointer p = NULL;
(void)FT_ALLOC( p, sz );

View File

@ -520,7 +520,7 @@
FT_Byte* limit,
PFR_PhyFont phy_font )
{
PFR_KernItem item;
PFR_KernItem item = NULL;
FT_Error error = PFR_Err_Ok;
FT_Memory memory = phy_font->memory;

View File

@ -4,7 +4,7 @@
/* */
/* AFM parser (body). */
/* */
/* Copyright 2006, 2007, 2008, 2009 by */
/* Copyright 2006, 2007, 2008, 2009, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -527,7 +527,7 @@
FT_Byte* base,
FT_Byte* limit )
{
AFM_Stream stream;
AFM_Stream stream = NULL;
FT_Error error;

View File

@ -5,7 +5,7 @@
/* PostScript hinter global hinting management (body). */
/* Inspired by the new auto-hinter module. */
/* */
/* Copyright 2001, 2002, 2003, 2004, 2006 by */
/* Copyright 2001, 2002, 2003, 2004, 2006, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used */
@ -624,7 +624,7 @@
T1_Private* priv,
PSH_Globals *aglobals )
{
PSH_Globals globals;
PSH_Globals globals = NULL;
FT_Error error;

View File

@ -3400,7 +3400,7 @@
}
#else /* _STANDALONE_ */
#else /* !_STANDALONE_ */
static int
@ -3408,7 +3408,7 @@
PRaster *araster )
{
FT_Error error;
PRaster raster;
PRaster raster = NULL;
*araster = 0;
@ -3432,7 +3432,7 @@
}
#endif /* _STANDALONE_ */
#endif /* !_STANDALONE_ */
static void

View File

@ -4,7 +4,7 @@
/* */
/* SFNT object management (base). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -50,9 +50,9 @@
tt_name_entry_ascii_from_utf16( TT_NameEntry entry,
FT_Memory memory )
{
FT_String* string;
FT_String* string = NULL;
FT_UInt len, code, n;
FT_Byte* read = (FT_Byte*)entry->string;
FT_Byte* read = (FT_Byte*)entry->string;
FT_Error error;
@ -81,9 +81,9 @@
tt_name_entry_ascii_from_other( TT_NameEntry entry,
FT_Memory memory )
{
FT_String* string;
FT_String* string = NULL;
FT_UInt len, code, n;
FT_Byte* read = (FT_Byte*)entry->string;
FT_Byte* read = (FT_Byte*)entry->string;
FT_Error error;

View File

@ -2004,14 +2004,14 @@ typedef ptrdiff_t FT_PtrDist;
FT_UNUSED( raster );
}
#else /* _STANDALONE_ */
#else /* !_STANDALONE_ */
static int
gray_raster_new( FT_Memory memory,
FT_Raster* araster )
{
FT_Error error;
PRaster raster;
PRaster raster = NULL;
*araster = 0;
@ -2034,7 +2034,7 @@ typedef ptrdiff_t FT_PtrDist;
FT_FREE( raster );
}
#endif /* _STANDALONE_ */
#endif /* !_STANDALONE_ */
static void

View File

@ -210,12 +210,12 @@
ft_var_readpackeddeltas( FT_Stream stream,
FT_Offset delta_cnt )
{
FT_Short *deltas;
FT_Short *deltas = NULL;
FT_UInt runcnt;
FT_Offset i;
FT_UInt j;
FT_Memory memory = stream->memory;
FT_Error error = TT_Err_Ok;
FT_Error error = TT_Err_Ok;
FT_UNUSED( error );

View File

@ -4,7 +4,8 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 by */
/* Copyright 1996-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, */
/* 2010 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@ -235,10 +236,10 @@
FT_Stream stream )
{
PSAux_Service psaux;
FT_Memory memory = stream->memory;
FT_Memory memory = stream->memory;
AFM_ParserRec parser;
AFM_FontInfo fi;
FT_Error error = T1_Err_Unknown_File_Format;
AFM_FontInfo fi = NULL;
FT_Error error = T1_Err_Unknown_File_Format;
T1_Font t1_font = &( (T1_Face)t1_face )->type1;