diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index e8bd95c27..59df860df 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -610,8 +610,10 @@ struct HbOpXor template struct hb_vector_size_t { - elt_t& operator [] (unsigned int i) { return u.v[i]; } - const elt_t& operator [] (unsigned int i) const { return u.v[i]; } + inline elt_t& operator [] (unsigned int i) { return u.v[i]; } + inline const elt_t& operator [] (unsigned int i) const { return u.v[i]; } + + inline void clear (unsigned char v = 0) { memset (this, v, sizeof (*this)); } template inline hb_vector_size_t process (const hb_vector_size_t &o) const diff --git a/src/hb-set.hh b/src/hb-set.hh index 2dfcc242a..947e8d9d1 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -53,8 +53,8 @@ struct hb_set_t struct page_t { - inline void init0 (void) { memset (reinterpret_cast(&v), 0, sizeof (v)); } - inline void init1 (void) { memset (reinterpret_cast(&v), 0xff, sizeof (v)); } + inline void init0 (void) { v.clear (); } + inline void init1 (void) { v.clear (0xFF); } inline unsigned int len (void) const { return ARRAY_LENGTH_CONST (v); }