Commit 45cad2e5e15c08b682e87b5636cccfc941b3fe7d

Werner Lemberg 2016-09-28T19:10:52

More FT_ZERO usage. * src/gxvalid/gxvcommn.c (gxv_ClassTable_validate): s/ft_memset/FT_MEM_ZERO/. * src/psaux/t1decode.c (t1_decoder_parse_charstrings): s/ft_memset/FT_ARRAY_ZERO/. * src/raster/ftraster.c (FT_ZERO): Define. (ft_black_new): Use it. * src/raster/ftrend1.c (ft_raster1_get_cbox): s/FT_MEM_ZERO/FT_ZERO/. * src/smooth/ftgrays.c (FT_ZERO): Define. (gray_raster_new): Use it. * src/smooth/ftsmooth.c (ft_smooth_get_cbox): s/FT_MEM_ZERO/FT_ZERO/.

diff --git a/ChangeLog b/ChangeLog
index f5a88f7..e0bdc71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2016-09-28  Werner Lemberg  <wl@gnu.org>
 
+	More FT_ZERO usage.
+
+	* src/gxvalid/gxvcommn.c (gxv_ClassTable_validate):
+	s/ft_memset/FT_MEM_ZERO/.
+
+	* src/psaux/t1decode.c (t1_decoder_parse_charstrings):
+	s/ft_memset/FT_ARRAY_ZERO/.
+
+	* src/raster/ftraster.c (FT_ZERO): Define.
+	(ft_black_new): Use it.
+	* src/raster/ftrend1.c (ft_raster1_get_cbox):
+	s/FT_MEM_ZERO/FT_ZERO/.
+
+	* src/smooth/ftgrays.c (FT_ZERO): Define.
+	(gray_raster_new): Use it.
+	* src/smooth/ftsmooth.c (ft_smooth_get_cbox):
+	s/FT_MEM_ZERO/FT_ZERO/.
+
+2016-09-28  Werner Lemberg  <wl@gnu.org>
+
 	*/*: s/FT_MEM_ZERO/FT_ZERO/ where appropriate.
 
 2016-09-27  Werner Lemberg  <wl@gnu.org>
diff --git a/src/gxvalid/gxvcommn.c b/src/gxvalid/gxvcommn.c
index 4b5e415..65f793c 100644
--- a/src/gxvalid/gxvcommn.c
+++ b/src/gxvalid/gxvcommn.c
@@ -972,7 +972,7 @@
       FT_UShort  i;
 
 
-      ft_memset( nGlyphInClass, 0, 256 );
+      FT_MEM_ZERO( nGlyphInClass, 256 );
 
 
       for ( i = 0; i < nGlyphs; i++ )
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index 493e3bd..4a32b82 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -405,9 +405,7 @@
                ( decoder->buildchar == NULL )  );
 
     if ( decoder->buildchar && decoder->len_buildchar > 0 )
-      ft_memset( &decoder->buildchar[0],
-                 0,
-                 sizeof ( decoder->buildchar[0] ) * decoder->len_buildchar );
+      FT_ARRAY_ZERO( decoder->buildchar, decoder->len_buildchar );
 
     FT_TRACE4(( "\n"
                 "Start charstring\n" ));
diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c
index 73c2fbf..7b9abe6 100644
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -251,6 +251,10 @@
 #define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )
 #endif
 
+#ifndef FT_ZERO
+#define FT_ZERO( p )  FT_MEM_ZERO( p, sizeof ( *(p) ) )
+#endif
+
   /* FMulDiv means `Fast MulDiv'; it is used in case where `b' is       */
   /* typically a small value and the result of a*b is known to fit into */
   /* 32 bits.                                                           */
@@ -3057,7 +3061,7 @@
 
 
      *araster = (FT_Raster)&the_raster;
-     FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );
+     FT_ZERO( &the_raster );
      ft_black_init( &the_raster );
 
      return 0;
diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c
index c456dc5..5bd4b30 100644
--- a/src/raster/ftrend1.c
+++ b/src/raster/ftrend1.c
@@ -88,7 +88,7 @@
                        FT_GlyphSlot  slot,
                        FT_BBox*      cbox )
   {
-    FT_MEM_ZERO( cbox, sizeof ( *cbox ) );
+    FT_ZERO( cbox );
 
     if ( slot->format == render->glyph_format )
       FT_Outline_Get_CBox( &slot->outline, cbox );
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 7558312..114657e 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -286,6 +286,10 @@ typedef ptrdiff_t  FT_PtrDist;
 #define FT_MEM_ZERO( dest, count )  FT_MEM_SET( dest, 0, count )
 #endif
 
+#ifndef FT_ZERO
+#define FT_ZERO( p )  FT_MEM_ZERO( p, sizeof ( *(p) ) )
+#endif
+
   /* as usual, for the speed hungry :-) */
 
 #undef RAS_ARG
@@ -1966,7 +1970,7 @@ typedef ptrdiff_t  FT_PtrDist;
 
 
     *araster = (FT_Raster)&the_raster;
-    FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );
+    FT_ZERO( &the_raster );
 
     return 0;
   }
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 866427e..1371792 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -87,7 +87,7 @@
                       FT_GlyphSlot  slot,
                       FT_BBox*      cbox )
   {
-    FT_MEM_ZERO( cbox, sizeof ( *cbox ) );
+    FT_ZERO( cbox );
 
     if ( slot->format == render->glyph_format )
       FT_Outline_Get_CBox( &slot->outline, cbox );