[set] Warning fix with gcc 8.1

https://github.com/harfbuzz/harfbuzz/pull/1334
This commit is contained in:
Behdad Esfahbod 2018-10-31 10:42:49 -07:00
parent 850a7af3a4
commit 5854d3fa25
2 changed files with 6 additions and 4 deletions

View File

@ -610,8 +610,10 @@ struct HbOpXor
template <typename elt_t, unsigned int byte_size>
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 <class Op>
inline hb_vector_size_t process (const hb_vector_size_t &o) const

View File

@ -53,8 +53,8 @@ struct hb_set_t
struct page_t
{
inline void init0 (void) { memset (reinterpret_cast<char*>(&v), 0, sizeof (v)); }
inline void init1 (void) { memset (reinterpret_cast<char*>(&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); }