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`.
This commit is contained in:
Werner Lemberg 2021-03-13 19:08:09 +01:00
parent 80bda804d5
commit 2149b51f25
6 changed files with 29 additions and 8 deletions

View File

@ -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.

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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 );

View File

@ -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;