diff options
author | Werner Lemberg <wl@gnu.org> | 2016-09-28 19:10:52 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2016-09-28 19:10:52 +0200 |
commit | 45cad2e5e15c08b682e87b5636cccfc941b3fe7d (patch) | |
tree | 0c477a0d4ea494974efeb9a327e75d84dfb88582 /src | |
parent | 2ecf89b481703315bffa8e0b10c2e970224b52e6 (diff) | |
download | freetype2-45cad2e5e15c08b682e87b5636cccfc941b3fe7d.tar.gz |
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/.
Diffstat (limited to 'src')
-rw-r--r-- | src/gxvalid/gxvcommn.c | 2 | ||||
-rw-r--r-- | src/psaux/t1decode.c | 4 | ||||
-rw-r--r-- | src/raster/ftraster.c | 6 | ||||
-rw-r--r-- | src/raster/ftrend1.c | 2 | ||||
-rw-r--r-- | src/smooth/ftgrays.c | 6 | ||||
-rw-r--r-- | src/smooth/ftsmooth.c | 2 |
6 files changed, 14 insertions, 8 deletions
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 @@ -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 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 @@ -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 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 ); |