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
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 @@
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 @@
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 @@
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;
}