freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] anuj-distance-field 0db5ba9: [sdf] Fix gcc compiler warnings


From: Anuj Verma
Subject: [freetype2] anuj-distance-field 0db5ba9: [sdf] Fix gcc compiler warnings.
Date: Thu, 13 Aug 2020 23:44:27 -0400 (EDT)

branch: anuj-distance-field
commit 0db5ba974dcc62a82739df8f0257b4bcc93d6a19
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: 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.
---
 [GSoC]ChangeLog  |  8 ++++++++
 src/sdf/ftbsdf.c | 26 +++++++++-----------------
 src/sdf/ftsdf.c  | 15 +++++++++++----
 3 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/[GSoC]ChangeLog b/[GSoC]ChangeLog
index 5264adb..2caa603 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 48d1f3d..e8f39fb 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 6d77493..8404a9c 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 );
   }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]