forked from minhngoc25a/freetype2
[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:
parent
d2d939098d
commit
6218c942ad
|
@ -896,9 +896,15 @@
|
||||||
cbox.yMax = edge.control_b.y;
|
cbox.yMax = edge.control_b.y;
|
||||||
|
|
||||||
is_set = 1;
|
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:
|
case SDF_EDGE_CONIC:
|
||||||
{
|
{
|
||||||
|
conic:
|
||||||
if ( is_set )
|
if ( is_set )
|
||||||
{
|
{
|
||||||
cbox.xMin = edge.control_a.x < cbox.xMin ?
|
cbox.xMin = edge.control_a.x < cbox.xMin ?
|
||||||
|
@ -920,9 +926,13 @@
|
||||||
|
|
||||||
is_set = 1;
|
is_set = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
goto line;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
case SDF_EDGE_LINE:
|
case SDF_EDGE_LINE:
|
||||||
{
|
{
|
||||||
|
line:
|
||||||
if ( is_set )
|
if ( is_set )
|
||||||
{
|
{
|
||||||
cbox.xMin = edge.start_pos.x < cbox.xMin ?
|
cbox.xMin = edge.start_pos.x < cbox.xMin ?
|
||||||
|
@ -3184,7 +3194,7 @@
|
||||||
current_sign = dists[index].sign;
|
current_sign = dists[index].sign;
|
||||||
|
|
||||||
/* clamp the values */
|
/* 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 );
|
dists[index].distance = FT_INT_16D16( spread );
|
||||||
|
|
||||||
/* convert from 16.16 to 6.10 */
|
/* convert from 16.16 to 6.10 */
|
||||||
|
|
|
@ -190,12 +190,10 @@
|
||||||
return FT_Err_Ok;
|
return FT_Err_Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static FT_Error
|
static void
|
||||||
ft_sdf_done( FT_Renderer render )
|
ft_sdf_done( FT_Renderer render )
|
||||||
{
|
{
|
||||||
FT_UNUSED( render );
|
FT_UNUSED( render );
|
||||||
|
|
||||||
return FT_Err_Ok;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* generate signed distance field from a glyph's slot image */
|
/* generate signed distance field from a glyph's slot image */
|
||||||
|
|
Loading…
Reference in New Issue