Commit b566d42aa0470683634174671ce652f385902a93

suzuki toshiya 2009-08-01T00:30:19

cache: Fix some data types mismatching with their sources.

diff --git a/ChangeLog b/ChangeLog
index 1bee401..b9cdd4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 
 	cache: Fix some data types mismatching with their sources.
 
+	* src/cache/ftccache.c (ftc_cache_resize): The types of
+	`p', `mask', `count' are matched with FTC_Cache->{p,mask}.
+	(FTC_Cache_Clear): The type of `old_index' is matched to
+	FTC_Cache->{p,mask}.
+
+	* src/cache/ftccache.h (FTC_CACHE_LOOKUP_CMP): The type
+	of `_idx' is matched with FTC_Cache->{p,mask}.
+
+2009-07-31  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
+	cache: Fix some data types mismatching with their sources.
+
 	* src/cache/ftcsbits.c (ftc_snode_load): The types
 	of `xadvance' and `yadvance' are matched with
 	FT_GlyphSlot->advance.{x|y}.
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index 878057c..1162695 100644
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -93,9 +93,9 @@
     for (;;)
     {
       FTC_Node  node, *pnode;
-      FT_UInt   p      = cache->p;
-      FT_UInt   mask   = cache->mask;
-      FT_UInt   count  = mask + p + 1;    /* number of buckets */
+      FT_UFast  p      = cache->p;
+      FT_UFast  mask   = cache->mask;
+      FT_UFast  count  = mask + p + 1;    /* number of buckets */
 
 
       /* do we need to shrink the buckets array? */
@@ -153,7 +153,7 @@
       /* do we need to expand the buckets array? */
       else if ( cache->slack > (FT_Long)count * FTC_HASH_SUB_LOAD )
       {
-        FT_UInt    old_index = p + mask;
+        FT_UFast   old_index = p + mask;
         FTC_Node*  pold;
 
 
@@ -347,7 +347,7 @@
     {
       FTC_Manager  manager = cache->manager;
       FT_UFast     i;
-      FT_UInt      count;
+      FT_UFast     count;
 
 
       count = cache->p + cache->mask + 1;
diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h
index be5b24e..19ac5f7 100644
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -202,7 +202,7 @@ FT_BEGIN_HEADER
     FTC_Cache             _cache   = FTC_CACHE(cache);                   \
     FT_UInt32             _hash    = (FT_UInt32)(hash);                  \
     FTC_Node_CompareFunc  _nodcomp = (FTC_Node_CompareFunc)(nodecmp);    \
-    FT_UInt               _idx;                                          \
+    FT_UFast              _idx;                                          \
                                                                          \
                                                                          \
     error = 0;                                                           \