Commit 023a4bf3bee24599ae0760042685f18624860641

Werner Lemberg 2004-10-14T11:33:04

* include/freetype/config/ftstdlib.h: Include `stddef.h'. (ft_ptrdiff_t): Define. * include/freetype/fttypes.h (FT_PtrDist): Use `ft_ptrdiff_t'. * src/cid/cidload.c (cid_parse_dict), src/type1/t1load.c (parse_dict): Fix compiler warning.

diff --git a/ChangeLog b/ChangeLog
index 9a8a7ea..d1e2e50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2004-10-13  Werner Lemberg  <wl@gnu.org>
+
+	* include/freetype/config/ftstdlib.h: Include `stddef.h'.
+	(ft_ptrdiff_t): Define.
+
+	* include/freetype/fttypes.h (FT_PtrDist): Use `ft_ptrdiff_t'.
+
+	* src/cid/cidload.c (cid_parse_dict), src/type1/t1load.c
+	(parse_dict): Fix compiler warning.
+
 2004-10-11  Joshua Neal  <jneal@csdaily.com>
 
 	* src/sfnt/ttcmap.c (tt_face_build_cmaps): Check for pointer
diff --git a/include/freetype/config/ftstdlib.h b/include/freetype/config/ftstdlib.h
index 297d6f0..448ae4b 100644
--- a/include/freetype/config/ftstdlib.h
+++ b/include/freetype/config/ftstdlib.h
@@ -33,6 +33,11 @@
 #define __FTSTDLIB_H__
 
 
+#include <stddef.h>
+
+#define ft_ptrdiff_t  ptrdiff_t
+
+
   /**********************************************************************/
   /*                                                                    */
   /*                           integer limits                           */
diff --git a/include/freetype/fttypes.h b/include/freetype/fttypes.h
index e47f002..7727ebb 100644
--- a/include/freetype/fttypes.h
+++ b/include/freetype/fttypes.h
@@ -325,7 +325,7 @@ FT_BEGIN_HEADER
   /*    largest _signed_ integer type used to express the distance         */
   /*    between two pointers.                                              */
   /*                                                                       */
-  typedef size_t  FT_PtrDist;
+  typedef ft_ptrdiff_t  FT_PtrDist;
 
 
   /*************************************************************************/
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index ad29dd5..34ad12b 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -324,8 +324,8 @@
               if ( !name )
                 break;
 
-              if ( cur[0] == name[0]                     &&
-                   len == ft_strlen( (const char*)name ) )
+              if ( cur[0] == name[0]                                 &&
+                   len == (FT_PtrDist)ft_strlen( (const char*)name ) )
               {
                 FT_PtrDist  n;
 
diff --git a/src/type1/t1load.c b/src/type1/t1load.c
index 7ec163a..9355288 100644
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1820,9 +1820,9 @@
             if ( !name )
               break;
 
-            if ( cur[0] == name[0]                      &&
-                 len == ft_strlen( (const char *)name ) &&
-                 ft_memcmp( cur, name, len ) == 0       )
+            if ( cur[0] == name[0]                                  &&
+                 len == (FT_PtrDist)ft_strlen( (const char *)name ) &&
+                 ft_memcmp( cur, name, len ) == 0                   )
             {
               /* We found it -- run the parsing callback! */
               /* We only record the first instance of any */