From 35b64dfb57cac0d949363e9b19352dd4274c2584 Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Tue, 2 Oct 2018 14:13:36 -0700 Subject: [PATCH] silence & fix new warnings --- src/hb-cff-interp-dict-common.hh | 3 ++- src/hb-cff1-interp-cs.hh | 9 +++++---- src/hb-ot-cff-common.hh | 4 ++-- src/hb-subset-cff1.cc | 4 ++-- src/hb-subset-cff2.cc | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/hb-cff-interp-dict-common.hh b/src/hb-cff-interp-dict-common.hh index acbc8cd83..21db5fd46 100644 --- a/src/hb-cff-interp-dict-common.hh +++ b/src/hb-cff-interp-dict-common.hh @@ -210,7 +210,8 @@ struct DictOpSet : OpSet case EXP_NEG: exp_neg = true; - /* NO BREAK */ + HB_FALLTHROUGH; + case EXP_POS: if (part == EXP_PART) return false; part = EXP_PART; diff --git a/src/hb-cff1-interp-cs.hh b/src/hb-cff1-interp-cs.hh index f618ef844..09c51d3f6 100644 --- a/src/hb-cff1-interp-cs.hh +++ b/src/hb-cff1-interp-cs.hh @@ -145,8 +145,9 @@ struct CFF1CSOpSet : CSOpSet } break; case OpCode_random: - if (unlikely (!env.argStack.check_overflow (1))) return false; - env.argStack.push_int (1); /* we can't deal with random behavior; make it constant */ + if (unlikely (!env.argStack.check_overflow (1))) return false; + env.argStack.push_int (1); /* we can't deal with random behavior; make it constant */ + break; case OpCode_mul: if (unlikely (!env.argStack.check_pop_num2 (n1, n2))) return false; env.argStack.push_real (n1.to_real() * n2.to_real()); @@ -170,7 +171,7 @@ struct CFF1CSOpSet : CSOpSet if (unlikely (!env.argStack.check_pop_num (n1))) return false; int i = n1.to_int (); if (i < 0) i = 0; - if (unlikely (i >= env.argStack.get_count () || !env.argStack.check_overflow (1))) return false; + if (unlikely ((unsigned int)i >= env.argStack.get_count () || !env.argStack.check_overflow (1))) return false; env.argStack.push (env.argStack[env.argStack.get_count () - i - 1]); } break; @@ -179,7 +180,7 @@ struct CFF1CSOpSet : CSOpSet if (unlikely (!env.argStack.check_pop_num2 (n1, n2))) return false; int n = n1.to_int (); int j = n2.to_int (); - if (unlikely (n < 0 || n > env.argStack.get_count ())) return false; + if (unlikely (n < 0 || (unsigned int)n > env.argStack.get_count ())) return false; if (likely (n > 0)) { if (j < 0) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index 32c83b0a0..a7ff1972b 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -138,7 +138,7 @@ struct CFFIndex } } - inline const unsigned int offset_at (unsigned int index) const + inline unsigned int offset_at (unsigned int index) const { assert (index <= count); const HBUINT8 *p = offsets + offSize * index; @@ -149,7 +149,7 @@ struct CFFIndex return offset; } - inline const unsigned int length_at (unsigned int index) const + inline unsigned int length_at (unsigned int index) const { return offset_at (index + 1) - offset_at (index); } inline const char *data_base (void) const diff --git a/src/hb-subset-cff1.cc b/src/hb-subset-cff1.cc index 3e9b34169..ce3a7e3f0 100644 --- a/src/hb-subset-cff1.cc +++ b/src/hb-subset-cff1.cc @@ -293,8 +293,8 @@ struct CFF1CSOpSet_Flatten : CFF1CSOpSet env.clear_args (); return; } - /* NO BREAK */ - + HB_FALLTHROUGH; + default: SUPER::flush_args_and_op (op, env, param, start_arg); break; diff --git a/src/hb-subset-cff2.cc b/src/hb-subset-cff2.cc index 705574c92..2bf27a692 100644 --- a/src/hb-subset-cff2.cc +++ b/src/hb-subset-cff2.cc @@ -101,8 +101,8 @@ struct CFF2CSOpSet_Flatten : CFF2CSOpSet env.clear_args (); return; } - /* NO BREAK */ - + HB_FALLTHROUGH; + default: SUPER::flush_args_and_op (op, env, param, start_arg); break;