shithub: freetype+ttf2subf

Download patch

ref: b36bf5279535d7538d89df7788b2ec8a9040c6df
parent: 1be9ebf5f909d7fc026eb185a8b5eeb6a372afe6
author: Werner Lemberg <[email protected]>
date: Sun Jan 22 02:09:54 EST 2006

* src/autofit/afloader.c (af_loader_load_g): Move AF_USE_WARPER up
to avoid compiler warnings.

* src/autofit/afwarp.c (af_warper_compute_line_best): Remove
shadowing variable declarations.
Fix warning parameters and replace printf with AF_LOG.
(af_warper_compute): Remove unused variable.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,14 @@
 
 	* src/autofit/rules.mk (AUTOF_DRV_SRC): Add afwarp.c.
 
+	* src/autofit/afloader.c (af_loader_load_g): Move AF_USE_WARPER up
+	to avoid compiler warnings.
+
+	* src/autofit/afwarp.c (af_warper_compute_line_best): Remove
+	shadowing variable declarations.
+	Fix warning parameters and replace printf with AF_LOG.
+	(af_warper_compute): Remove unused variable.
+
 2006-01-20  David Turner  <[email protected]>
 
 	Adding experimental implementation of `warp hinting' (new hinting
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -184,6 +184,7 @@
       /* we now need to hint the metrics according to the change in */
       /* width/positioning that occured during the hinting process  */
       {
+#ifndef AF_USE_WARPER
         FT_Pos        old_advance, old_rsb, old_lsb, new_lsb;
         FT_Pos        pp1x_uh, pp2x_uh;
         AF_AxisHints  axis  = &hints->axis[AF_DIMENSION_HORZ];
@@ -191,7 +192,7 @@
         AF_Edge       edge2 = edge1 +
                               axis->num_edges - 1; /* rightmost edge */
 
-#ifndef AF_USE_WARPER
+
         if ( axis->num_edges > 1 )
         {
           old_advance = loader->pp2.x;
--- a/src/autofit/afwarp.c
+++ b/src/autofit/afwarp.c
@@ -52,7 +52,7 @@
                                AF_Segment    segments,
                                FT_UInt       num_segments )
   {
-    FT_Int        idx_min, idx_max, idx0, xx1min, xx1max;
+    FT_Int        idx_min, idx_max, idx0;
     FT_UInt       nn;
     AF_WarpScore  scores[64];
 
@@ -81,11 +81,12 @@
 
       if ( idx_min > idx_max )
       {
-        printf( "invalid indices:\n"
-                "  min=%d max=%d, xx1=%d xx2=%d,\n"
-                "  x1min=%d x1max=%d, x2min=%d x2max=%d\n",
-                idx_min, idx_max, xx1, xx2,
-                warper->x1min, warper->x1max, warper->x2min, warper->x2max );
+        AF_LOG(( "invalid indices:\n"
+                 "  min=%d max=%d, xx1=%ld xx2=%ld,\n"
+                 "  x1min=%ld x1max=%ld, x2min=%ld x2max=%ld\n",
+                 idx_min, idx_max, xx1, xx2,
+                 warper->x1min, warper->x1max,
+                 warper->x2min, warper->x2max ));
         return;
       }
     }
@@ -252,7 +253,6 @@
 
     for ( w = warper->wmin; w <= warper->wmax; w++ )
     {
-      FT_Int    line = w - warper->wmin;
       FT_Fixed  new_scale;
       FT_Pos    new_delta;
       FT_Pos    xx1, xx2;