[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] GSoC-2020-anuj 6218c94: [sdf] Fix compiler warnings.
From: |
Anuj Verma |
Subject: |
[freetype2] GSoC-2020-anuj 6218c94: [sdf] Fix compiler warnings. |
Date: |
Mon, 24 Aug 2020 00:10:54 -0400 (EDT) |
branch: GSoC-2020-anuj
commit 6218c942adc7571bbaac11e6c1a04e19a49a23d8
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: Anuj Verma <anujv@iitbhilai.ac.in>
[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'.
---
src/sdf/ftsdf.c | 12 +++++++++++-
src/sdf/ftsdfrend.c | 4 +---
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/sdf/ftsdf.c b/src/sdf/ftsdf.c
index ddd5964..f206f03 100644
--- a/src/sdf/ftsdf.c
+++ b/src/sdf/ftsdf.c
@@ -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 */
diff --git a/src/sdf/ftsdfrend.c b/src/sdf/ftsdfrend.c
index d65d280..811f1d8 100644
--- a/src/sdf/ftsdfrend.c
+++ b/src/sdf/ftsdfrend.c
@@ -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 */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] GSoC-2020-anuj 6218c94: [sdf] Fix compiler warnings.,
Anuj Verma <=