From d25a2f1496d13846ddaea123ac6fb9807dc5669a Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 23 Dec 2018 20:19:52 -0500 Subject: [PATCH] Fix a few warnings --- src/hb-aat-layout-common.hh | 12 ++++++------ src/hb-iter.hh | 8 ++++---- src/hb-null.hh | 2 +- src/hb-ot-cff1-table.hh | 2 +- src/hb-ot-cff2-table.hh | 2 +- src/hb-subset-cff-common.hh | 3 ++- src/hb.hh | 3 ++- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index 95d6b312a..ef75d7a4a 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -707,22 +707,22 @@ struct ExtendedTypes template static unsigned int offsetToIndex (unsigned int offset, - const void *base, - const T *array) + const void *base HB_UNUSED, + const T *array HB_UNUSED) { return offset; } template static unsigned int byteOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + const void *base HB_UNUSED, + const T *array HB_UNUSED) { return offset / 2; } template static unsigned int wordOffsetToIndex (unsigned int offset, - const void *base, - const T *array) + const void *base HB_UNUSED, + const T *array HB_UNUSED) { return offset; } diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 3930a37a0..c83ccb39b 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -85,8 +85,8 @@ struct hb_iter_t protected: hb_iter_t () {} - hb_iter_t (const hb_iter_t &o) {} - void operator = (const hb_iter_t &o) {} + hb_iter_t (const hb_iter_t &o HB_UNUSED) {} + void operator = (const hb_iter_t &o HB_UNUSED) {} }; /* Base class for sorted iterators. Does not enforce anything. @@ -96,8 +96,8 @@ struct hb_sorted_iter_t : hb_iter_t { protected: hb_sorted_iter_t () {} - hb_sorted_iter_t (const hb_sorted_iter_t &o) : hb_iter_t () {} - void operator = (const hb_sorted_iter_t &o) {} + hb_sorted_iter_t (const hb_sorted_iter_t &o) : hb_iter_t (o) {} + void operator = (const hb_sorted_iter_t &o HB_UNUSED) {} }; /* Mixin to fill in what the subclass doesn't provide. */ diff --git a/src/hb-null.hh b/src/hb-null.hh index 8a3e0d405..204c2fefd 100644 --- a/src/hb-null.hh +++ b/src/hb-null.hh @@ -93,7 +93,7 @@ struct _hb_assign > template static inline void hb_assign (T &o, const V v) -{ _hb_assign >::value (o, v); }; +{ _hb_assign >::value (o, v); } /* diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index ee1327757..0ec671493 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -976,7 +976,7 @@ typedef dict_interpreter_t cff1 typedef CFF1Index CFF1NameIndex; typedef CFF1IndexOf CFF1TopDictIndex; -}; /* namespace CFF */ +} /* namespace CFF */ namespace OT { diff --git a/src/hb-ot-cff2-table.hh b/src/hb-ot-cff2-table.hh index 7b1c6ee4a..8cbc07df3 100644 --- a/src/hb-ot-cff2-table.hh +++ b/src/hb-ot-cff2-table.hh @@ -400,7 +400,7 @@ struct cff2_private_dict_opset_subset_t : dict_opset_t typedef dict_interpreter_t cff2_top_dict_interpreter_t; typedef dict_interpreter_t cff2_font_dict_interpreter_t; -}; /* namespace CFF */ +} /* namespace CFF */ namespace OT { diff --git a/src/hb-subset-cff-common.hh b/src/hb-subset-cff-common.hh index 2cec4d032..915b4c452 100644 --- a/src/hb-subset-cff-common.hh +++ b/src/hb-subset-cff-common.hh @@ -965,7 +965,8 @@ struct subr_subsetter_t private: typedef typename SUBRS::count_type subr_count_type; }; -}; /* namespace CFF */ + +} /* namespace CFF */ HB_INTERNAL bool hb_plan_subset_cff_fdselect (const hb_vector_t &glyphs, diff --git a/src/hb.hh b/src/hb.hh index 18f4e5c31..d604d958e 100644 --- a/src/hb.hh +++ b/src/hb.hh @@ -468,7 +468,8 @@ typedef uint64_t hb_vector_size_impl_t; static inline T& operator |= (T &l, T r) { l = l | r; return l; } \ static inline T& operator &= (T& l, T r) { l = l & r; return l; } \ static inline T& operator ^= (T& l, T r) { l = l ^ r; return l; } \ - } + } \ + static_assert (true, "") /* Useful for set-operations on small enums. * For example, for testing "x ∈ {x1, x2, x3}" use: