Commit d71f2bc1593200a8f763841c0a083ba91f7dad01

Alexei Podtelezhnikov 2018-10-26T22:52:25

Revert "Align FreeType with standard C memory management." This reverts commit 877aa1b2cc662978aae61ed4d5c6ea8ba56b2fe7.

diff --git a/ChangeLog b/ChangeLog
index 5bb6ba7..a86bcb5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-10-27  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+	Revert: Align FreeType with standard C memory management.
+
 2018-10-27  Werner Lemberg  <wl@gnu.org>
 
 	[psaux] Fix numeric overflow.
@@ -137,7 +141,7 @@
 	* src/base/ftobjs.c (ft_glyphslot_preset_bimap): Another tweak.
 
 	This one should be clearer. When the rounded monochrome bbox collapses
-	we add a pixel that covers most if not all original cbox.
+	we add a pixel that covers most if not all original cbox. 
 
 2018-09-21  Alexei Podtelezhnikov  <apodtele@gmail.com>
 
diff --git a/builds/amiga/src/base/ftsystem.c b/builds/amiga/src/base/ftsystem.c
index 031bd29..53abdb0 100644
--- a/builds/amiga/src/base/ftsystem.c
+++ b/builds/amiga/src/base/ftsystem.c
@@ -139,7 +139,7 @@ Free_VecPooled( APTR  poolHeader,
   /*                                                                       */
   FT_CALLBACK_DEF( void* )
   ft_alloc( FT_Memory  memory,
-            size_t     size )
+            long       size )
   {
 #ifdef __amigaos4__
     return AllocVecPooled( memory->user, size );
@@ -171,8 +171,8 @@ Free_VecPooled( APTR  poolHeader,
   /*                                                                       */
   FT_CALLBACK_DEF( void* )
   ft_realloc( FT_Memory  memory,
-              size_t     cur_size,
-              size_t     new_size,
+              long       cur_size,
+              long       new_size,
               void*      block )
   {
     void* new_block;
diff --git a/builds/unix/ftsystem.c b/builds/unix/ftsystem.c
index 8e70988..449c0ed 100644
--- a/builds/unix/ftsystem.c
+++ b/builds/unix/ftsystem.c
@@ -95,7 +95,7 @@
   /*                                                                       */
   FT_CALLBACK_DEF( void* )
   ft_alloc( FT_Memory  memory,
-            size_t     size )
+            long       size )
   {
     FT_UNUSED( memory );
 
@@ -125,8 +125,8 @@
   /*                                                                       */
   FT_CALLBACK_DEF( void* )
   ft_realloc( FT_Memory  memory,
-              size_t     cur_size,
-              size_t     new_size,
+              long       cur_size,
+              long       new_size,
               void*      block )
   {
     FT_UNUSED( memory );
diff --git a/builds/vms/ftsystem.c b/builds/vms/ftsystem.c
index 51a7a3f..71aab35 100644
--- a/builds/vms/ftsystem.c
+++ b/builds/vms/ftsystem.c
@@ -94,7 +94,7 @@
   /*                                                                       */
   FT_CALLBACK_DEF( void* )
   ft_alloc( FT_Memory  memory,
-            size_t     size )
+            long       size )
   {
     FT_UNUSED( memory );
 
@@ -124,8 +124,8 @@
   /*                                                                       */
   FT_CALLBACK_DEF( void* )
   ft_realloc( FT_Memory  memory,
-              size_t     cur_size,
-              size_t     new_size,
+              long       cur_size,
+              long       new_size,
               void*      block )
   {
     FT_UNUSED( memory );
diff --git a/include/freetype/ftsystem.h b/include/freetype/ftsystem.h
index 810b7b8..d6947f5 100644
--- a/include/freetype/ftsystem.h
+++ b/include/freetype/ftsystem.h
@@ -21,7 +21,6 @@
 
 
 #include <ft2build.h>
-#include FT_TYPES_H
 
 
 FT_BEGIN_HEADER
@@ -87,7 +86,7 @@ FT_BEGIN_HEADER
    */
   typedef void*
   (*FT_Alloc_Func)( FT_Memory  memory,
-                    size_t     size );
+                    long       size );
 
 
   /**************************************************************************
@@ -141,8 +140,8 @@ FT_BEGIN_HEADER
    */
   typedef void*
   (*FT_Realloc_Func)( FT_Memory  memory,
-                      size_t     cur_size,
-                      size_t     new_size,
+                      long       cur_size,
+                      long       new_size,
                       void*      block );
 
 
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index 0354a1f..6e0a074 100644
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -676,11 +676,10 @@
 
   static FT_Pointer
   ft_mem_debug_alloc( FT_Memory  memory,
-                      FT_Offset  size_ )
+                      FT_Long    size )
   {
     FT_MemTable  table = (FT_MemTable)memory->user;
     FT_Byte*     block;
-    FT_Long      size = (FT_Long)size_;
 
 
     if ( size <= 0 )
@@ -737,16 +736,14 @@
 
   static FT_Pointer
   ft_mem_debug_realloc( FT_Memory   memory,
-                        FT_Offset   cur_size_,
-                        FT_Offset   new_size_,
+                        FT_Long     cur_size,
+                        FT_Long     new_size,
                         FT_Pointer  block )
   {
     FT_MemTable  table = (FT_MemTable)memory->user;
     FT_MemNode   node, *pnode;
     FT_Pointer   new_block;
     FT_Long      delta;
-    FT_Long      cur_size = (FT_Long)cur_size_;
-    FT_Long      new_size = (FT_Long)new_size_;
 
     const char*  file_name = FT_FILENAME( _ft_debug_file );
     FT_Long      line_no   = _ft_debug_lineno;
diff --git a/src/base/ftsystem.c b/src/base/ftsystem.c
index ded49a4..8fffe48 100644
--- a/src/base/ftsystem.c
+++ b/src/base/ftsystem.c
@@ -69,11 +69,11 @@
    */
   FT_CALLBACK_DEF( void* )
   ft_alloc( FT_Memory  memory,
-            size_t     size )
+            long       size )
   {
     FT_UNUSED( memory );
 
-    return ft_smalloc( size );
+    return ft_smalloc( (size_t)size );
   }
 
 
@@ -103,14 +103,14 @@
    */
   FT_CALLBACK_DEF( void* )
   ft_realloc( FT_Memory  memory,
-              size_t     cur_size,
-              size_t     new_size,
+              long       cur_size,
+              long       new_size,
               void*      block )
   {
     FT_UNUSED( memory );
     FT_UNUSED( cur_size );
 
-    return ft_srealloc( block, new_size );
+    return ft_srealloc( block, (size_t)new_size );
   }
 
 
diff --git a/src/raster/ftmisc.h b/src/raster/ftmisc.h
index fb63a02..97db371 100644
--- a/src/raster/ftmisc.h
+++ b/src/raster/ftmisc.h
@@ -59,14 +59,14 @@
   typedef struct FT_MemoryRec_*  FT_Memory;
 
   typedef void* (*FT_Alloc_Func)( FT_Memory  memory,
-                                  size_t     size );
+                                  long       size );
 
   typedef void (*FT_Free_Func)( FT_Memory  memory,
                                 void*      block );
 
   typedef void* (*FT_Realloc_Func)( FT_Memory  memory,
-                                    size_t     cur_size,
-                                    size_t     new_size,
+                                    long       cur_size,
+                                    long       new_size,
                                     void*      block );
 
   typedef struct FT_MemoryRec_