[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.
This commit is contained in:
Anuj Verma 2020-08-14 09:14:15 +05:30
parent e0a2a76b09
commit 0db5ba974d
3 changed files with 28 additions and 21 deletions

View File

@ -1,3 +1,11 @@
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> 2020-08-13 Anuj Verma <anujv@iitbhilai.ac.in>
[sdf] Bug fix. [sdf] Bug fix.

View File

@ -508,10 +508,8 @@
BSDF_Worker* worker ) BSDF_Worker* worker )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = FT_Err_Ok;
FT_Bool is_monochrome = 0;
FT_Int x_diff, y_diff; FT_Int x_diff, y_diff;
FT_Int num_channels;
FT_Int t_i, t_j, s_i, s_j; FT_Int t_i, t_j, s_i, s_j;
FT_Byte* s; FT_Byte* s;
ED* t; ED* t;
@ -782,9 +780,6 @@
for ( j = 1; j < r; j++ ) for ( j = 1; j < r; j++ )
{ {
FT_Int index; FT_Int index;
FT_16D16 dist;
FT_16D16_Vec dist_vec;
ED* to_check;
ED* current; ED* current;
@ -859,9 +854,6 @@
for ( j = r - 2; j >= 0; j-- ) for ( j = r - 2; j >= 0; j-- )
{ {
FT_Int index; FT_Int index;
FT_16D16 dist;
FT_16D16_Vec dist_vec;
ED* to_check;
ED* current; ED* current;
@ -963,8 +955,8 @@
* *
*/ */
static FT_Error static FT_Error
finalize_sdf( BSDF_Worker* worker, finalize_sdf( BSDF_Worker* worker,
FT_Bitmap* target ) const FT_Bitmap* target )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = FT_Err_Ok;
FT_Int w, r; FT_Int w, r;
@ -1092,17 +1084,17 @@
bsdf_raster_render( FT_Raster raster, bsdf_raster_render( FT_Raster raster,
const FT_Raster_Params* params ) const FT_Raster_Params* params )
{ {
FT_Error error = FT_Err_Ok; FT_Error error = FT_Err_Ok;
FT_Bitmap* source = NULL; const FT_Bitmap* source = NULL;
FT_Bitmap* target = NULL; const FT_Bitmap* target = NULL;
FT_Memory memory = NULL; FT_Memory memory = NULL;
BSDF_TRaster* bsdf_raster = (BSDF_TRaster*)raster; BSDF_TRaster* bsdf_raster = (BSDF_TRaster*)raster;
BSDF_Worker worker; BSDF_Worker worker;
const SDF_Raster_Params* sdf_params = (const SDF_Raster_Params*)params; const SDF_Raster_Params* sdf_params = (const SDF_Raster_Params*)params;
FT_UNUSED( raster ); worker.distance_map = NULL;
/* check for valid parameters */ /* check for valid parameters */
if ( !raster || !params ) if ( !raster || !params )

View File

@ -2658,6 +2658,9 @@
return error; return error;
} }
/* `sdf_generate' is not used at the moment */
#if 0
/************************************************************************** /**************************************************************************
* *
* @Function: * @Function:
@ -2891,6 +2894,8 @@
return error; return error;
} }
#endif
/************************************************************************** /**************************************************************************
* *
* @Function: * @Function:
@ -3059,10 +3064,7 @@
else if ( dists[index].distance > dist.distance ) else if ( dists[index].distance > dist.distance )
dists[index] = dist; dists[index] = dist;
else if ( FT_ABS(dists[index].distance - dist.distance ) < CORNER_CHECK_EPSILON ) else if ( FT_ABS(dists[index].distance - dist.distance ) < CORNER_CHECK_EPSILON )
{ dists[index] = resolve_corner( dists[index], dist );
if ( FT_ABS( dists[index].cross ) < FT_ABS( dist.cross ) )
dists[index] = dist;
}
} }
} }
@ -3675,6 +3677,9 @@
FT_Int line = __LINE__; FT_Int line = __LINE__;
/* in non debugging mode this is not used */
FT_UNUSED( line );
*araster = 0; *araster = 0;
if ( !FT_ALLOC( raster, sizeof( SDF_TRaster ) ) ) if ( !FT_ALLOC( raster, sizeof( SDF_TRaster ) ) )
{ {
@ -3819,6 +3824,8 @@
FT_Memory memory = (FT_Memory)((SDF_TRaster*)raster)->memory; FT_Memory memory = (FT_Memory)((SDF_TRaster*)raster)->memory;
FT_Int line = __LINE__; FT_Int line = __LINE__;
/* in non debugging mode this is not used */
FT_UNUSED( line );
FT_FREE( raster ); FT_FREE( raster );
} }