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`.
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
diff --git a/ChangeLog b/ChangeLog
index ef2a65d..d4a748c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2021-03-13 Werner Lemberg <wl@gnu.org>
+
+ 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 <apodtele@gmail.com>
[smooth] Reduce copying during integration phase.
diff --git a/src/base/ftstroke.c b/src/base/ftstroke.c
index dc64b1d..37e9649 100644
--- 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;
diff --git a/src/sdf/ftsdf.c b/src/sdf/ftsdf.c
index acaf283..b80b1cb 100644
--- 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;
diff --git a/src/sdf/ftsdfrend.c b/src/sdf/ftsdfrend.c
index 6ea9065..3226bdc 100644
--- 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;
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index edf173d..2edb15f 100644
--- 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 );
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 7a4f33f..ad87746 100644
--- 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;