Commit ed1d359025f4fe1b2d1b152fe72ffcd570b9d856

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

cache: Fix some data types mismatching with their sources.

diff --git a/ChangeLog b/ChangeLog
index 3a0cda2..4371d87 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,30 @@
 2009-07-31  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
 
+	cache: Fix some data types mismatching with their sources.
+
+	* src/cache/ftccache.h: The type of return value
+	by FTC_Node_WeightFunc function is changed to
+	FT_Offset.  The type of FTC_CacheClass->cache_size
+	is changed to FT_Offset, too.
+
+	* src/cache/ftccback.h (ft_inode_weight,
+	ftc_snode_weight): Ditto.
+
+	* src/cache/ftccmap.c (ftc_cmap_node_weight): Ditto.
+
+	* src/cache/ftcimage.c (ftc_inode_weight,
+	FTC_INode_Weight): Ditto.
+
+	* src/cache/ftcsbits.c (ftc_snode_weight,
+	FTC_SNode_Weight): Ditto.
+
+	* src/cache/ftcmru.h: The type of
+	FTC_MruListClass->node_size is changed to FT_Offset,
+	because it is passed to FT_ALLOC() to specify the
+	size of buffer.
+
+2009-07-31  suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
+
 	XXX_cmap_encoding_char_next() return FT_UInt32 values.
 
 	* include/freetype/internal/services/svpscmap.h:
diff --git a/src/cache/ftccache.h b/src/cache/ftccache.h
index 19ac5f7..2082bc4 100644
--- a/src/cache/ftccache.h
+++ b/src/cache/ftccache.h
@@ -91,7 +91,7 @@ FT_BEGIN_HEADER
                        FT_Pointer   query,
                        FTC_Cache    cache );
 
-  typedef FT_ULong
+  typedef FT_Offset
   (*FTC_Node_WeightFunc)( FTC_Node   node,
                           FTC_Cache  cache );
 
@@ -121,7 +121,7 @@ FT_BEGIN_HEADER
     FTC_Node_CompareFunc  node_remove_faceid;
     FTC_Node_FreeFunc     node_free;
 
-    FT_UInt               cache_size;
+    FT_Offset             cache_size;
     FTC_Cache_InitFunc    cache_init;
     FTC_Cache_DoneFunc    cache_done;
 
diff --git a/src/cache/ftccback.h b/src/cache/ftccback.h
index 86e72a7..4d0818d 100644
--- a/src/cache/ftccback.h
+++ b/src/cache/ftccback.h
@@ -36,7 +36,7 @@
                  FT_Pointer  gquery,
                  FTC_Cache   cache );
 
-  FT_LOCAL( FT_ULong )
+  FT_LOCAL( FT_Offset )
   ftc_inode_weight( FTC_Node   inode,
                     FTC_Cache  cache );
 
@@ -50,7 +50,7 @@
                  FT_Pointer  gquery,
                  FTC_Cache   cache );
 
-  FT_LOCAL( FT_ULong )
+  FT_LOCAL( FT_Offset )
   ftc_snode_weight( FTC_Node   snode,
                     FTC_Cache  cache );
 
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index e1b22b1..50a6189 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -174,7 +174,7 @@
 
 
   /* compute the weight of a given cmap node */
-  FT_CALLBACK_DEF( FT_ULong )
+  FT_CALLBACK_DEF( FT_Offset )
   ftc_cmap_node_weight( FTC_Node   cnode,
                         FTC_Cache  cache )
   {
diff --git a/src/cache/ftcimage.c b/src/cache/ftcimage.c
index 15d4e80..417daf2 100644
--- a/src/cache/ftcimage.c
+++ b/src/cache/ftcimage.c
@@ -103,12 +103,12 @@
   }
 
 
-  FT_LOCAL_DEF( FT_ULong )
+  FT_LOCAL_DEF( FT_Offset )
   ftc_inode_weight( FTC_Node   ftcinode,
                     FTC_Cache  ftccache )
   {
     FTC_INode  inode = (FTC_INode)ftcinode;
-    FT_ULong   size  = 0;
+    FT_Offset  size  = 0;
     FT_Glyph   glyph = inode->glyph;
 
     FT_UNUSED( ftccache );
@@ -151,7 +151,7 @@
 
 #if 0
 
-  FT_LOCAL_DEF( FT_ULong )
+  FT_LOCAL_DEF( FT_Offset )
   FTC_INode_Weight( FTC_INode  inode )
   {
     return ftc_inode_weight( FTC_NODE( inode ), NULL );
diff --git a/src/cache/ftcmru.h b/src/cache/ftcmru.h
index c8f0c6e..0cda76e 100644
--- a/src/cache/ftcmru.h
+++ b/src/cache/ftcmru.h
@@ -107,7 +107,7 @@ FT_BEGIN_HEADER
 
   typedef struct  FTC_MruListClassRec_
   {
-    FT_UInt                  node_size;
+    FT_Offset                node_size;
     FTC_MruNode_CompareFunc  node_compare;
     FTC_MruNode_InitFunc     node_init;
     FTC_MruNode_ResetFunc    node_reset;
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 3bd5dd6..7330cba 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -263,7 +263,7 @@
   }
 
 
-  FT_LOCAL_DEF( FT_ULong )
+  FT_LOCAL_DEF( FT_Offset )
   ftc_snode_weight( FTC_Node   ftcsnode,
                     FTC_Cache  cache )
   {
@@ -271,7 +271,7 @@
     FT_UInt    count = snode->count;
     FTC_SBit   sbit  = snode->sbits;
     FT_Int     pitch;
-    FT_ULong   size;
+    FT_Offset  size;
 
     FT_UNUSED( cache );
 
@@ -300,7 +300,7 @@
 
 #if 0
 
-  FT_LOCAL_DEF( FT_ULong )
+  FT_LOCAL_DEF( FT_Offset )
   FTC_SNode_Weight( FTC_SNode  snode )
   {
     return ftc_snode_weight( FTC_NODE( snode ), NULL );