Commit 49270c17011491227ec7bd3fb73ede4f674aa065

Alexei Podtelezhnikov 2021-09-14T21:32:43

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.

diff --git a/src/base/ftbitmap.c b/src/base/ftbitmap.c
index e504db1..2146d3e 100644
--- 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 )
     {
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index c4ade35..2c929db 100644
--- 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;
   }
 
diff --git a/src/bzip2/ftbzip2.c b/src/bzip2/ftbzip2.c
index a20ba4a..296cea0 100644
--- 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;
   }
 
diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c
index 4bdf9b1..fbca490 100644
--- 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;
   }
 
diff --git a/src/gzip/ftgzip.c b/src/gzip/ftgzip.c
index 42b7543..8f98a7d 100644
--- 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;
   }
 
diff --git a/src/psnames/psmodule.c b/src/psnames/psmodule.c
index 9fe7d7c..74adefa 100644
--- 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;
         }
 
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index 8ca67e3..656bb41 100644
--- 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'                    */
diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c
index d8ea9ea..944d3d4 100644
--- 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;
     }