summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2018-09-30 05:49:08 -0400
committerBehdad Esfahbod <behdad@behdad.org>2018-09-30 06:08:11 -0400
commit9caa432d0c5c09c8151cfce1e2cc184fbdd89594 (patch)
tree58c2082eef17c23585032b3c1299ed70e11429b6 /util
parent2e728a7d86c714d845524a0722c2b653feb9d915 (diff)
[util] Use HB_FALLTHROUGH
Sure, gcc knows to warn about this as well: ../../util/options.cc:175:17: warning: this statement may fall through [-Wimplicit-fallthrough=] case 1: m.r = m.t; ~~~~^~~~~ ../../util/options.cc:176:5: note: here case 2: m.b = m.t; ^~~~ But HOLY SMOKES, look at clang -Weverything bot message: options.cc:176:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough] case 2: m.b = m.t; ^ options.cc:176:5: note: insert 'HB_FALLTHROUGH;' to silence this warning case 2: m.b = m.t; ^ HB_FALLTHROUGH; Right, it's telling me to insert "HB_FALLTHROUGH;" there!!!!!!!!!
Diffstat (limited to 'util')
-rw-r--r--util/options.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/util/options.cc b/util/options.cc
index 2897ec8f..bfb11b45 100644
--- a/util/options.cc
+++ b/util/options.cc
@@ -172,9 +172,9 @@ parse_margin (const char *name G_GNUC_UNUSED,
view_options_t *view_opts = (view_options_t *) data;
view_options_t::margin_t &m = view_opts->margin;
switch (sscanf (arg, "%lf%*[ ,]%lf%*[ ,]%lf%*[ ,]%lf", &m.t, &m.r, &m.b, &m.l)) {
- case 1: m.r = m.t;
- case 2: m.b = m.t;
- case 3: m.l = m.r;
+ case 1: m.r = m.t; HB_FALLTHROUGH;
+ case 2: m.b = m.t; HB_FALLTHROUGH;
+ case 3: m.l = m.r; HB_FALLTHROUGH;
case 4: return true;
default:
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
@@ -489,7 +489,7 @@ parse_font_size (const char *name G_GNUC_UNUSED,
return true;
}
switch (sscanf (arg, "%lf%*[ ,]%lf", &font_opts->font_size_x, &font_opts->font_size_y)) {
- case 1: font_opts->font_size_y = font_opts->font_size_x;
+ case 1: font_opts->font_size_y = font_opts->font_size_x; HB_FALLTHROUGH;
case 2: return true;
default:
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
@@ -507,7 +507,7 @@ parse_font_ppem (const char *name G_GNUC_UNUSED,
{
font_options_t *font_opts = (font_options_t *) data;
switch (sscanf (arg, "%d%*[ ,]%d", &font_opts->x_ppem, &font_opts->y_ppem)) {
- case 1: font_opts->y_ppem = font_opts->x_ppem;
+ case 1: font_opts->y_ppem = font_opts->x_ppem; HB_FALLTHROUGH;
case 2: return true;
default:
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,