From aacca37590656e235218557ea509eb5624dfbff9 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Mon, 17 Apr 2017 23:25:24 -0700 Subject: [PATCH] Fix clang -Wcomma warnings (#471) (#472) clang's new -Wcomma compiler option warns about possible misuse of the comma operator such as between two statements. hb-common.cc:190:9 [-Wcomma] possible misuse of comma operator here hb-ot-layout-gsubgpos-private.hh:345:30 [-Wcomma] possible misuse of comma operator here hb-shape-plan.cc:438:26 [-Wcomma] possible misuse of comma operator here --- src/hb-common.cc | 6 ++++-- src/hb-ot-layout-gsubgpos-private.hh | 2 +- src/hb-shape-plan.cc | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/hb-common.cc b/src/hb-common.cc index 1665730..3900623 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -186,8 +186,10 @@ lang_equal (hb_language_t v1, const unsigned char *p1 = (const unsigned char *) v1; const unsigned char *p2 = (const unsigned char *) v2; - while (*p1 && *p1 == canon_map[*p2]) - p1++, p2++; + while (*p1 && *p1 == canon_map[*p2]) { + p1++; + p2++; + } return *p1 == canon_map[*p2]; } diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index f9fcec5..921859a 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -342,7 +342,7 @@ struct hb_apply_context_t : inline void init (hb_apply_context_t *c_, bool context_match = false) { c = c_; - match_glyph_data = NULL, + match_glyph_data = NULL; matcher.set_match_func (NULL, NULL); matcher.set_lookup_props (c->lookup_props); /* Ignore ZWNJ if we are matching GSUB context, or matching GPOS. */ diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index 1ac77be..6173766 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -431,11 +431,12 @@ static inline hb_bool_t hb_non_global_user_features_present (const hb_feature_t *user_features, unsigned int num_user_features) { - while (num_user_features) + while (num_user_features) { if (user_features->start != 0 || user_features->end != (unsigned int) -1) return true; - else - num_user_features--, user_features++; + num_user_features--; + user_features++; + } return false; } -- 2.7.4