From 45cad2e5e15c08b682e87b5636cccfc941b3fe7d Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Wed, 28 Sep 2016 19:10:52 +0200 Subject: [PATCH] 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/. --- ChangeLog | 20 ++++++++++++++++++++ src/gxvalid/gxvcommn.c | 2 +- src/psaux/t1decode.c | 4 +--- src/raster/ftraster.c | 6 +++++- src/raster/ftrend1.c | 2 +- src/smooth/ftgrays.c | 6 +++++- src/smooth/ftsmooth.c | 2 +- 7 files changed, 34 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f5a88f7db..e0bdc71fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2016-09-28 Werner Lemberg + + 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 */*: s/FT_MEM_ZERO/FT_ZERO/ where appropriate. diff --git a/src/gxvalid/gxvcommn.c b/src/gxvalid/gxvcommn.c index 4b5e41539..65f793c51 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 493e3bdf7..4a32b8257 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 73c2fbf43..7b9abe6a0 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -249,6 +249,10 @@ #ifndef FT_MEM_ZERO #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 */ @@ -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 c456dc52d..5bd4b30c8 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 7558312fc..114657e7e 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -284,6 +284,10 @@ typedef ptrdiff_t FT_PtrDist; #ifndef FT_MEM_ZERO #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 :-) */ @@ -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 866427e52..137179235 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 );