[sdf] Fix compiler warnings.

* src/sdf/ftsdf.c (get_control_box): Use goto instead of letting the next case statement
  execute to avoid compiler warning [-Wimplicit-fallthrough=].

* src/sdf/ftsdf.c (sdf_generate_bounding_box): Fix compiler warning due to signed
  unsigned mismatch.

* src/sdf/ftsdfrend.c (ft_sdf_done): The function must have a return type of `void'
  to match the signature of `FT_Module_Destructor'.
This commit is contained in:
Anuj Verma 2020-08-24 09:40:46 +05:30
parent d2d939098d
commit 6218c942ad
2 changed files with 12 additions and 4 deletions

View File

@ -896,9 +896,15 @@
cbox.yMax = edge.control_b.y;
is_set = 1;
/* To avoid warning [-Wimplicit-fallthrough=] add */
/* a break statement but jump to next edge before. */
goto conic;
break;
}
case SDF_EDGE_CONIC:
{
conic:
if ( is_set )
{
cbox.xMin = edge.control_a.x < cbox.xMin ?
@ -920,9 +926,13 @@
is_set = 1;
}
goto line;
break;
}
case SDF_EDGE_LINE:
{
line:
if ( is_set )
{
cbox.xMin = edge.start_pos.x < cbox.xMin ?
@ -3184,7 +3194,7 @@
current_sign = dists[index].sign;
/* clamp the values */
if ( dists[index].distance > FT_INT_16D16( spread ) )
if ( dists[index].distance > (FT_Int)FT_INT_16D16( spread ) )
dists[index].distance = FT_INT_16D16( spread );
/* convert from 16.16 to 6.10 */

View File

@ -190,12 +190,10 @@
return FT_Err_Ok;
}
static FT_Error
static void
ft_sdf_done( FT_Renderer render )
{
FT_UNUSED( render );
return FT_Err_Ok;
}
/* generate signed distance field from a glyph's slot image */