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/gtkrevealer.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/gtkrevealer.c')
-rw-r--r-- | gtk/gtkrevealer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c index 4aeffd88a4..df11832fb9 100644 --- a/gtk/gtkrevealer.c +++ b/gtk/gtkrevealer.c @@ -333,14 +333,19 @@ gtk_revealer_get_child_allocation (GtkRevealer *revealer, switch (transition) { - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT: child_allocation->x = - child_allocation->width * (1 - priv->current_pos); break; - case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN: child_allocation->y = - child_allocation->height * (1 - priv->current_pos); break; - default: {} + case GTK_REVEALER_TRANSITION_TYPE_NONE: + case GTK_REVEALER_TRANSITION_TYPE_CROSSFADE: + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT: + case GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP: + default: + break; } } |