[HarfBuzz] harfbuzz: Branch 'master'

Behdad Esfahbod behdad at kemper.freedesktop.org
Thu Jul 17 15:22:23 PDT 2014


 src/hb-private.hh |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 385cf37cf084198e3aedb4354a7b025938a9f11b
Author: Behdad Esfahbod <behdad at behdad.org>
Date:   Thu Jul 17 18:22:07 2014 -0400

    Fix hb_in_range() unused-var warning on Windows

diff --git a/src/hb-private.hh b/src/hb-private.hh
index 2e2edb2..a451d16 100644
--- a/src/hb-private.hh
+++ b/src/hb-private.hh
@@ -795,7 +795,13 @@ template <> class hb_assert_unsigned_t<unsigned long> {};
 template <typename T> static inline bool
 hb_in_range (T u, T lo, T hi)
 {
-  hb_assert_unsigned_t<T> error_hb_in_range_called_with_signed_type HB_UNUSED;
+  /* The sizeof() is here to force template instantiation.
+   * I'm sure there are better ways to do this but can't think of
+   * one right now.  Declaring a variable won't work as HB_UNUSED
+   * is unsable on some platforms and unused types are less likely
+   * to generate a warning than unused variables. */
+  ASSERT_STATIC (sizeof (hb_assert_unsigned_t<T>) >= 0);
+
   return (u - lo) <= (hi - lo);
 }
 


More information about the HarfBuzz mailing list