summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnuj Verma <anujv@iitbhilai.ac.in>2020-08-14 09:14:15 +0530
committerAnuj Verma <anujv@iitbhilai.ac.in>2020-08-14 09:14:15 +0530
commit0db5ba974dcc62a82739df8f0257b4bcc93d6a19 (patch)
tree3e631751a69047fe1d50017008af061358fa263a
parente0a2a76b09a366bb99a5242c8b476fa47e8e6dfd (diff)
downloadfreetype2-0db5ba974dcc62a82739df8f0257b4bcc93d6a19.tar.gz
[sdf] Fix gcc compiler warnings.
* src/sdf/ftsdf.c, src/sdf/ftbsdf.c (*): Fix various compiler warnings, which were caused mainly due to unused variables and unused functions.
-rw-r--r--[GSoC]ChangeLog8
-rw-r--r--src/sdf/ftbsdf.c26
-rw-r--r--src/sdf/ftsdf.c15
3 files changed, 28 insertions, 21 deletions
diff --git a/[GSoC]ChangeLog b/[GSoC]ChangeLog
index 5264adb47..2caa60386 100644
--- a/[GSoC]ChangeLog
+++ b/[GSoC]ChangeLog
@@ -1,5 +1,13 @@
2020-08-13 Anuj Verma <anujv@iitbhilai.ac.in>
+ [sdf] Fix gcc compiler warnings.
+
+ * src/sdf/ftsdf.c, src/sdf/ftbsdf.c (*): Fix
+ various compiler warnings, which were caused
+ mainly due to unused variables and unused functions.
+
+2020-08-13 Anuj Verma <anujv@iitbhilai.ac.in>
+
[sdf] Bug fix.
* src/sdf/ftsdf.c (sdf_generate_with_overlaps): The
diff --git a/src/sdf/ftbsdf.c b/src/sdf/ftbsdf.c
index 48d1f3d3c..e8f39fb19 100644
--- a/src/sdf/ftbsdf.c
+++ b/src/sdf/ftbsdf.c
@@ -508,10 +508,8 @@
BSDF_Worker* worker )
{
FT_Error error = FT_Err_Ok;
- FT_Bool is_monochrome = 0;
FT_Int x_diff, y_diff;
- FT_Int num_channels;
FT_Int t_i, t_j, s_i, s_j;
FT_Byte* s;
ED* t;
@@ -782,9 +780,6 @@
for ( j = 1; j < r; j++ )
{
FT_Int index;
- FT_16D16 dist;
- FT_16D16_Vec dist_vec;
- ED* to_check;
ED* current;
@@ -859,9 +854,6 @@
for ( j = r - 2; j >= 0; j-- )
{
FT_Int index;
- FT_16D16 dist;
- FT_16D16_Vec dist_vec;
- ED* to_check;
ED* current;
@@ -963,8 +955,8 @@
*
*/
static FT_Error
- finalize_sdf( BSDF_Worker* worker,
- FT_Bitmap* target )
+ finalize_sdf( BSDF_Worker* worker,
+ const FT_Bitmap* target )
{
FT_Error error = FT_Err_Ok;
FT_Int w, r;
@@ -1092,17 +1084,17 @@
bsdf_raster_render( FT_Raster raster,
const FT_Raster_Params* params )
{
- FT_Error error = FT_Err_Ok;
- FT_Bitmap* source = NULL;
- FT_Bitmap* target = NULL;
- FT_Memory memory = NULL;
- BSDF_TRaster* bsdf_raster = (BSDF_TRaster*)raster;
- BSDF_Worker worker;
+ FT_Error error = FT_Err_Ok;
+ const FT_Bitmap* source = NULL;
+ const FT_Bitmap* target = NULL;
+ FT_Memory memory = NULL;
+ BSDF_TRaster* bsdf_raster = (BSDF_TRaster*)raster;
+ BSDF_Worker worker;
const SDF_Raster_Params* sdf_params = (const SDF_Raster_Params*)params;
- FT_UNUSED( raster );
+ worker.distance_map = NULL;
/* check for valid parameters */
if ( !raster || !params )
diff --git a/src/sdf/ftsdf.c b/src/sdf/ftsdf.c
index 6d7749335..8404a9cbf 100644
--- a/src/sdf/ftsdf.c
+++ b/src/sdf/ftsdf.c
@@ -2658,6 +2658,9 @@
return error;
}
+ /* `sdf_generate' is not used at the moment */
+ #if 0
+
/**************************************************************************
*
* @Function:
@@ -2891,6 +2894,8 @@
return error;
}
+ #endif
+
/**************************************************************************
*
* @Function:
@@ -3059,10 +3064,7 @@
else if ( dists[index].distance > dist.distance )
dists[index] = dist;
else if ( FT_ABS(dists[index].distance - dist.distance ) < CORNER_CHECK_EPSILON )
- {
- if ( FT_ABS( dists[index].cross ) < FT_ABS( dist.cross ) )
- dists[index] = dist;
- }
+ dists[index] = resolve_corner( dists[index], dist );
}
}
@@ -3675,6 +3677,9 @@
FT_Int line = __LINE__;
+ /* in non debugging mode this is not used */
+ FT_UNUSED( line );
+
*araster = 0;
if ( !FT_ALLOC( raster, sizeof( SDF_TRaster ) ) )
{
@@ -3819,6 +3824,8 @@
FT_Memory memory = (FT_Memory)((SDF_TRaster*)raster)->memory;
FT_Int line = __LINE__;
+ /* in non debugging mode this is not used */
+ FT_UNUSED( line );
FT_FREE( raster );
}