shithub: freetype+ttf2subf

Download patch

ref: 45cad2e5e15c08b682e87b5636cccfc941b3fe7d
parent: 2ecf89b481703315bffa8e0b10c2e970224b52e6
author: Werner Lemberg <[email protected]>
date: Wed Sep 28 15:10:52 EDT 2016

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/.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2016-09-28  Werner Lemberg  <[email protected]>
 
+	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  <[email protected]>
+
 	*/*: s/FT_MEM_ZERO/FT_ZERO/ where appropriate.
 
 2016-09-27  Werner Lemberg  <[email protected]>
--- 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++ )
--- 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" ));
--- 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;
--- 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 );
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -286,6 +286,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
+
   /* as usual, for the speed hungry :-) */
 
 #undef RAS_ARG
@@ -1966,7 +1970,7 @@
 
 
     *araster = (FT_Raster)&the_raster;
-    FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );
+    FT_ZERO( &the_raster );
 
     return 0;
   }
--- 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 );