Use hb_memset instead of memset consistently
This commit is contained in:
parent
44a892a233
commit
ac0efaf818
|
@ -38,7 +38,7 @@ struct hb_aat_map_t
|
||||||
|
|
||||||
void init ()
|
void init ()
|
||||||
{
|
{
|
||||||
memset (this, 0, sizeof (*this));
|
hb_memset (this, 0, sizeof (*this));
|
||||||
chain_flags.init ();
|
chain_flags.init ();
|
||||||
}
|
}
|
||||||
void fini () { chain_flags.fini (); }
|
void fini () { chain_flags.fini (); }
|
||||||
|
|
|
@ -41,7 +41,7 @@ struct hb_vector_size_t
|
||||||
elt_t& operator [] (unsigned int i) { return v[i]; }
|
elt_t& operator [] (unsigned int i) { return v[i]; }
|
||||||
const elt_t& operator [] (unsigned int i) const { return v[i]; }
|
const elt_t& operator [] (unsigned int i) const { return v[i]; }
|
||||||
|
|
||||||
void clear (unsigned char v = 0) { memset (this, v, sizeof (*this)); }
|
void clear (unsigned char v = 0) { hb_memset (this, v, sizeof (*this)); }
|
||||||
|
|
||||||
template <typename Op>
|
template <typename Op>
|
||||||
hb_vector_size_t process (const Op& op) const
|
hb_vector_size_t process (const Op& op) const
|
||||||
|
@ -116,7 +116,7 @@ struct hb_bit_page_t
|
||||||
*la |= ~(mask (a) - 1);
|
*la |= ~(mask (a) - 1);
|
||||||
la++;
|
la++;
|
||||||
|
|
||||||
memset (la, 0xff, (char *) lb - (char *) la);
|
hb_memset (la, 0xff, (char *) lb - (char *) la);
|
||||||
|
|
||||||
*lb |= ((mask (b) << 1) - 1);
|
*lb |= ((mask (b) << 1) - 1);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ struct hb_bit_page_t
|
||||||
*la &= mask (a) - 1;
|
*la &= mask (a) - 1;
|
||||||
la++;
|
la++;
|
||||||
|
|
||||||
memset (la, 0, (char *) lb - (char *) la);
|
hb_memset (la, 0, (char *) lb - (char *) la);
|
||||||
|
|
||||||
*lb &= ~((mask (b) << 1) - 1);
|
*lb &= ~((mask (b) << 1) - 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -590,8 +590,8 @@ _resume:
|
||||||
case 1:
|
case 1:
|
||||||
#line 38 "hb-buffer-deserialize-json.rl"
|
#line 38 "hb-buffer-deserialize-json.rl"
|
||||||
{
|
{
|
||||||
memset (&info, 0, sizeof (info));
|
hb_memset (&info, 0, sizeof (info));
|
||||||
memset (&pos , 0, sizeof (pos ));
|
hb_memset (&pos , 0, sizeof (pos ));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
|
|
@ -493,8 +493,8 @@ _resume:
|
||||||
case 1:
|
case 1:
|
||||||
#line 38 "hb-buffer-deserialize-text.rl"
|
#line 38 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
memset (&info, 0, sizeof (info));
|
hb_memset (&info, 0, sizeof (info));
|
||||||
memset (&pos , 0, sizeof (pos ));
|
hb_memset (&pos , 0, sizeof (pos ));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
|
@ -548,8 +548,8 @@ _resume:
|
||||||
case 15:
|
case 15:
|
||||||
#line 38 "hb-buffer-deserialize-text.rl"
|
#line 38 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
memset (&info, 0, sizeof (info));
|
hb_memset (&info, 0, sizeof (info));
|
||||||
memset (&pos , 0, sizeof (pos ));
|
hb_memset (&pos , 0, sizeof (pos ));
|
||||||
}
|
}
|
||||||
#line 51 "hb-buffer-deserialize-text.rl"
|
#line 51 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
|
@ -665,8 +665,8 @@ _resume:
|
||||||
case 12:
|
case 12:
|
||||||
#line 38 "hb-buffer-deserialize-text.rl"
|
#line 38 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
memset (&info, 0, sizeof (info));
|
hb_memset (&info, 0, sizeof (info));
|
||||||
memset (&pos , 0, sizeof (pos ));
|
hb_memset (&pos , 0, sizeof (pos ));
|
||||||
}
|
}
|
||||||
#line 51 "hb-buffer-deserialize-text.rl"
|
#line 51 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
|
@ -678,8 +678,8 @@ _resume:
|
||||||
case 14:
|
case 14:
|
||||||
#line 38 "hb-buffer-deserialize-text.rl"
|
#line 38 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
memset (&info, 0, sizeof (info));
|
hb_memset (&info, 0, sizeof (info));
|
||||||
memset (&pos , 0, sizeof (pos ));
|
hb_memset (&pos , 0, sizeof (pos ));
|
||||||
}
|
}
|
||||||
#line 51 "hb-buffer-deserialize-text.rl"
|
#line 51 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
|
@ -717,8 +717,8 @@ _resume:
|
||||||
case 11:
|
case 11:
|
||||||
#line 38 "hb-buffer-deserialize-text.rl"
|
#line 38 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
memset (&info, 0, sizeof (info));
|
hb_memset (&info, 0, sizeof (info));
|
||||||
memset (&pos , 0, sizeof (pos ));
|
hb_memset (&pos , 0, sizeof (pos ));
|
||||||
}
|
}
|
||||||
#line 51 "hb-buffer-deserialize-text.rl"
|
#line 51 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
|
@ -744,8 +744,8 @@ _resume:
|
||||||
case 13:
|
case 13:
|
||||||
#line 38 "hb-buffer-deserialize-text.rl"
|
#line 38 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
memset (&info, 0, sizeof (info));
|
hb_memset (&info, 0, sizeof (info));
|
||||||
memset (&pos , 0, sizeof (pos ));
|
hb_memset (&pos , 0, sizeof (pos ));
|
||||||
}
|
}
|
||||||
#line 51 "hb-buffer-deserialize-text.rl"
|
#line 51 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
|
@ -875,8 +875,8 @@ _again:
|
||||||
case 11:
|
case 11:
|
||||||
#line 38 "hb-buffer-deserialize-text.rl"
|
#line 38 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
memset (&info, 0, sizeof (info));
|
hb_memset (&info, 0, sizeof (info));
|
||||||
memset (&pos , 0, sizeof (pos ));
|
hb_memset (&pos , 0, sizeof (pos ));
|
||||||
}
|
}
|
||||||
#line 51 "hb-buffer-deserialize-text.rl"
|
#line 51 "hb-buffer-deserialize-text.rl"
|
||||||
{
|
{
|
||||||
|
|
|
@ -230,7 +230,7 @@ hb_buffer_t::shift_forward (unsigned int count)
|
||||||
* Ideally, we should at least set Default_Ignorable bits on
|
* Ideally, we should at least set Default_Ignorable bits on
|
||||||
* these, as well as consistent cluster values. But the former
|
* these, as well as consistent cluster values. But the former
|
||||||
* is layering violation... */
|
* is layering violation... */
|
||||||
memset (info + len, 0, (idx + count - len) * sizeof (info[0]));
|
hb_memset (info + len, 0, (idx + count - len) * sizeof (info[0]));
|
||||||
}
|
}
|
||||||
len += count;
|
len += count;
|
||||||
idx += count;
|
idx += count;
|
||||||
|
@ -299,8 +299,8 @@ hb_buffer_t::clear ()
|
||||||
out_len = 0;
|
out_len = 0;
|
||||||
out_info = info;
|
out_info = info;
|
||||||
|
|
||||||
memset (context, 0, sizeof context);
|
hb_memset (context, 0, sizeof context);
|
||||||
memset (context_len, 0, sizeof context_len);
|
hb_memset (context_len, 0, sizeof context_len);
|
||||||
|
|
||||||
deallocate_var_all ();
|
deallocate_var_all ();
|
||||||
serial = 0;
|
serial = 0;
|
||||||
|
@ -345,7 +345,7 @@ hb_buffer_t::add (hb_codepoint_t codepoint,
|
||||||
|
|
||||||
glyph = &info[len];
|
glyph = &info[len];
|
||||||
|
|
||||||
memset (glyph, 0, sizeof (*glyph));
|
hb_memset (glyph, 0, sizeof (*glyph));
|
||||||
glyph->codepoint = codepoint;
|
glyph->codepoint = codepoint;
|
||||||
glyph->mask = 0;
|
glyph->mask = 0;
|
||||||
glyph->cluster = cluster;
|
glyph->cluster = cluster;
|
||||||
|
@ -1432,9 +1432,9 @@ hb_buffer_set_length (hb_buffer_t *buffer,
|
||||||
|
|
||||||
/* Wipe the new space */
|
/* Wipe the new space */
|
||||||
if (length > buffer->len) {
|
if (length > buffer->len) {
|
||||||
memset (buffer->info + buffer->len, 0, sizeof (buffer->info[0]) * (length - buffer->len));
|
hb_memset (buffer->info + buffer->len, 0, sizeof (buffer->info[0]) * (length - buffer->len));
|
||||||
if (buffer->have_positions)
|
if (buffer->have_positions)
|
||||||
memset (buffer->pos + buffer->len, 0, sizeof (buffer->pos[0]) * (length - buffer->len));
|
hb_memset (buffer->pos + buffer->len, 0, sizeof (buffer->pos[0]) * (length - buffer->len));
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer->len = length;
|
buffer->len = length;
|
||||||
|
|
|
@ -976,7 +976,7 @@ hb_feature_from_string (const char *str, int len,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (feature)
|
if (feature)
|
||||||
memset (feature, 0, sizeof (*feature));
|
hb_memset (feature, 0, sizeof (*feature));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1088,7 +1088,7 @@ hb_variation_from_string (const char *str, int len,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (variation)
|
if (variation)
|
||||||
memset (variation, 0, sizeof (*variation));
|
hb_memset (variation, 0, sizeof (*variation));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ hb_font_get_font_h_extents_nil (hb_font_t *font HB_UNUSED,
|
||||||
hb_font_extents_t *extents,
|
hb_font_extents_t *extents,
|
||||||
void *user_data HB_UNUSED)
|
void *user_data HB_UNUSED)
|
||||||
{
|
{
|
||||||
memset (extents, 0, sizeof (*extents));
|
hb_memset (extents, 0, sizeof (*extents));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ hb_font_get_font_v_extents_nil (hb_font_t *font HB_UNUSED,
|
||||||
hb_font_extents_t *extents,
|
hb_font_extents_t *extents,
|
||||||
void *user_data HB_UNUSED)
|
void *user_data HB_UNUSED)
|
||||||
{
|
{
|
||||||
memset (extents, 0, sizeof (*extents));
|
hb_memset (extents, 0, sizeof (*extents));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,7 +409,7 @@ hb_font_get_glyph_extents_nil (hb_font_t *font HB_UNUSED,
|
||||||
hb_glyph_extents_t *extents,
|
hb_glyph_extents_t *extents,
|
||||||
void *user_data HB_UNUSED)
|
void *user_data HB_UNUSED)
|
||||||
{
|
{
|
||||||
memset (extents, 0, sizeof (*extents));
|
hb_memset (extents, 0, sizeof (*extents));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -206,14 +206,14 @@ struct hb_font_t
|
||||||
|
|
||||||
hb_bool_t get_font_h_extents (hb_font_extents_t *extents)
|
hb_bool_t get_font_h_extents (hb_font_extents_t *extents)
|
||||||
{
|
{
|
||||||
memset (extents, 0, sizeof (*extents));
|
hb_memset (extents, 0, sizeof (*extents));
|
||||||
return klass->get.f.font_h_extents (this, user_data,
|
return klass->get.f.font_h_extents (this, user_data,
|
||||||
extents,
|
extents,
|
||||||
!klass->user_data ? nullptr : klass->user_data->font_h_extents);
|
!klass->user_data ? nullptr : klass->user_data->font_h_extents);
|
||||||
}
|
}
|
||||||
hb_bool_t get_font_v_extents (hb_font_extents_t *extents)
|
hb_bool_t get_font_v_extents (hb_font_extents_t *extents)
|
||||||
{
|
{
|
||||||
memset (extents, 0, sizeof (*extents));
|
hb_memset (extents, 0, sizeof (*extents));
|
||||||
return klass->get.f.font_v_extents (this, user_data,
|
return klass->get.f.font_v_extents (this, user_data,
|
||||||
extents,
|
extents,
|
||||||
!klass->user_data ? nullptr : klass->user_data->font_v_extents);
|
!klass->user_data ? nullptr : klass->user_data->font_v_extents);
|
||||||
|
@ -342,7 +342,7 @@ struct hb_font_t
|
||||||
hb_bool_t get_glyph_extents (hb_codepoint_t glyph,
|
hb_bool_t get_glyph_extents (hb_codepoint_t glyph,
|
||||||
hb_glyph_extents_t *extents)
|
hb_glyph_extents_t *extents)
|
||||||
{
|
{
|
||||||
memset (extents, 0, sizeof (*extents));
|
hb_memset (extents, 0, sizeof (*extents));
|
||||||
return klass->get.f.glyph_extents (this, user_data,
|
return klass->get.f.glyph_extents (this, user_data,
|
||||||
glyph,
|
glyph,
|
||||||
extents,
|
extents,
|
||||||
|
|
|
@ -318,7 +318,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
|
||||||
|
|
||||||
#undef ALLOCATE_ARRAY
|
#undef ALLOCATE_ARRAY
|
||||||
|
|
||||||
memset (clusters, 0, sizeof (clusters[0]) * buffer->len);
|
hb_memset (clusters, 0, sizeof (clusters[0]) * buffer->len);
|
||||||
|
|
||||||
hb_codepoint_t *pg = gids;
|
hb_codepoint_t *pg = gids;
|
||||||
clusters[0].cluster = buffer->info[0].cluster;
|
clusters[0].cluster = buffer->info[0].cluster;
|
||||||
|
|
|
@ -45,7 +45,7 @@ void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_o
|
||||||
hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
|
hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
|
||||||
const hb_segment_properties_t &props_)
|
const hb_segment_properties_t &props_)
|
||||||
{
|
{
|
||||||
memset (this, 0, sizeof (*this));
|
hb_memset (this, 0, sizeof (*this));
|
||||||
|
|
||||||
feature_infos.init ();
|
feature_infos.init ();
|
||||||
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
||||||
|
|
|
@ -89,7 +89,7 @@ struct hb_ot_map_t
|
||||||
|
|
||||||
void init ()
|
void init ()
|
||||||
{
|
{
|
||||||
memset (this, 0, sizeof (*this));
|
hb_memset (this, 0, sizeof (*this));
|
||||||
|
|
||||||
features.init ();
|
features.init ();
|
||||||
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
for (unsigned int table_index = 0; table_index < 2; table_index++)
|
||||||
|
|
|
@ -58,7 +58,7 @@ struct hb_pool_t
|
||||||
T* obj = next;
|
T* obj = next;
|
||||||
next = * ((T**) next);
|
next = * ((T**) next);
|
||||||
|
|
||||||
memset (obj, 0, sizeof (T));
|
hb_memset (obj, 0, sizeof (T));
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
|
@ -478,7 +478,7 @@ populate_log_font (LOGFONTW *lf,
|
||||||
hb_font_t *font,
|
hb_font_t *font,
|
||||||
unsigned int font_size)
|
unsigned int font_size)
|
||||||
{
|
{
|
||||||
memset (lf, 0, sizeof (*lf));
|
hb_memset (lf, 0, sizeof (*lf));
|
||||||
lf->lfHeight = - (int) font_size;
|
lf->lfHeight = - (int) font_size;
|
||||||
lf->lfCharSet = DEFAULT_CHARSET;
|
lf->lfCharSet = DEFAULT_CHARSET;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue