Another try at fixing build bots
authorBehdad Esfahbod <behdad@behdad.org>
Fri, 20 Oct 2017 17:57:43 +0000 (13:57 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Fri, 20 Oct 2017 17:57:43 +0000 (13:57 -0400)
hb-ot-shape.cc:287:18: error: comparison of constant 32 with expression of type 'hb_unicode_general_category_t' is always true [-Werror,-Wtautological-constant-out-of-range-compare]

src/hb-private.hh

index 17f798c..333199a 100644 (file)
@@ -1003,8 +1003,8 @@ hb_in_ranges (T u, T lo1, T hi1, T lo2, T hi2, T lo3, T hi3)
  * For example, for testing "x ∈ {x1, x2, x3}" use:
  * (FLAG_UNSAFE(x) & (FLAG(x1) | FLAG(x2) | FLAG(x3)))
  */
-#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((x) < 32) + (1U << (x)))
-#define FLAG_UNSAFE(x) ((x) < 32 ? (1U << (x)) : 0)
+#define FLAG(x) (ASSERT_STATIC_EXPR_ZERO ((unsigned int)(x) < 32) + (1U << (unsigned int)(x)))
+#define FLAG_UNSAFE(x) ((unsigned int)(x) < 32 ? (1U << (unsigned int)(x)) : 0)
 #define FLAG_RANGE(x,y) (ASSERT_STATIC_EXPR_ZERO ((x) < (y)) + FLAG(y+1) - FLAG(x))