diff options
author | Benjamin Otte <otte@redhat.com> | 2017-10-06 21:19:42 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-10-06 21:23:39 +0200 |
commit | 43c212ac28f5f80e10c49590e569b6450098743f (patch) | |
tree | ae5210d90f79d313d3b4c88c88f5e00b87405e0e /gtk/gtkgrid.c | |
parent | 2ac66328a3edc0838c19b49fcb9468c473936c9c (diff) | |
download | gtk+-43c212ac28f5f80e10c49590e569b6450098743f.tar.gz |
build: Enable -Wswitch-enum and -Wswitch-default
This patch makes that work using 1 of 2 options:
1. Add all missing enums to the switch statement
or
2. Cast the switch argument to a uint to avoid having to do that (mostly
for GdkEventType).
I even found a bug while doing that: clearing a GtkImage with a surface
did not notify thae surface property.
The reason for enabling this flag even though it is tedious at times is
that it is very useful when adding values to an enum, because it makes
GTK immediately warn about all the switch statements where this enum is
relevant.
And I expect changes to enums to be frequent during the GTK4 development
cycle.
Diffstat (limited to 'gtk/gtkgrid.c')
-rw-r--r-- | gtk/gtkgrid.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index 73ae2eb5ff..af06a1f76e 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -777,6 +777,8 @@ gtk_grid_request_non_spanning (GtkGridRequest *request, line->natural_above += line->natural - (line->natural_above + line->natural_below); line->natural_below += 0; break; + default: + break; } } } @@ -1357,6 +1359,8 @@ gtk_grid_request_allocate (GtkGridRequest *request, line->allocated_baseline = line->allocation - line->minimum_below; break; + default: + break; } } else |