Fix clang++ warnings. * src/base/ftglyph.c (ft_svg_glyph_prepare), src/base/ftobj.c (ft_glyphslot_init), src/cache/ftccmap.c (ftc_cmap_node_new), src/cache/ftcimage.c (FTC_INode_New), src/lzw/ftlzw.c (FT_Stream_OpenLZW), src/psaux/psobjs.c (ps_parser_load_field), src/pshinter/pshglob.c (psh_globals_new), src/sfnt/ttsvg.c (tt_face_load_svg_doc): Initialize variables used for allocation. * src/sdf/ftsdf.c (split_sdf_conic, split_sdf_cubic): Change type of `max_splits` to FT_UInt. (sdf_generate_bounding_box): Add cast.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 0c33412..571dca1 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -469,7 +469,7 @@
FT_Error error = FT_Err_Ok;
FT_Memory memory = svg_glyph->library->memory;
- FT_SVG_Document document;
+ FT_SVG_Document document = NULL;
if ( FT_NEW( document ) )
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 282c912..eeda69c 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -334,7 +334,7 @@
/* if SVG table exists, allocate the space in `slot->other` */
if ( slot->face->face_flags & FT_FACE_FLAG_SVG )
{
- FT_SVG_Document document;
+ FT_SVG_Document document = NULL;
if ( FT_NEW( document ) )
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index 5ee6877..0ee1834 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -112,7 +112,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;
diff --git a/src/cache/ftcimage.c b/src/cache/ftcimage.c
index cd43f75..39ce61a 100644
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -61,7 +61,7 @@
{
FT_Memory memory = cache->memory;
FT_Error error;
- FTC_INode inode;
+ FTC_INode inode = NULL;
if ( !FT_QNEW( inode ) )
diff --git a/src/lzw/ftlzw.c b/src/lzw/ftlzw.c
index b668a50..e12efca 100644
--- a/src/lzw/ftlzw.c
+++ b/src/lzw/ftlzw.c
@@ -344,7 +344,7 @@
{
FT_Error error;
FT_Memory memory;
- FT_LZWFile zip;
+ FT_LZWFile zip = NULL;
if ( !stream || !source )
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 5929e6c..6ab5038 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -1115,7 +1115,7 @@
{
FT_Memory memory = parser->memory;
FT_UInt len = (FT_UInt)( limit - cur );
- FT_String* string;
+ FT_String* string = NULL;
if ( cur >= limit )
diff --git a/src/pshinter/pshglob.c b/src/pshinter/pshglob.c
index 3eaf9b3..887ea8d 100644
--- a/src/pshinter/pshglob.c
+++ b/src/pshinter/pshglob.c
@@ -646,7 +646,7 @@
T1_Private* priv,
PSH_Globals *aglobals )
{
- PSH_Globals globals;
+ PSH_Globals globals = NULL;
FT_Error error;
diff --git a/src/sdf/ftsdf.c b/src/sdf/ftsdf.c
index 891ef18..f0e4541 100644
--- a/src/sdf/ftsdf.c
+++ b/src/sdf/ftsdf.c
@@ -1077,7 +1077,7 @@
static FT_Error
split_sdf_conic( FT_Memory memory,
FT_26D6_Vec* control_points,
- FT_Int max_splits,
+ FT_UInt max_splits,
SDF_Edge** out )
{
FT_Error error = FT_Err_Ok;
@@ -1146,7 +1146,7 @@
static FT_Error
split_sdf_cubic( FT_Memory memory,
FT_26D6_Vec* control_points,
- FT_Int max_splits,
+ FT_UInt max_splits,
SDF_Edge** out )
{
FT_Error error = FT_Err_Ok;
@@ -3288,7 +3288,7 @@
buffer = (FT_SDFFormat*)bitmap->buffer;
if ( USE_SQUARED_DISTANCES )
- sp_sq = FT_INT_16D16( spread * spread );
+ sp_sq = FT_INT_16D16( (FT_Int)( spread * spread ) );
else
sp_sq = fixed_spread;
diff --git a/src/sfnt/ttsvg.c b/src/sfnt/ttsvg.c
index cb70ee8..69277da 100644
--- a/src/sfnt/ttsvg.c
+++ b/src/sfnt/ttsvg.c
@@ -319,7 +319,7 @@
#ifdef FT_CONFIG_OPTION_USE_ZLIB
FT_ULong uncomp_size;
- FT_Byte* uncomp_buffer;
+ FT_Byte* uncomp_buffer = NULL;
/*