shithub: freetype+ttf2subf

Download patch

ref: 49270c17011491227ec7bd3fb73ede4f674aa065
parent: 9a4c846e60e0260f79ce760fe2aef06857197eff
author: Alexei Podtelezhnikov <[email protected]>
date: Tue Sep 14 17:32:43 EDT 2021

Replace boolean allocation macros with MEM ones.

* src/base/ftbitmap.c (FT_Bitmap_Copy): Use MEM-macro.
* src/base/ftobjs.c (ft_glyphslot_alloc_bitmap): Ditto.
* src/bzip2/ftbzip2.c (ft_bzip2_alloc): Ditto.
* src/cache/ftccache.c (ftc_cache_init): Ditto
* src/gzip/ftgzip.c (ft_gzip_alloc): Ditto.
* src/psnames/psmodule.c (ps_unicodes_init): Ditto.
* src/sfnt/sfobjs.c (sfnt_load_face): Ditto.
* src/sfnt/ttload.c (tt_face_load_name): Ditto.

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -112,10 +112,10 @@
       target_size = (FT_ULong)target_pitch * target->rows;
 
       if ( target_size != size )
-        (void)FT_QREALLOC( target->buffer, target_size, size );
+        FT_MEM_QREALLOC( target->buffer, target_size, size );
     }
     else
-      (void)FT_QALLOC( target->buffer, size );
+      FT_MEM_QALLOC( target->buffer, size );
 
     if ( !error )
     {
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -535,7 +535,7 @@
     else
       slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
 
-    (void)FT_ALLOC( slot->bitmap.buffer, size );
+    FT_MEM_ALLOC( slot->bitmap.buffer, size );
     return error;
   }
 
--- a/src/bzip2/ftbzip2.c
+++ b/src/bzip2/ftbzip2.c
@@ -70,7 +70,7 @@
     FT_Pointer  p  = NULL;
 
 
-    (void)FT_QALLOC( p, sz );
+    FT_MEM_QALLOC( p, sz );
     return p;
   }
 
--- a/src/cache/ftccache.c
+++ b/src/cache/ftccache.c
@@ -341,7 +341,7 @@
     cache->mask  = FTC_HASH_INITIAL_SIZE - 1;
     cache->slack = FTC_HASH_INITIAL_SIZE * FTC_HASH_MAX_LOAD;
 
-    (void)FT_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 );
+    FT_MEM_NEW_ARRAY( cache->buckets, FTC_HASH_INITIAL_SIZE * 2 );
     return error;
   }
 
--- a/src/gzip/ftgzip.c
+++ b/src/gzip/ftgzip.c
@@ -132,7 +132,7 @@
 
 
     /* allocate and zero out */
-    (void)FT_ALLOC( p, sz );
+    FT_MEM_ALLOC( p, sz );
     return p;
   }
 
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -389,9 +389,9 @@
         /* Reallocate if the number of used entries is much smaller. */
         if ( count < num_glyphs / 2 )
         {
-          (void)FT_QRENEW_ARRAY( table->maps,
-                                 num_glyphs + EXTRA_GLYPH_LIST_SIZE,
-                                 count );
+          FT_MEM_QRENEW_ARRAY( table->maps,
+                               num_glyphs + EXTRA_GLYPH_LIST_SIZE,
+                               count );
           error = FT_Err_Ok;
         }
 
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -1238,7 +1238,7 @@
           }
 
           /* reduce array size to the actually used elements */
-          (void)FT_QRENEW_ARRAY( sbit_strike_map, count, bsize_idx );
+          FT_MEM_QRENEW_ARRAY( sbit_strike_map, count, bsize_idx );
 
           /* from now on, all strike indices are mapped */
           /* using `sbit_strike_map'                    */
--- a/src/sfnt/ttload.c
+++ b/src/sfnt/ttload.c
@@ -993,9 +993,9 @@
 
       /* reduce array size to the actually used elements */
       count = (FT_UInt)( entry - table->names );
-      (void)FT_QRENEW_ARRAY( table->names,
-                             table->numNameRecords,
-                             count );
+      FT_MEM_QRENEW_ARRAY( table->names,
+                           table->numNameRecords,
+                           count );
       table->numNameRecords = count;
     }