ref: b3d5e9cf03dce78e606b79c81cb1f29ce06555d5
parent: bdb10748a79e13ba1ae88571ddafac71fdbde4c7
author: Werner Lemberg <[email protected]>
date: Sun Jul 28 01:05:24 EDT 2002
s/ft_memset/FT_MEM_SET/. s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-28 Werner Lemberg <[email protected]>
+
+ s/ft_memset/FT_MEM_SET/.
+ s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
+
2002-07-27 Werner Lemberg <[email protected]>
* src/sfnt/ttload.c (sfnt_dir_check): Make it work with TTCs.
--- a/src/autohint/ahglyph.c
+++ b/src/autohint/ahglyph.c
@@ -1115,7 +1115,7 @@
edge_limit++;
/* clear all edge fields */
- FT_MEM_SET( edge, 0, sizeof ( *edge ) );
+ FT_MEM_ZERO( edge, sizeof ( *edge ) );
/* add the segment to the new edge's list */
edge->first = seg;
--- a/src/autohint/ahoptim.c
+++ b/src/autohint/ahoptim.c
@@ -814,7 +814,7 @@
FT_Error error;
- FT_MEM_SET( optimizer, 0, sizeof ( *optimizer ) );
+ FT_MEM_ZERO( optimizer, sizeof ( *optimizer ) );
optimizer->outline = outline;
optimizer->memory = memory;
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -202,7 +202,7 @@
if ( new_buckets == NULL )
return;
- FT_MEM_SET( new_buckets, 0, sizeof ( FT_MemNode ) * new_size );
+ FT_MEM_ZERO( new_buckets, sizeof ( FT_MemNode ) * new_size );
for ( i = 0; i < table->size; i++ )
{
@@ -243,7 +243,7 @@
if ( table == NULL )
goto Exit;
- FT_MEM_SET( table, 0, sizeof ( *table ) );
+ FT_MEM_ZERO( table, sizeof ( *table ) );
table->size = FT_MEM_SIZE_MIN;
table->nodes = 0;
@@ -260,7 +260,7 @@
memory->alloc( memory,
table->size * sizeof ( FT_MemNode ) );
if ( table->buckets )
- FT_MEM_SET( table->buckets, 0, sizeof ( FT_MemNode ) * table->size );
+ FT_MEM_ZERO( table->buckets, sizeof ( FT_MemNode ) * table->size );
else
{
memory->free( memory, table );
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -599,7 +599,7 @@
if ( !clazz || !clazz->glyph_prepare )
goto Bad;
- FT_MEM_SET( &dummy, 0, sizeof ( dummy ) );
+ FT_MEM_ZERO( &dummy, sizeof ( dummy ) );
dummy.library = glyph->library;
dummy.format = clazz->glyph_format;
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -211,9 +211,9 @@
}
/* clear all public fields in the glyph slot */
- FT_MEM_SET( &slot->metrics, 0, sizeof ( slot->metrics ) );
- FT_MEM_SET( &slot->outline, 0, sizeof ( slot->outline ) );
- FT_MEM_SET( &slot->bitmap, 0, sizeof ( slot->bitmap ) );
+ FT_MEM_ZERO( &slot->metrics, sizeof ( slot->metrics ) );
+ FT_MEM_ZERO( &slot->outline, sizeof ( slot->outline ) );
+ FT_MEM_ZERO( &slot->bitmap, sizeof ( slot->bitmap ) );
slot->bitmap_left = 0;
slot->bitmap_top = 0;
--- a/src/base/ftutil.c
+++ b/src/base/ftutil.c
@@ -64,7 +64,7 @@
return FT_Err_Out_Of_Memory;
}
- FT_MEM_SET( *P, 0, size );
+ FT_MEM_ZERO( *P, size );
}
else
*P = NULL;
@@ -106,7 +106,7 @@
goto Fail;
if ( size > current )
- FT_MEM_SET( (char*)Q + current, 0, size - current );
+ FT_MEM_ZERO( (char*)Q + current, size - current );
*P = Q;
return FT_Err_Ok;
--- a/src/bdf/bdflib.c
+++ b/src/bdf/bdflib.c
@@ -224,7 +224,7 @@
if ( FT_NEW_ARRAY( ht->table, ht->size ) )
goto Exit;
- FT_MEM_SET( ht->table, 0, sizeof ( hashnode ) * ht->size );
+ FT_MEM_ZERO( ht->table, sizeof ( hashnode ) * ht->size );
for ( i = 0, bp = obp; i < sz; i++, bp++ )
{
@@ -255,7 +255,7 @@
if ( FT_NEW_ARRAY( ht->table, sz ) )
goto Exit;
- FT_MEM_SET( ht->table, 0, sizeof ( hashnode ) * sz );
+ FT_MEM_ZERO( ht->table, sizeof ( hashnode ) * sz );
Exit:
return error;
@@ -427,7 +427,7 @@
}
/* Prepare the separator bitmap. */
- FT_MEM_SET( seps, 0, 32 );
+ FT_MEM_ZERO( seps, 32 );
/* If the very last character of the separator string is a plus, then */
/* set the `mult' flag to indicate that multiple separators should be */
@@ -993,7 +993,7 @@
}
p = font->user_props + font->nuser_props;
- FT_MEM_SET( p, 0, sizeof ( bdf_property_t ) );
+ FT_MEM_ZERO( p, sizeof ( bdf_property_t ) );
n = (unsigned long)( ft_strlen( name ) + 1 );
if ( FT_NEW_ARRAY( p->name, n ) )
@@ -1341,7 +1341,7 @@
}
fp = font->props + font->props_size;
- FT_MEM_SET( fp, 0, sizeof ( bdf_property_t ) );
+ FT_MEM_ZERO( fp, sizeof ( bdf_property_t ) );
font->props_size++;
}
@@ -1599,9 +1599,8 @@
font->glyphs_size,
font->glyphs_size + 64 ) )
goto Exit;
- FT_MEM_SET( font->glyphs + font->glyphs_size,
- 0,
- sizeof ( bdf_glyph_t ) * 64 ); /* FZ inutile */
+ FT_MEM_ZERO( font->glyphs + font->glyphs_size,
+ sizeof ( bdf_glyph_t ) * 64 ); /* FZ inutile */
font->glyphs_size += 64;
}
@@ -2209,7 +2208,7 @@
FT_Error error = BDF_Err_Ok;
- FT_MEM_SET( &p, 0, sizeof ( _bdf_parse_t ) );
+ FT_MEM_ZERO( &p, sizeof ( _bdf_parse_t ) );
p.opts = (bdf_options_t*)( ( opts != 0 ) ? opts : &_bdf_opts );
p.minlb = 32767;
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -357,7 +357,7 @@
/* clear everything */
- FT_MEM_SET( decoder, 0, sizeof ( *decoder ) );
+ FT_MEM_ZERO( decoder, sizeof ( *decoder ) );
/* initialize builder */
cff_builder_init( &decoder->builder, face, size, slot, hinting );
--- a/src/cff/cffload.c
+++ b/src/cff/cffload.c
@@ -1091,7 +1091,7 @@
FT_UShort count;
- FT_MEM_SET( idx, 0, sizeof ( *idx ) );
+ FT_MEM_ZERO( idx, sizeof ( *idx ) );
idx->stream = stream;
if ( !FT_READ_USHORT( count ) &&
@@ -1167,7 +1167,7 @@
FT_FRAME_RELEASE( idx->bytes );
FT_FREE( idx->offsets );
- FT_MEM_SET( idx, 0, sizeof ( *idx ) );
+ FT_MEM_ZERO( idx, sizeof ( *idx ) );
}
}
@@ -1941,7 +1941,7 @@
cff_parser_init( &parser, CFF_CODE_TOPDICT, &font->font_dict );
/* set defaults */
- FT_MEM_SET( top, 0, sizeof ( *top ) );
+ FT_MEM_ZERO( top, sizeof ( *top ) );
top->underline_position = -100;
top->underline_thickness = 50;
@@ -1966,7 +1966,7 @@
if ( top->private_offset && top->private_size )
{
/* set defaults */
- FT_MEM_SET( priv, 0, sizeof ( *priv ) );
+ FT_MEM_ZERO( priv, sizeof ( *priv ) );
priv->blue_shift = 7;
priv->blue_fuzz = 1;
--- a/src/cff/cffobjs.c
+++ b/src/cff/cffobjs.c
@@ -112,7 +112,7 @@
FT_UInt n, count;
- FT_MEM_SET( &priv, 0, sizeof ( priv ) );
+ FT_MEM_ZERO( &priv, sizeof ( priv ) );
count = priv.num_blue_values = cpriv->num_blue_values;
for ( n = 0; n < count; n++ )
--- a/src/cff/cffparse.c
+++ b/src/cff/cffparse.c
@@ -68,7 +68,7 @@
FT_UInt code,
void* object )
{
- FT_MEM_SET( parser, 0, sizeof ( *parser ) );
+ FT_MEM_ZERO( parser, sizeof ( *parser ) );
parser->top = parser->stack;
parser->object_code = code;
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -497,7 +497,7 @@
{
FT_UNUSED( face );
- FT_MEM_SET( loader, 0, sizeof ( *loader ) );
+ FT_MEM_ZERO( loader, sizeof ( *loader ) );
}
--- a/src/cid/cidparse.c
+++ b/src/cid/cidparse.c
@@ -60,7 +60,7 @@
FT_Int buff_len;
- FT_MEM_SET( parser, 0, sizeof ( *parser ) );
+ FT_MEM_ZERO( parser, sizeof ( *parser ) );
psaux->ps_parser_funcs->init( &parser->root, 0, 0, memory );
parser->stream = stream;
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -1124,7 +1124,7 @@
FT_Bool hinting,
T1_Decoder_Callback parse_callback )
{
- FT_MEM_SET( decoder, 0, sizeof ( *decoder ) );
+ FT_MEM_ZERO( decoder, sizeof ( *decoder ) );
/* retrieve PSNames interface from list of current modules */
{
--- a/src/pshinter/pshalgo1.c
+++ b/src/pshinter/pshalgo1.c
@@ -760,7 +760,7 @@
/* initialize hints table */
- ft_memset( &hints, 0, sizeof ( hints ) );
+ FT_MEM_ZERO( &hints, sizeof ( hints ) );
error = psh1_hint_table_init( &hints,
&dim->hints,
&dim->masks,
--- a/src/pshinter/pshalgo2.c
+++ b/src/pshinter/pshalgo2.c
@@ -861,7 +861,7 @@
/* clear all fields */
- ft_memset( glyph, 0, sizeof ( *glyph ) );
+ FT_MEM_ZERO( glyph, sizeof ( *glyph ) );
memory = globals->memory;
--- a/src/pshinter/pshalgo3.c
+++ b/src/pshinter/pshalgo3.c
@@ -753,7 +753,7 @@
/* clear all fields */
- ft_memset( glyph, 0, sizeof ( *glyph ) );
+ FT_MEM_ZERO( glyph, sizeof ( *glyph ) );
memory = globals->memory;
--- a/src/pshinter/pshrec.c
+++ b/src/pshinter/pshrec.c
@@ -797,7 +797,7 @@
ps_hints_init( PS_Hints hints,
FT_Memory memory )
{
- ft_memset( hints, 0, sizeof ( *hints ) );
+ FT_MEM_ZERO( hints, sizeof ( *hints ) );
hints->memory = memory;
return 0;
}
@@ -1132,7 +1132,7 @@
FT_LOCAL_DEF( void )
t1_hints_funcs_init( T1_Hints_FuncsRec* funcs )
{
- ft_memset( (char*)funcs, 0, sizeof ( *funcs ) );
+ FT_MEM_ZERO( (char*)funcs, sizeof ( *funcs ) );
funcs->open = (T1_Hints_OpenFunc) t1_hints_open;
funcs->close = (T1_Hints_CloseFunc) ps_hints_close;
@@ -1197,7 +1197,7 @@
FT_LOCAL_DEF( void )
t2_hints_funcs_init( T2_Hints_FuncsRec* funcs )
{
- ft_memset( funcs, 0, sizeof ( *funcs ) );
+ FT_MEM_ZERO( funcs, sizeof ( *funcs ) );
funcs->open = (T2_Hints_OpenFunc) t2_hints_open;
funcs->close = (T2_Hints_CloseFunc) ps_hints_close;
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -3146,7 +3146,7 @@
*araster = &the_raster;
- FT_MEM_SET( &the_raster, sizeof ( the_raster ), 0 );
+ FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );
ft_black_init( &the_raster );
return 0;
--- a/src/raster/ftrend1.c
+++ b/src/raster/ftrend1.c
@@ -86,7 +86,7 @@
FT_GlyphSlot slot,
FT_BBox* cbox )
{
- FT_MEM_SET( cbox, 0, sizeof ( *cbox ) );
+ FT_MEM_ZERO( cbox, sizeof ( *cbox ) );
if ( slot->format == render->glyph_format )
FT_Outline_Get_CBox( &slot->outline, cbox );
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -2062,7 +2062,7 @@
*araster = (FT_Raster)&the_raster;
- FT_MEM_SET( &the_raster, 0, sizeof ( the_raster ) );
+ FT_MEM_ZERO( &the_raster, sizeof ( the_raster ) );
#ifdef GRAYS_USE_GAMMA
grays_init_gamma( (PRaster)*araster );
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -85,7 +85,7 @@
FT_GlyphSlot slot,
FT_BBox* cbox )
{
- FT_MEM_SET( cbox, 0, sizeof ( *cbox ) );
+ FT_MEM_ZERO( cbox, sizeof ( *cbox ) );
if ( slot->format == render->glyph_format )
FT_Outline_Get_CBox( &slot->outline, cbox );
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -854,7 +854,7 @@
offset = 0;
count = data.length;
- ft_memset( &inc_stream, 0, sizeof ( inc_stream ) );
+ FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) );
FT_Stream_OpenMemory( &inc_stream, data.pointer, data.length );
loader->stream = &inc_stream;
}
@@ -1608,7 +1608,7 @@
}
}
- FT_MEM_SET( &loader, 0, sizeof ( loader ) );
+ FT_MEM_ZERO( &loader, sizeof ( loader ) );
/* update the glyph zone bounds */
{
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -114,7 +114,7 @@
if ( maxPoints > 0 )
maxPoints += 2;
- FT_MEM_SET( zone, 0, sizeof ( *zone ) );
+ FT_MEM_ZERO( zone, sizeof ( *zone ) );
zone->memory = memory;
if ( FT_NEW_ARRAY( zone->org, maxPoints * 2 ) ||
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1626,7 +1626,7 @@
{
FT_UNUSED( face );
- FT_MEM_SET( loader, 0, sizeof ( *loader ) );
+ FT_MEM_ZERO( loader, sizeof ( *loader ) );
loader->num_glyphs = 0;
loader->num_chars = 0;
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -964,7 +964,7 @@
{
FT_UNUSED( face );
- FT_MEM_SET( loader, 0, sizeof ( *loader ) );
+ FT_MEM_ZERO( loader, sizeof ( *loader ) );
loader->num_glyphs = 0;
loader->num_chars = 0;