Commit da9eb9c719bb128cb2e13c7cc9a7ded4abce448d

Werner Lemberg 2023-02-07T07:01:36

Fix minor clang and clang++ warnings.

diff --git a/src/sdf/ftbsdf.c b/src/sdf/ftbsdf.c
index 85bd514..901d8b7 100644
--- a/src/sdf/ftbsdf.c
+++ b/src/sdf/ftbsdf.c
@@ -1116,13 +1116,13 @@
       goto Exit;
     }
 
-    spread = FT_INT_16D16( worker->params.spread );
+    spread = (FT_16D16)FT_INT_16D16( worker->params.spread );
 
 #if USE_SQUARED_DISTANCES
-    sp_sq = FT_INT_16D16( worker->params.spread *
-                          worker->params.spread );
+    sp_sq = (FT_16D16)FT_INT_16D16( worker->params.spread *
+                                    worker->params.spread );
 #else
-    sp_sq = FT_INT_16D16( worker->params.spread );
+    sp_sq = (FT_16D16)FT_INT_16D16( worker->params.spread );
 #endif
 
     for ( j = 0; j < r; j++ )
diff --git a/src/sdf/ftsdf.c b/src/sdf/ftsdf.c
index 28decc8..5faa743 100644
--- a/src/sdf/ftsdf.c
+++ b/src/sdf/ftsdf.c
@@ -3258,7 +3258,7 @@
     /* and also determine the signs properly.             */
     SDF_Signed_Distance*  dists = NULL;
 
-    const FT_16D16  fixed_spread = FT_INT_16D16( spread );
+    const FT_16D16  fixed_spread = (FT_16D16)FT_INT_16D16( spread );
 
 
     if ( !shape || !bitmap )
diff --git a/src/sfnt/pngshim.c b/src/sfnt/pngshim.c
index aca11f3..2aeba35 100644
--- a/src/sfnt/pngshim.c
+++ b/src/sfnt/pngshim.c
@@ -239,7 +239,7 @@
       *e = FT_THROW( Invalid_Stream_Read );
       png_error( png, NULL );
 
-      return;
+      /* return; (never reached) */
     }
 
     ft_memcpy( data, stream->cursor, length );
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 55861c5..0478c32 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -1005,7 +1005,7 @@
     FT_ItemVarDelta*  deltaSet;
 
     FT_UInt          master, j;
-    FT_Fixed*        scalars;
+    FT_Fixed*        scalars = NULL;
     FT_ItemVarDelta  returnValue;
 
 
@@ -1983,7 +1983,7 @@
     FT_Var_Axis*    a;
     GX_AVarSegment  av;
 
-    FT_Fixed*  new_normalized;
+    FT_Fixed*  new_normalized = NULL;
     FT_Fixed*  old_normalized;