diff --git a/ChangeLog b/ChangeLog index 6d9ee139b..d9c21725c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-07-28 Werner Lemberg + + s/ft_memset/FT_MEM_SET/. + s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate. + 2002-07-27 Werner Lemberg * src/sfnt/ttload.c (sfnt_dir_check): Make it work with TTCs. diff --git a/src/autohint/ahglyph.c b/src/autohint/ahglyph.c index 5ce8c4323..2f0582e91 100644 --- 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; diff --git a/src/autohint/ahoptim.c b/src/autohint/ahoptim.c index 6b4cdf0c6..d06b1bfd2 100644 --- 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; diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c index 6ca02dadf..125b5b70a 100644 --- 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 ); diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c index e6bb33036..cb1c8ea6a 100644 --- 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; diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 90b38faff..d6795043f 100644 --- 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; diff --git a/src/base/ftutil.c b/src/base/ftutil.c index 27dfbf049..451bee524 100644 --- 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; diff --git a/src/bdf/bdflib.c b/src/bdf/bdflib.c index f34760e54..89c4a6835 100644 --- 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; diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c index cf8ac9313..6e86db657 100644 --- 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 ); diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 1ecc24186..e50fcaa4d 100644 --- 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; diff --git a/src/cff/cffobjs.c b/src/cff/cffobjs.c index 3b8303167..a1b6166c3 100644 --- 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++ ) diff --git a/src/cff/cffparse.c b/src/cff/cffparse.c index 732482c0b..b2c089bcd 100644 --- 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; diff --git a/src/cid/cidload.c b/src/cid/cidload.c index 95f1965c2..fe9d724e8 100644 --- 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 ) ); } diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c index 3de73b5b3..ab4c06a44 100644 --- 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; diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c index 91220fc33..9615e1bf9 100644 --- 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 */ { diff --git a/src/pshinter/pshalgo1.c b/src/pshinter/pshalgo1.c index 25e343317..bc73baf46 100644 --- 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, diff --git a/src/pshinter/pshalgo2.c b/src/pshinter/pshalgo2.c index b8ece3cf2..d42658932 100644 --- 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; diff --git a/src/pshinter/pshalgo3.c b/src/pshinter/pshalgo3.c index ed849ae2a..3eb081f1a 100644 --- 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; diff --git a/src/pshinter/pshrec.c b/src/pshinter/pshrec.c index 208cf78d4..93a34e10e 100644 --- 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; diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index d756563e1..b14994766 100644 --- 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; diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c index 0b67bbcb5..83c22d259 100644 --- 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 ); diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index cafcd2a7f..08edd2055 100644 --- 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 ); diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index b717926db..85a4b8659 100644 --- 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 ); diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index cdefc9b5d..9efaf82cf 100644 --- 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 */ { diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index 55f9a35f3..4f1688ec7 100644 --- 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 ) || diff --git a/src/type1/t1load.c b/src/type1/t1load.c index 00f8d8eb6..b06c8d838 100644 --- 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; diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c index e28bcdb79..8bb2e7ba6 100644 --- 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;