From eada749e4642ea90300c9c68c226fa76a3e35a75 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 21 Feb 2018 00:35:23 -0800 Subject: [PATCH] Use HB_SET_VALUE_INVALID consistently --- src/hb-ot-layout-common-private.hh | 6 +++--- src/hb-ot-shape.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hb-ot-layout-common-private.hh b/src/hb-ot-layout-common-private.hh index cb66c81ad..c5e7f5217 100644 --- a/src/hb-ot-layout-common-private.hh +++ b/src/hb-ot-layout-common-private.hh @@ -1057,7 +1057,7 @@ struct ClassDefFormat1 if (klass == 0) { /* Match if there's any glyph that is not listed! */ - hb_codepoint_t g = -1; + hb_codepoint_t g = HB_SET_VALUE_INVALID; if (!hb_set_next (glyphs, &g)) return false; if (g < startGlyph) @@ -1128,7 +1128,7 @@ struct ClassDefFormat2 if (klass == 0) { /* Match if there's any glyph that is not listed! */ - hb_codepoint_t g = (hb_codepoint_t) -1; + hb_codepoint_t g = HB_SET_VALUE_INVALID; for (unsigned int i = 0; i < count; i++) { if (!hb_set_next (glyphs, &g)) @@ -1137,7 +1137,7 @@ struct ClassDefFormat2 return true; g = rangeRecord[i].end; } - if (g != (hb_codepoint_t) -1 && hb_set_next (glyphs, &g)) + if (g != HB_SET_VALUE_INVALID && hb_set_next (glyphs, &g)) return true; /* Fall through. */ } diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index fc5dd1084..d9ba0f6b3 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -957,7 +957,7 @@ hb_ot_shape_glyphs_closure (hb_font_t *font, hb_set_t *copy = hb_set_create (); do { copy->set (glyphs); - for (hb_codepoint_t lookup_index = -1; hb_set_next (lookups, &lookup_index);) + for (hb_codepoint_t lookup_index = HB_SET_VALUE_INVALID; hb_set_next (lookups, &lookup_index);) hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs); } while (!copy->is_equal (glyphs)); hb_set_destroy (copy);