ref: 87989a1435c0b6a2848d502627ecaca9d3cfc3a1
parent: 97cdbb24f7a71b83aeb5a8606d5a86d59c0e1b92
author: Werner Lemberg <wl@gnu.org>
date: Thu Mar 31 03:43:41 EDT 2022
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.
--- 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 ) )
--- 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 ) )
--- 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;
--- 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 ) )
--- 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 )
--- 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 )
--- 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;
--- 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;
--- 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;
/*