Commit b56680240a10db7e13cf5925a61946626d269c84

suzuki toshiya 2009-08-01T00:32:07

autofit: Count the size of the memory object by ptrdiff_t.

diff --git a/ChangeLog b/ChangeLog
index 4c83ac9..7798e46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2009-07-31  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
 
+	autofit: Count the size of the memory object by ptrdiff_t.
+
+	* src/autofit/afcjk.c (af_cjk_hint_edges): The
+	number of edges `n_edges' should be counted by
+	FT_PtrDist variable instead of FT_Int.
+
+	* src/autofit/aflatin.c (af_latin_hint_edges):
+	Ditto.
+
+	* src/autofit/aftypes.h: In AF_ScriptClassRec,
+	the size of metric `script_metrics_size' should
+	be counted by FT_Offset variable instead of FT_UInt.
+
+	* src/autofit/afhints.c
+	(af_glyph_hints_align_strong_points): The cursors
+	for the edges `min', `max', `mid' in the memory
+	buffer should be typed FT_PtrDist.
+
+2009-07-31  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
 	autofit: Fix for unused variable `first'.
 
 	* src/autofit/afhints.c (af_glyph_hints_reload): Insert
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 9e0cea8..bab0c42 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -1020,7 +1020,7 @@
     AF_AxisHints  axis       = &hints->axis[dim];
     AF_Edge       edges      = axis->edges;
     AF_Edge       edge_limit = edges + axis->num_edges;
-    FT_Int        n_edges;
+    FT_PtrDist    n_edges;
     AF_Edge       edge;
     AF_Edge       anchor   = 0;
     FT_Pos        delta    = 0;
diff --git a/src/autofit/afhints.c b/src/autofit/afhints.c
index e175b04..8396a20 100644
--- a/src/autofit/afhints.c
+++ b/src/autofit/afhints.c
@@ -941,8 +941,8 @@
         }
 
         {
-          FT_UInt  min, max, mid;
-          FT_Pos   fpos;
+          FT_PtrDist  min, max, mid;
+          FT_Pos      fpos;
 
 
           /* find enclosing edges */
@@ -953,7 +953,7 @@
           /* for small edge counts, a linear search is better */
           if ( max <= 8 )
           {
-            FT_UInt  nn;
+            FT_PtrDist  nn;
 
             for ( nn = 0; nn < max; nn++ )
               if ( edges[nn].fpos >= u )
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index 062f863..252703e 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -1701,7 +1701,7 @@
     AF_AxisHints  axis       = &hints->axis[dim];
     AF_Edge       edges      = axis->edges;
     AF_Edge       edge_limit = edges + axis->num_edges;
-    FT_Int        n_edges;
+    FT_PtrDist    n_edges;
     AF_Edge       edge;
     AF_Edge       anchor     = 0;
     FT_Int        has_serifs = 0;
diff --git a/src/autofit/aftypes.h b/src/autofit/aftypes.h
index 71c9bad..5574f0c 100644
--- a/src/autofit/aftypes.h
+++ b/src/autofit/aftypes.h
@@ -332,7 +332,7 @@ extern void*  _af_debug_hints;
     AF_Script                   script;
     AF_Script_UniRange          script_uni_ranges; /* last must be { 0, 0 } */
 
-    FT_UInt                     script_metrics_size;
+    FT_Offset                   script_metrics_size;
     AF_Script_InitMetricsFunc   script_metrics_init;
     AF_Script_ScaleMetricsFunc  script_metrics_scale;
     AF_Script_DoneMetricsFunc   script_metrics_done;