Commit b3d5e9cf03dce78e606b79c81cb1f29ce06555d5

Werner Lemberg 2002-07-28T05:05:24

s/ft_memset/FT_MEM_SET/. s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
diff --git a/ChangeLog b/ChangeLog
index 6d9ee13..d9c2172 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-07-28  Werner Lemberg  <wl@gnu.org>
+
+	s/ft_memset/FT_MEM_SET/.
+	s/FT_MEM_SET/FT_MEM_ZERO/ where appropriate.
+
 2002-07-27  Werner Lemberg  <wl@gnu.org>
 
 	* 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 5ce8c43..2f0582e 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 6b4cdf0..d06b1bf 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 6ca02da..125b5b7 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 e6bb330..cb1c8ea 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 90b38fa..d679504 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 27dfbf0..451bee5 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 f34760e..89c4a68 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 cf8ac93..6e86db6 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 1ecc241..e50fcaa 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 3b83031..a1b6166 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 732482c..b2c089b 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 95f1965..fe9d724 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 3de73b5..ab4c06a 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 91220fc..9615e1b 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 25e3433..bc73baf 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 b8ece3c..d426589 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 ed849ae..3eb081f 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 208cf78..93a34e1 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 d756563..b149947 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 0b67bbc..83c22d2 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 cafcd2a..08edd20 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 b717926..85a4b86 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 cdefc9b..9efaf82 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 55f9a35..4f1688e 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 00f8d8e..b06c8d8 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 e28bcdb..8bb2e7b 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;