shithub: freetype+ttf2subf

Download patch

ref: 2149b51f2543719b1ee78fb50ecf4e6e80f84ad7
parent: 80bda804d53e3f0df0ea20c639adc0e479c4ed47
author: Werner Lemberg <[email protected]>
date: Sat Mar 13 14:08:09 EST 2021

Handle various VC++ compiler warnings.

Fixes #1039.

* src/base/ftstroke.c (ft_stroker_inside, ft_stroker_outside):
Initialize `sigma`.

* src/sdf/ftsdf.c (sdf_generate_with_overlaps): Exit immediately if
function arguments are invalid.
* src/sdf/ftsdfrend.c (sdf_property_set) <"overlaps">: Fix cast.

* src/sfnt/sfwoff2.c (woff2_decompress)
[!FT_CONFIG_OPTION_USE_BROTLI]: Use `FT_UNUSED`.

* src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize `fvar_head`.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2021-03-13  Werner Lemberg  <[email protected]>
+
+	Handle various VC++ compiler warnings.
+
+	Fixes #1039.
+
+	* src/base/ftstroke.c (ft_stroker_inside, ft_stroker_outside):
+	Initialize `sigma`.
+
+	* src/sdf/ftsdf.c (sdf_generate_with_overlaps): Exit immediately if
+	function arguments are invalid.
+	* src/sdf/ftsdfrend.c (sdf_property_set) <"overlaps">: Fix cast.
+
+	* src/sfnt/sfwoff2.c (woff2_decompress)
+	[!FT_CONFIG_OPTION_USE_BROTLI]: Use `FT_UNUSED`.
+
+	* src/truetype/ttgxvar.c (TT_Get_MM_Var): Initialize `fvar_head`.
+
 2021-03-11  Alexei Podtelezhnikov  <[email protected]>
 
 	[smooth] Reduce copying during integration phase.
--- a/src/base/ftstroke.c
+++ b/src/base/ftstroke.c
@@ -974,7 +974,8 @@
     FT_StrokeBorder  border = stroker->borders + side;
     FT_Angle         phi, theta, rotate;
     FT_Fixed         length;
-    FT_Vector        sigma, delta;
+    FT_Vector        sigma = { 0, 0 };
+    FT_Vector        delta;
     FT_Error         error = FT_Err_Ok;
     FT_Bool          intersect;          /* use intersection of lines? */
 
@@ -1048,7 +1049,7 @@
     {
       /* this is a mitered (pointed) or beveled (truncated) corner */
       FT_Fixed   radius = stroker->radius;
-      FT_Vector  sigma;
+      FT_Vector  sigma = { 0, 0 };
       FT_Angle   theta = 0, phi = 0;
       FT_Bool    bevel, fixed_bevel;
 
--- a/src/sdf/ftsdf.c
+++ b/src/sdf/ftsdf.c
@@ -3510,10 +3510,7 @@
     head         = NULL;
 
     if ( !shape || !bitmap || !shape->memory )
-    {
-      error = FT_THROW( Invalid_Argument );
-      goto Exit;
-    }
+      return FT_THROW( Invalid_Argument );
 
     contour           = shape->contours;
     memory            = shape->memory;
--- a/src/sdf/ftsdfrend.c
+++ b/src/sdf/ftsdfrend.c
@@ -110,7 +110,7 @@
 
     else if ( ft_strcmp( property_name, "overlaps" ) == 0 )
     {
-      FT_Int  val = *(const FT_Int*)value;
+      FT_Bool  val = *(const FT_Bool*)value;
 
 
       render->overlaps = val;
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -341,6 +341,11 @@
 
 #else /* !FT_CONFIG_OPTION_USE_BROTLI */
 
+    FT_UNUSED( dst );
+    FT_UNUSED( dst_size );
+    FT_UNUSED( src );
+    FT_UNUSED( src_size );
+
     FT_ERROR(( "woff2_decompress: Brotli support not available.\n" ));
     return FT_THROW( Unimplemented_Feature );
 
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -2060,7 +2060,7 @@
     FT_Var_Axis*         a;
     FT_Fixed*            c;
     FT_Var_Named_Style*  ns;
-    GX_FVar_Head         fvar_head;
+    GX_FVar_Head         fvar_head  = { 0, 0, 0, 0, 0, 0 };
     FT_Bool              usePsName  = 0;
     FT_UInt              num_instances;
     FT_UInt              num_axes;