[gtk+] build: Enable -Wswitch-enum and -Wswitch-default



commit 43c212ac28f5f80e10c49590e569b6450098743f
Author: Benjamin Otte <otte redhat com>
Date:   Fri Oct 6 21:19:42 2017 +0200

    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.

 gdk/broadway/gdkwindow-broadway.c |    5 ++
 gdk/gdkdevice.c                   |    4 +-
 gdk/gdkdnd.c                      |    2 +-
 gdk/gdkevents.c                   |   56 +++++++++----------------
 gdk/gdkframeclockidle.c           |    1 +
 gdk/gdkgl.c                       |    3 +-
 gdk/gdkkeys.c                     |    3 +
 gdk/gdkseatdefault.c              |    7 +++-
 gdk/gdkvulkancontext.c            |    6 +++
 gdk/gdkwindow.c                   |    6 ++-
 gdk/wayland/gdkdevice-wayland.c   |    7 +++-
 gdk/wayland/gdkdnd-wayland.c      |    2 +-
 gdk/wayland/gdkkeys-wayland.c     |    5 ++
 gdk/wayland/gdkscreen-wayland.c   |    6 +-
 gdk/wayland/gdkwindow-wayland.c   |    8 +++-
 gdk/x11/gdkasync.c                |    2 +
 gdk/x11/gdkdevice-xi2.c           |    2 +-
 gdk/x11/gdkdevicemanager-xi2.c    |    2 +-
 gdk/x11/gdkdisplay-x11.c          |    7 +++
 gdk/x11/gdkdnd-x11.c              |   28 ++++++++++++-
 gdk/x11/gdkkeys-x11.c             |   17 ++++----
 gdk/x11/gdkmain-x11.c             |    7 +--
 gdk/x11/gdkvisual-x11.c           |    3 +
 gdk/x11/gdkwindow-x11.c           |   12 +++++-
 gsk/gskglrenderer.c               |   14 ++++++
 gsk/gskrenderer.c                 |    8 ++++
 gsk/gskvulkanclip.c               |    8 ++++
 gsk/gskvulkanrenderpass.c         |    4 +-
 gtk/a11y/gtkimageaccessible.c     |    2 +
 gtk/gtkbbox.c                     |    3 +
 gtk/gtkbindings.c                 |    8 ++--
 gtk/gtkbookmarksmanager.c         |    7 +++
 gtk/gtkbox.c                      |    6 +++
 gtk/gtkcalendar.c                 |    2 +
 gtk/gtkcellrenderertext.c         |    9 +++-
 gtk/gtkcenterbox.c                |    3 +
 gtk/gtkcombobox.c                 |    2 +
 gtk/gtkcontainer.c                |    7 +--
 gtk/gtkcsscolorvalue.c            |    5 ++
 gtk/gtkcssimagebuiltin.c          |    2 +-
 gtk/gtkcssstyle.c                 |   18 ++++++--
 gtk/gtkcssstylefuncs.c            |    2 +
 gtk/gtkcsstypes.c                 |    2 +
 gtk/gtkcsswin32sizevalue.c        |    4 ++
 gtk/gtkdnd.c                      |    7 ++-
 gtk/gtkentry.c                    |   10 ++++-
 gtk/gtkeventcontrollerscroll.c    |    1 +
 gtk/gtkexpander.c                 |   11 ++++-
 gtk/gtkfilechooserbutton.c        |    4 ++
 gtk/gtkfilechooserentry.c         |    2 +
 gtk/gtkfilechoosernative.c        |    2 +
 gtk/gtkfilechooserwidget.c        |    1 +
 gtk/gtkfilefilter.c               |    5 ++
 gtk/gtkfilesystemmodel.c          |    4 ++
 gtk/gtkflowbox.c                  |   21 ++++++++-
 gtk/gtkfontbutton.c               |    8 ++++
 gtk/gtkgesture.c                  |    2 +-
 gtk/gtkgesturesingle.c            |    2 +-
 gtk/gtkgrid.c                     |    4 ++
 gtk/gtkiconhelper.c               |    4 ++
 gtk/gtkicontheme.c                |   17 +++++---
 gtk/gtkiconview.c                 |   10 ++++-
 gtk/gtkimage.c                    |    3 +
 gtk/gtkkineticscrolling.c         |    1 +
 gtk/gtklabel.c                    |    6 +++
 gtk/gtklistbox.c                  |    6 ++-
 gtk/gtkmain.c                     |   14 +++++--
 gtk/gtkmenu.c                     |   17 +++++---
 gtk/gtkmenubar.c                  |    5 ++-
 gtk/gtkmenubutton.c               |   11 +++++
 gtk/gtkmenuitem.c                 |    3 +
 gtk/gtkmenushell.c                |    3 +
 gtk/gtknotebook.c                 |   82 ++++++++++++++++++++++++++++++------
 gtk/gtkoverlay.c                  |    3 +
 gtk/gtkpadcontroller.c            |    2 +-
 gtk/gtkpagesetupunixdialog.c      |    2 +
 gtk/gtkpaned.c                    |    2 +
 gtk/gtkpango.c                    |   30 +++++++++++++
 gtk/gtkpathbar.c                  |    4 ++
 gtk/gtkplacessidebar.c            |    1 +
 gtk/gtkpopover.c                  |    4 ++
 gtk/gtkprinteroptionwidget.c      |    8 ++++
 gtk/gtkprintoperation-portal.c    |    3 +
 gtk/gtkprintoperation-unix.c      |    2 +
 gtk/gtkprintoperation.c           |    3 +-
 gtk/gtkprintutils.c               |    2 +
 gtk/gtkrange.c                    |    3 +-
 gtk/gtkrecentfilter.c             |    3 +
 gtk/gtkrecentmanager.c            |    9 ++++
 gtk/gtkrender.c                   |    4 ++
 gtk/gtkrevealer.c                 |   11 ++++-
 gtk/gtkscale.c                    |    3 +
 gtk/gtkscrolledwindow.c           |   12 +++++
 gtk/gtksettings.c                 |    3 +
 gtk/gtkshortcutsshortcut.c        |    4 +-
 gtk/gtkspinbutton.c               |    2 +
 gtk/gtkstack.c                    |   52 ++++++++++++++++++++---
 gtk/gtktextbuffer.c               |   11 +++++
 gtk/gtktextbufferserialize.c      |   15 ++-----
 gtk/gtktextlayout.c               |    9 ++++-
 gtk/gtktexttag.c                  |   64 ++++++++++++++---------------
 gtk/gtktextview.c                 |   39 +++++++++++------
 gtk/gtktoolbar.c                  |    4 ++
 gtk/gtktoolbutton.c               |    1 +
 gtk/gtktoolitemgroup.c            |    4 ++
 gtk/gtktooltip.c                  |    2 +-
 gtk/gtktreeselection.c            |    3 +
 gtk/gtktreeview.c                 |   14 +++++-
 gtk/gtktreeviewcolumn.c           |    2 +-
 gtk/gtkwidget.c                   |   20 ++++++++-
 gtk/gtkwindow.c                   |   20 +++++++++
 gtk/inspector/recorder.c          |   11 +++++-
 meson.build                       |    2 +
 113 files changed, 769 insertions(+), 207 deletions(-)
---
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 17075bb..44bc9ec 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -1101,6 +1101,8 @@ update_pos (MoveResizeData *mv_resize,
          x += dx;
          w -= dx;
          break;
+        default:
+          break;
        }
 
       x = MAX (x, 0);
@@ -1228,6 +1230,8 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
       if (event->button.button == mv_resize->moveresize_button)
        finish_drag (mv_resize);
       break;
+    default:
+      break;
     }
   return TRUE;
 }
@@ -1349,6 +1353,7 @@ calculate_unmoving_origin (MoveResizeData *mv_resize)
          mv_resize->moveresize_orig_x = rect.x + rect.width - width;
          mv_resize->moveresize_orig_y = rect.y + rect.height - height;
          break;
+        case GDK_GRAVITY_STATIC:
        default:
          mv_resize->moveresize_orig_x = rect.x;
          mv_resize->moveresize_orig_y = rect.y;
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index fd918f3..d44df42 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -1051,7 +1051,7 @@ gdk_device_set_axis_use (GdkDevice   *device,
   info = &g_array_index (device->axes, GdkAxisInfo, index_);
   info->use = use;
 
-  switch (use)
+  switch ((guint) use)
     {
     case GDK_AXIS_X:
     case GDK_AXIS_Y:
@@ -1574,7 +1574,7 @@ _gdk_device_add_axis (GdkDevice   *device,
   axis_info.max_value = max_value;
   axis_info.resolution = resolution;
 
-  switch (use)
+  switch ((guint) use)
     {
     case GDK_AXIS_X:
     case GDK_AXIS_Y:
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c
index b52311a..f6cddd5 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -789,7 +789,7 @@ gdk_drag_context_handle_dest_event (GdkEvent *event)
   GdkDragContext *context = NULL;
   GList *l;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_DRAG_MOTION:
     case GDK_DROP_START:
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index a2ffcf5..65bd821 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -520,7 +520,7 @@ gdk_event_new (GdkEventType type)
    * since I trust bytewise 0 == 0. less than for integers
    * or pointers.
    */
-  switch (type)
+  switch ((guint) type)
     {
     case GDK_MOTION_NOTIFY:
       new_event->motion.x = 0.;
@@ -666,7 +666,7 @@ gdk_event_copy (const GdkEvent *event)
       g_set_object (&new_private->user_data, private->user_data);
     }
 
-  switch (event->any.type)
+  switch ((guint) event->any.type)
     {
     case GDK_KEY_PRESS:
     case GDK_KEY_RELEASE:
@@ -769,7 +769,7 @@ gdk_event_free (GdkEvent *event)
       g_clear_object (&private->user_data);
     }
 
-  switch (event->any.type)
+  switch ((guint) event->any.type)
     {
     case GDK_KEY_PRESS:
     case GDK_KEY_RELEASE:
@@ -940,6 +940,7 @@ gdk_event_get_time (const GdkEvent *event)
       case GDK_OWNER_CHANGE:
       case GDK_GRAB_BROKEN:
       case GDK_EVENT_LAST:
+      default:
         /* return current time */
         break;
       }
@@ -1031,6 +1032,7 @@ gdk_event_get_state (const GdkEvent        *event,
       case GDK_PAD_STRIP:
       case GDK_PAD_GROUP_MODE:
       case GDK_EVENT_LAST:
+      default:
         /* no state field */
         break;
       }
@@ -1059,7 +1061,7 @@ gdk_event_get_coords (const GdkEvent *event,
   
   g_return_val_if_fail (event != NULL, FALSE);
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_CONFIGURE:
       x = event->configure.x;
@@ -1131,7 +1133,7 @@ gdk_event_get_root_coords (const GdkEvent *event,
   
   g_return_val_if_fail (event != NULL, FALSE);
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_MOTION_NOTIFY:
       x = event->motion.x_root;
@@ -1195,7 +1197,7 @@ gdk_event_set_coords (GdkEvent *event,
 {
   g_return_if_fail (event != NULL);
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_CONFIGURE:
       event->configure.x = x;
@@ -1259,7 +1261,7 @@ gdk_event_get_button (const GdkEvent *event,
 
   g_return_val_if_fail (event != NULL, FALSE);
   
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_BUTTON_PRESS:
     case GDK_BUTTON_RELEASE:
@@ -1300,7 +1302,7 @@ gdk_event_get_click_count (const GdkEvent *event,
 
   g_return_val_if_fail (event != NULL, FALSE);
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_BUTTON_PRESS:
     case GDK_BUTTON_RELEASE:
@@ -1335,7 +1337,7 @@ gdk_event_get_keyval (const GdkEvent *event,
   gboolean fetched = TRUE;
   guint number = 0;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_KEY_PRESS:
     case GDK_KEY_RELEASE:
@@ -1381,7 +1383,7 @@ gdk_event_get_keycode (const GdkEvent *event,
   gboolean fetched = TRUE;
   guint16 number = 0;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_KEY_PRESS:
     case GDK_KEY_RELEASE:
@@ -1411,7 +1413,7 @@ gdk_event_get_key_group (const GdkEvent *event,
 {
   gboolean fetched = TRUE;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_KEY_PRESS:
     case GDK_KEY_RELEASE:
@@ -1439,7 +1441,7 @@ gdk_event_get_string (const GdkEvent  *event,
 {
   gboolean fetched = TRUE;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_KEY_PRESS:
     case GDK_KEY_RELEASE:
@@ -1467,7 +1469,7 @@ gdk_event_get_key_is_modifier (const GdkEvent *event,
 {
   gboolean fetched = TRUE;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_KEY_PRESS:
     case GDK_KEY_RELEASE:
@@ -1500,7 +1502,7 @@ gdk_event_get_scroll_direction (const GdkEvent *event,
   gboolean fetched = TRUE;
   GdkScrollDirection dir = 0;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_SCROLL:
       if (event->scroll.direction == GDK_SCROLL_SMOOTH)
@@ -1540,7 +1542,7 @@ gdk_event_get_scroll_deltas (const GdkEvent *event,
   gdouble dx = 0.0;
   gdouble dy = 0.0;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_SCROLL:
       if (event->scroll.direction == GDK_SCROLL_SMOOTH)
@@ -1612,7 +1614,7 @@ gdk_event_get_axis (const GdkEvent *event,
     {
       gdouble x, y;
       
-      switch (event->type)
+      switch ((guint) event->type)
        {
         case GDK_MOTION_NOTIFY:
          x = event->motion.x;
@@ -1699,7 +1701,7 @@ gdk_event_set_device (GdkEvent  *event,
 
   g_set_object (&private->device, device);
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_MOTION_NOTIFY:
       event->motion.device = device;
@@ -1750,7 +1752,7 @@ gdk_event_get_device (const GdkEvent *event)
         return private->device;
     }
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_MOTION_NOTIFY:
       return event->motion.device;
@@ -1767,32 +1769,15 @@ gdk_event_get_device (const GdkEvent *event)
     case GDK_PROXIMITY_IN:
     case GDK_PROXIMITY_OUT:
       return event->proximity.device;
-    default:
-      break;
-    }
-
-  /* Fallback if event has no device set */
-  switch (event->type)
-    {
-    case GDK_MOTION_NOTIFY:
-    case GDK_BUTTON_PRESS:
-    case GDK_BUTTON_RELEASE:
-    case GDK_TOUCH_BEGIN:
-    case GDK_TOUCH_UPDATE:
-    case GDK_TOUCH_END:
-    case GDK_TOUCH_CANCEL:
     case GDK_ENTER_NOTIFY:
     case GDK_LEAVE_NOTIFY:
     case GDK_FOCUS_CHANGE:
-    case GDK_PROXIMITY_IN:
-    case GDK_PROXIMITY_OUT:
     case GDK_DRAG_ENTER:
     case GDK_DRAG_LEAVE:
     case GDK_DRAG_MOTION:
     case GDK_DRAG_STATUS:
     case GDK_DROP_START:
     case GDK_DROP_FINISHED:
-    case GDK_SCROLL:
     case GDK_GRAB_BROKEN:
     case GDK_KEY_PRESS:
     case GDK_KEY_RELEASE:
@@ -2255,6 +2240,7 @@ _gdk_set_window_state (GdkWindow      *window,
     case GDK_WINDOW_FOREIGN:
     case GDK_WINDOW_ROOT:
     case GDK_WINDOW_CHILD:
+    default:
       break;
     }
 }
diff --git a/gdk/gdkframeclockidle.c b/gdk/gdkframeclockidle.c
index 12897f4..0af296c 100644
--- a/gdk/gdkframeclockidle.c
+++ b/gdk/gdkframeclockidle.c
@@ -447,6 +447,7 @@ gdk_frame_clock_paint_idle (void *data)
             }
           /* fallthrough */
         case GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS:
+        default:
           ;
         }
     }
diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c
index 3a175b6..b831428 100644
--- a/gdk/gdkgl.c
+++ b/gdk/gdkgl.c
@@ -47,8 +47,9 @@ get_vertex_type_name (int type)
       return "geometry";
     case GL_FRAGMENT_SHADER:
       return "fragment";
+    default:
+      return "unknown";
     }
-  return "unknown";
 }
 
 static guint
diff --git a/gdk/gdkkeys.c b/gdk/gdkkeys.c
index 467e063..cc1c914 100644
--- a/gdk/gdkkeys.c
+++ b/gdk/gdkkeys.c
@@ -859,6 +859,9 @@ gdk_keyval_convert_case (guint symbol,
                symbol != GDK_KEY_Greek_finalsmallsigma)
         xupper -= (GDK_KEY_Greek_alpha - GDK_KEY_Greek_ALPHA);
       break;
+
+    default:
+      break;
     }
 
   if (lower)
diff --git a/gdk/gdkseatdefault.c b/gdk/gdkseatdefault.c
index 91a42cd..cd6dc8a 100644
--- a/gdk/gdkseatdefault.c
+++ b/gdk/gdkseatdefault.c
@@ -194,7 +194,7 @@ gdk_seat_default_get_master (GdkSeat             *seat,
   priv = gdk_seat_default_get_instance_private (GDK_SEAT_DEFAULT (seat));
 
   /* There must be only one flag set */
-  switch (capability)
+  switch ((guint) capability)
     {
     case GDK_SEAT_CAPABILITY_POINTER:
     case GDK_SEAT_CAPABILITY_TOUCH:
@@ -224,6 +224,11 @@ device_get_capability (GdkDevice *device)
       return GDK_SEAT_CAPABILITY_TOUCH;
     case GDK_SOURCE_MOUSE:
     case GDK_SOURCE_TOUCHPAD:
+    case GDK_SOURCE_PEN:
+    case GDK_SOURCE_ERASER:
+    case GDK_SOURCE_CURSOR:
+    case GDK_SOURCE_TRACKPOINT:
+    case GDK_SOURCE_TABLET_PAD:
     default:
       return GDK_SEAT_CAPABILITY_POINTER;
     }
diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c
index 79e067d..52cd263 100644
--- a/gdk/gdkvulkancontext.c
+++ b/gdk/gdkvulkancontext.c
@@ -118,6 +118,12 @@ gdk_vulkan_strerror (VkResult result)
       return "A surface has changed in such a way that it is no longer compatible with the swapchain.";
     case VK_ERROR_INCOMPATIBLE_DISPLAY_KHR:
       return "The display used by a swapchain does not use the same presentable image layout, or is 
incompatible in a way that prevents sharing an image.";
+    case VK_ERROR_VALIDATION_FAILED_EXT:
+      return "The application caused the validation layer to fail.";
+    case VK_ERROR_INVALID_SHADER_NV:
+      return "One or more shaders failed to compile or link.";
+    case VK_RESULT_RANGE_SIZE:
+    case VK_RESULT_MAX_ENUM:
     default:
       return "Unknown Vulkan error.";
   }
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 045f26d..6aad9e8 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1384,6 +1384,10 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
 
   switch (window->window_type)
     {
+    default:
+      g_assert_not_reached ();
+      break;
+
     case GDK_WINDOW_ROOT:
       if (!screen->closed)
        {
@@ -5626,7 +5630,7 @@ _gdk_make_event (GdkWindow    *window,
   if (event_in_queue && event_in_queue->any.send_event)
     event->any.send_event = TRUE;
 
-  switch (type)
+  switch ((guint) type)
     {
     case GDK_MOTION_NOTIFY:
       event->motion.time = the_time;
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 61a4d50..31f2f08 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1753,6 +1753,8 @@ get_axis_source_name (enum wl_pointer_axis_source source)
       return "finger";
     case WL_POINTER_AXIS_SOURCE_CONTINUOUS:
       return "continuous";
+    case WL_POINTER_AXIS_SOURCE_WHEEL_TILT:
+      return "wheel-tilt";
     default:
       return "unknown";
     }
@@ -3288,6 +3290,7 @@ get_scroll_device (GdkWaylandSeat              *seat,
         }
       return seat->continuous_scrolling;
 
+    case WL_POINTER_AXIS_SOURCE_WHEEL_TILT:
     default:
       return seat->pointer;
     }
@@ -3390,6 +3393,8 @@ tablet_tool_handle_capability (void                      *data,
     case ZWP_TABLET_TOOL_V2_CAPABILITY_SLIDER:
       tool->axes |= GDK_AXIS_FLAG_SLIDER;
       break;
+    default:
+      break;
     }
 }
 
@@ -3426,7 +3431,7 @@ gdk_wayland_tablet_flush_frame_event (GdkWaylandTabletData *tablet,
   if (!event)
     return;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_MOTION_NOTIFY:
       event->motion.time = time;
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index 184c6a0..23fd8ba 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -107,7 +107,7 @@ _gdk_wayland_drag_context_emit_event (GdkDragContext *context,
   GdkWindow *window;
   GdkEvent *event;
 
-  switch (type)
+  switch ((guint) type)
     {
     case GDK_DRAG_ENTER:
     case GDK_DRAG_LEAVE:
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index 9c80d80..c8a4d7e 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -508,6 +508,11 @@ update_direction (GdkWaylandKeymap *keymap)
                  case PANGO_DIRECTION_LTR:
                    rtl[layout]--;
                    break;
+                 case PANGO_DIRECTION_TTB_LTR:
+                 case PANGO_DIRECTION_TTB_RTL:
+                 case PANGO_DIRECTION_WEAK_LTR:
+                 case PANGO_DIRECTION_WEAK_RTL:
+                 case PANGO_DIRECTION_NEUTRAL:
                  default:
                    break;
                  }
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index f9cfc33..af2e2e2 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -191,11 +191,8 @@ update_xft_settings (GdkScreen *screen)
       order = GSD_FONT_RGBA_ORDER_RGB;
     }
 
-  xft_settings.antialias = (antialiasing != GSD_FONT_ANTIALIASING_MODE_NONE);
   xft_settings.hinting = (hinting != GSD_FONT_HINTING_NONE);
   xft_settings.dpi = get_dpi_from_gsettings (screen_wayland) * 1024; /* Xft wants 1/1024ths of an inch */
-  xft_settings.rgba = "rgb";
-  xft_settings.hintstyle = "hintfull";
 
   switch (hinting)
     {
@@ -209,6 +206,7 @@ update_xft_settings (GdkScreen *screen)
       xft_settings.hintstyle = "hintmedium";
       break;
     case GSD_FONT_HINTING_FULL:
+    default:
       xft_settings.hintstyle = "hintfull";
       break;
     }
@@ -218,6 +216,7 @@ update_xft_settings (GdkScreen *screen)
     case GSD_FONT_RGBA_ORDER_RGBA:
       xft_settings.rgba = "rgba";
       break;
+    default:
     case GSD_FONT_RGBA_ORDER_RGB:
       xft_settings.rgba = "rgb";
       break;
@@ -234,6 +233,7 @@ update_xft_settings (GdkScreen *screen)
 
   switch (antialiasing)
    {
+   default:
    case GSD_FONT_ANTIALIASING_MODE_NONE:
      xft_settings.antialias = FALSE;
      break;
diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c
index f6d3a38..1697dcd 100644
--- a/gdk/wayland/gdkwindow-wayland.c
+++ b/gdk/wayland/gdkwindow-wayland.c
@@ -1738,6 +1738,7 @@ calculate_popup_rect (GdkWindow    *window,
 
   switch (rect_anchor)
     {
+    default:
     case GDK_GRAVITY_STATIC:
     case GDK_GRAVITY_NORTH_WEST:
       x = anchor_rect.x;
@@ -1779,6 +1780,7 @@ calculate_popup_rect (GdkWindow    *window,
 
   switch (window_anchor)
     {
+    default:
     case GDK_GRAVITY_STATIC:
     case GDK_GRAVITY_NORTH_WEST:
       break;
@@ -1825,6 +1827,7 @@ flip_anchor_horizontally (GdkGravity anchor)
 {
   switch (anchor)
     {
+    default:
     case GDK_GRAVITY_STATIC:
     case GDK_GRAVITY_NORTH_WEST:
       return GDK_GRAVITY_NORTH_EAST;
@@ -1854,6 +1857,7 @@ flip_anchor_vertically (GdkGravity anchor)
 {
   switch (anchor)
     {
+    default:
     case GDK_GRAVITY_STATIC:
     case GDK_GRAVITY_NORTH_WEST:
       return GDK_GRAVITY_SOUTH_WEST;
@@ -2211,7 +2215,7 @@ should_map_as_popup (GdkWindow *window)
     }
 
   /* Yet we need to keep the window type hint tests for compatibility */
-  switch (impl->hint)
+  switch ((guint) impl->hint)
     {
     case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
     case GDK_WINDOW_TYPE_HINT_DROPDOWN_MENU:
@@ -3616,7 +3620,7 @@ gdk_wayland_window_show_window_menu (GdkWindow *window,
   double x, y;
   uint32_t serial;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_BUTTON_PRESS:
     case GDK_BUTTON_RELEASE:
diff --git a/gdk/x11/gdkasync.c b/gdk/x11/gdkasync.c
index 51a088f..d9b84c4 100644
--- a/gdk/x11/gdkasync.c
+++ b/gdk/x11/gdkasync.c
@@ -526,6 +526,8 @@ get_child_info_handler (Display *dpy,
            handle_get_geometry_reply (dpy, state, repl);
          }
          break;
+        default:
+          break;
        }
     }
 
diff --git a/gdk/x11/gdkdevice-xi2.c b/gdk/x11/gdkdevice-xi2.c
index bdf28c4..328d000 100644
--- a/gdk/x11/gdkdevice-xi2.c
+++ b/gdk/x11/gdkdevice-xi2.c
@@ -233,7 +233,7 @@ gdk_x11_device_xi2_get_state (GdkDevice       *device,
           value = ((XIValuatorClassInfo *) class_info)->value;
           use = gdk_device_get_axis_use (device, j);
 
-          switch (use)
+          switch ((guint) use)
             {
             case GDK_AXIS_X:
             case GDK_AXIS_Y:
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 41d5fae..8779c65 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -1158,7 +1158,7 @@ translate_axes (GdkDevice       *device,
       use = gdk_device_get_axis_use (device, i);
       val = *vals++;
 
-      switch (use)
+      switch ((guint) use)
         {
         case GDK_AXIS_X:
         case GDK_AXIS_Y:
diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c
index 0c42e7c..74c0ecf 100644
--- a/gdk/x11/gdkdisplay-x11.c
+++ b/gdk/x11/gdkdisplay-x11.c
@@ -784,6 +784,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
            g_message ("visibility notify:\twindow: %ld  full",
                       xevent->xvisibility.window);
            break;
+          default:
+            break;
          }
 #endif /* G_ENABLE_DEBUG */
 
@@ -806,6 +808,7 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
          event->visibility.state = GDK_VISIBILITY_PARTIAL;
          break;
 
+        default:
        case VisibilityUnobscured:
          event->visibility.state = GDK_VISIBILITY_UNOBSCURED;
          break;
@@ -1217,6 +1220,8 @@ gdk_x11_display_translate_event (GdkEventTranslator *translator,
            case XkbStateNotify:
              _gdk_x11_keymap_state_changed (display, xevent);
              break;
+            default:
+              break;
            }
        }
       else
@@ -2363,6 +2368,8 @@ gdk_x11_display_broadcast_startup_message (GdkDisplay *display,
            case '\\':
              g_string_append_c (message, '\\');
              break;
+            default:
+              break;
            }
 
          g_string_append_c (message, *p);
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index 03812d6..11585dd 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -1978,6 +1978,11 @@ gdk_drag_do_leave (GdkX11DragContext *context_x11,
           xdnd_send_leave (context_x11);
           break;
         case GDK_DRAG_PROTO_ROOTWIN:
+        case GDK_DRAG_PROTO_MOTIF:
+        case GDK_DRAG_PROTO_WIN32_DROPFILES:
+        case GDK_DRAG_PROTO_OLE2:
+        case GDK_DRAG_PROTO_LOCAL:
+        case GDK_DRAG_PROTO_WAYLAND:
         case GDK_DRAG_PROTO_NONE:
         default:
           break;
@@ -2277,6 +2282,11 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
               break;
 
             case GDK_DRAG_PROTO_ROOTWIN:
+            case GDK_DRAG_PROTO_MOTIF:
+            case GDK_DRAG_PROTO_WIN32_DROPFILES:
+            case GDK_DRAG_PROTO_OLE2:
+            case GDK_DRAG_PROTO_LOCAL:
+            case GDK_DRAG_PROTO_WAYLAND:
             case GDK_DRAG_PROTO_NONE:
             default:
               break;
@@ -2360,8 +2370,13 @@ gdk_x11_drag_context_drag_motion (GdkDragContext *context,
                 gdk_event_free (temp_event);
               }
               break;
+            case GDK_DRAG_PROTO_MOTIF:
+            case GDK_DRAG_PROTO_WIN32_DROPFILES:
+            case GDK_DRAG_PROTO_OLE2:
+            case GDK_DRAG_PROTO_LOCAL:
+            case GDK_DRAG_PROTO_WAYLAND:
             case GDK_DRAG_PROTO_NONE:
-              g_warning ("GDK_DRAG_PROTO_NONE is not valid in gdk_drag_motion()");
+              g_warning ("Invalid drag protocol %u in gdk_drag_motion()", context->protocol);
               break;
             default:
               break;
@@ -2401,7 +2416,13 @@ gdk_x11_drag_context_drag_drop (GdkDragContext *context,
         case GDK_DRAG_PROTO_NONE:
           g_warning ("GDK_DRAG_PROTO_NONE is not valid in gdk_drag_drop()");
           break;
+        case GDK_DRAG_PROTO_MOTIF:
+        case GDK_DRAG_PROTO_WIN32_DROPFILES:
+        case GDK_DRAG_PROTO_OLE2:
+        case GDK_DRAG_PROTO_LOCAL:
+        case GDK_DRAG_PROTO_WAYLAND:
         default:
+          g_warning ("Drag protocol %u is not valid in gdk_drag_drop()", context->protocol);
           break;
         }
     }
@@ -3014,6 +3035,9 @@ gdk_dnd_handle_key_event (GdkDragContext    *context,
         case GDK_KEY_KP_Right:
           dx = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP;
           break;
+
+        default:
+          break;
         }
     }
 
@@ -3130,7 +3154,7 @@ gdk_x11_drag_context_handle_event (GdkDragContext *context,
   if (!x11_context->grab_seat && event->type != GDK_DROP_FINISHED)
     return FALSE;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_MOTION_NOTIFY:
       return gdk_dnd_handle_motion_event (context, &event->motion);
diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c
index a51e8e4..1814a4c 100644
--- a/gdk/x11/gdkkeys-x11.c
+++ b/gdk/x11/gdkkeys-x11.c
@@ -490,6 +490,11 @@ get_direction (XkbDescRec *xkb,
         case PANGO_DIRECTION_LTR:
           rtl_minus_ltr--;
           break;
+        case PANGO_DIRECTION_TTB_LTR:
+        case PANGO_DIRECTION_TTB_RTL:
+        case PANGO_DIRECTION_WEAK_LTR:
+        case PANGO_DIRECTION_WEAK_RTL:
+        case PANGO_DIRECTION_NEUTRAL:
         default:
           break;
         }
@@ -1560,15 +1565,11 @@ gdk_x11_keymap_get_modifier_mask (GdkKeymap         *keymap,
 {
   GdkX11Keymap *keymap_x11 = GDK_X11_KEYMAP (keymap);
 
-  switch (intent)
-    {
-    case GDK_MODIFIER_INTENT_SHIFT_GROUP:
-      return keymap_x11->group_switch_mask;
+  if (intent == GDK_MODIFIER_INTENT_SHIFT_GROUP)
+    return keymap_x11->group_switch_mask;
 
-    default:
-      return GDK_KEYMAP_CLASS (gdk_x11_keymap_parent_class)->get_modifier_mask (keymap,
-                                                                                intent);
-    }
+  return GDK_KEYMAP_CLASS (gdk_x11_keymap_parent_class)->get_modifier_mask (keymap,
+                                                                            intent);
 }
 
 static void
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index 7671f24..19fd6fe 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.c
@@ -130,11 +130,10 @@ _gdk_x11_convert_grab_status (gint status)
       return GDK_GRAB_NOT_VIEWABLE;
     case GrabFrozen:
       return GDK_GRAB_FROZEN;
+    default:
+      g_assert_not_reached();
+      return 0;
     }
-
-  g_assert_not_reached();
-
-  return 0;
 }
 
 /*
diff --git a/gdk/x11/gdkvisual-x11.c b/gdk/x11/gdkvisual-x11.c
index 0430db1..56654e2 100644
--- a/gdk/x11/gdkvisual-x11.c
+++ b/gdk/x11/gdkvisual-x11.c
@@ -124,6 +124,9 @@ _gdk_x11_screen_init_visuals (GdkScreen *screen,
            case DirectColor:
              visuals[nvisuals]->type = GDK_VISUAL_DIRECT_COLOR;
              break;
+            default:
+              g_warn_if_reached ();
+              break;
            }
 
          visuals[nvisuals]->depth = visual_list[i].depth;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 3bcff7d..3d3d305 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -953,6 +953,7 @@ _gdk_x11_display_create_window_impl (GdkDisplay    *display,
       break;
 
     case GDK_WINDOW_CHILD:
+    default:
       g_assert_not_reached ();
       break;
     }
@@ -1519,6 +1520,7 @@ gdk_window_x11_hide (GdkWindow *window)
     case GDK_WINDOW_FOREIGN:
     case GDK_WINDOW_ROOT:
     case GDK_WINDOW_CHILD:
+    default:
       break;
     }
   
@@ -4300,6 +4302,8 @@ update_pos (MoveResizeData *mv_resize,
          x += dx;
          w -= dx;
          break;
+        default:
+          break;
        }
 
       x = MAX (x, 0);
@@ -4486,11 +4490,16 @@ _gdk_x11_moveresize_handle_event (XEvent *event)
                 finish_drag (mv_resize);
               }
             break;
+          default:
+            break;
           }
       }
       break;
 #endif
 
+    default:
+      break;
+
     }
   return TRUE;
 }
@@ -4607,6 +4616,7 @@ calculate_unmoving_origin (MoveResizeData *mv_resize)
          mv_resize->moveresize_orig_x = rect.x + rect.width - width;
          mv_resize->moveresize_orig_y = rect.y + rect.height - height;
          break;
+       case GDK_GRAVITY_STATIC:
        default:
          mv_resize->moveresize_orig_x = rect.x;
          mv_resize->moveresize_orig_y = rect.y;
@@ -4963,7 +4973,7 @@ gdk_x11_window_show_window_menu (GdkWindow *window,
   double x_root, y_root;
   XClientMessageEvent xclient = { 0 };
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_BUTTON_PRESS:
     case GDK_BUTTON_RELEASE:
diff --git a/gsk/gskglrenderer.c b/gsk/gskglrenderer.c
index 34a0215..f38b177 100644
--- a/gsk/gskglrenderer.c
+++ b/gsk/gskglrenderer.c
@@ -662,6 +662,9 @@ get_gl_scaling_filters (GskRenderNode *node,
     case GSK_SCALING_FILTER_TRILINEAR:
       *min_filter_r = GL_LINEAR_MIPMAP_LINEAR;
       break;
+
+    default:
+      break;
     }
 
   switch (node->mag_filter)
@@ -675,6 +678,7 @@ get_gl_scaling_filters (GskRenderNode *node,
      */
     case GSK_SCALING_FILTER_LINEAR:
     case GSK_SCALING_FILTER_TRILINEAR:
+    default:
       *mag_filter_r = GL_LINEAR;
       break;
     }
@@ -917,6 +921,16 @@ gsk_gl_renderer_add_render_item (GskGLRenderer           *self,
       g_assert_not_reached ();
       return;
 
+    case GSK_LINEAR_GRADIENT_NODE:
+    case GSK_REPEATING_LINEAR_GRADIENT_NODE:
+    case GSK_BORDER_NODE:
+    case GSK_INSET_SHADOW_NODE:
+    case GSK_OUTSET_SHADOW_NODE:
+    case GSK_OPACITY_NODE:
+    case GSK_CLIP_NODE:
+    case GSK_ROUNDED_CLIP_NODE:
+    case GSK_TEXT_NODE:
+    case GSK_BLUR_NODE:
     default:
       {
         cairo_surface_t *surface;
diff --git a/gsk/gskrenderer.c b/gsk/gskrenderer.c
index 6bcccf7..1c24166 100644
--- a/gsk/gskrenderer.c
+++ b/gsk/gskrenderer.c
@@ -205,6 +205,10 @@ gsk_renderer_set_property (GObject      *gobject,
       /* Construct-only */
       priv->display = g_value_dup_object (value);
       break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+      break;
     }
 }
 
@@ -238,6 +242,10 @@ gsk_renderer_get_property (GObject    *gobject,
     case PROP_DISPLAY:
       g_value_set_object (value, priv->display);
       break;
+
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
+      break;
     }
 }
 
diff --git a/gsk/gskvulkanclip.c b/gsk/gskvulkanclip.c
index e7696e6..d927d88 100644
--- a/gsk/gskvulkanclip.c
+++ b/gsk/gskvulkanclip.c
@@ -72,6 +72,10 @@ gsk_vulkan_clip_intersect_rect (GskVulkanClip         *dest,
            */
           return FALSE;
         }
+
+    default:
+      g_assert_not_reached ();
+      return FALSE;
     }
 
   return TRUE;
@@ -122,6 +126,10 @@ gsk_vulkan_clip_intersect_rounded_rect (GskVulkanClip        *dest,
     case GSK_VULKAN_CLIP_ROUNDED:
       /* XXX: improve */
       return FALSE;
+
+    default:
+      g_assert_not_reached ();
+      return FALSE;
     }
 
   return TRUE;
diff --git a/gsk/gskvulkanrenderpass.c b/gsk/gskvulkanrenderpass.c
index 34cb999..69c8b38 100644
--- a/gsk/gskvulkanrenderpass.c
+++ b/gsk/gskvulkanrenderpass.c
@@ -674,7 +674,7 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass   *self,
   cairo_surface_t *surface;
   cairo_t *cr;
 
-  switch (gsk_render_node_get_node_type (node))
+  switch ((guint) gsk_render_node_get_node_type (node))
     {
     case GSK_TEXTURE_NODE:
       if (graphene_rect_equal (bounds, &node->bounds))
@@ -696,7 +696,7 @@ gsk_vulkan_render_pass_get_node_as_texture (GskVulkanRenderPass   *self,
         }
       break;
 
-    default: ;
+    default:
       {
         VkSemaphore semaphore;
         graphene_rect_t view;
diff --git a/gtk/a11y/gtkimageaccessible.c b/gtk/a11y/gtkimageaccessible.c
index dc398c8..7c394d0 100644
--- a/gtk/a11y/gtkimageaccessible.c
+++ b/gtk/a11y/gtkimageaccessible.c
@@ -297,6 +297,8 @@ gtk_image_accessible_get_image_size (AtkImage *image,
         *width = gdk_pixbuf_animation_get_width (animation);
         break;
       }
+    case GTK_IMAGE_EMPTY:
+    case GTK_IMAGE_SURFACE:
     default:
       {
         *height = -1;
diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c
index 2661001..2cd1a45 100644
--- a/gtk/gtkbbox.c
+++ b/gtk/gtkbbox.c
@@ -647,6 +647,7 @@ gtk_button_box_size_request (GtkWidget      *widget,
 
   switch (gtk_box_get_baseline_position (GTK_BOX (widget)))
     {
+    default:
     case GTK_BASELINE_POSITION_TOP:
       break;
     case GTK_BASELINE_POSITION_CENTER:
@@ -800,6 +801,7 @@ gtk_button_box_size_allocate (GtkWidget           *widget,
       switch (gtk_box_get_baseline_position (GTK_BOX (widget)))
        {
        case GTK_BASELINE_POSITION_TOP:
+        default:
           /* keep baseline as is */
          break;
        case GTK_BASELINE_POSITION_CENTER:
@@ -973,6 +975,7 @@ gtk_button_box_size_allocate (GtkWidget           *widget,
 
         break;
 
+      case GTK_BUTTONBOX_EXPAND:
       default:
         g_assert_not_reached ();
         break;
diff --git a/gtk/gtkbindings.c b/gtk/gtkbindings.c
index 1bf47b7..068744b 100644
--- a/gtk/gtkbindings.c
+++ b/gtk/gtkbindings.c
@@ -1320,17 +1320,17 @@ gtk_binding_parse_bind (GScanner       *scanner,
     {
       guint expected_token;
 
-      switch (scanner->next_token)
+      if (scanner->next_token == G_TOKEN_STRING)
         {
-        case G_TOKEN_STRING:
           expected_token = gtk_binding_parse_signal (scanner,
                                                      binding_set,
                                                      keyval,
                                                      modifiers);
           if (expected_token != G_TOKEN_NONE)
             return expected_token;
-          break;
-        default:
+        }
+      else
+        {
           g_scanner_get_next_token (scanner);
           return '}';
         }
diff --git a/gtk/gtkbookmarksmanager.c b/gtk/gtkbookmarksmanager.c
index 0108637..57b1638 100644
--- a/gtk/gtkbookmarksmanager.c
+++ b/gtk/gtkbookmarksmanager.c
@@ -207,6 +207,13 @@ bookmarks_file_changed (GFileMonitor      *monitor,
       gdk_threads_leave ();
       break;
 
+    case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
+    case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
+    case G_FILE_MONITOR_EVENT_UNMOUNTED:
+    case G_FILE_MONITOR_EVENT_MOVED:
+    case G_FILE_MONITOR_EVENT_RENAMED:
+    case G_FILE_MONITOR_EVENT_MOVED_IN:
+    case G_FILE_MONITOR_EVENT_MOVED_OUT:
     default:
       /* ignore at the moment */
       break;
diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c
index 344ea52..7361ce9 100644
--- a/gtk/gtkbox.c
+++ b/gtk/gtkbox.c
@@ -576,6 +576,8 @@ gtk_box_size_allocate (GtkWidget           *widget,
        case GTK_BASELINE_POSITION_BOTTOM:
          baseline = height - minimum_below;
          break;
+        default:
+          break;
        }
     }
 
@@ -1025,6 +1027,8 @@ gtk_box_get_size (GtkWidget      *widget,
          min_baseline = minimum - minimum_below;
          nat_baseline = natural - natural_below;
          break;
+        default:
+          break;
        }
     }
 
@@ -1227,6 +1231,8 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
          computed_minimum_baseline = computed_minimum - computed_minimum_below;
          computed_natural_baseline = computed_natural - computed_natural_below;
          break;
+        default:
+          break;
        }
     }
 
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 5f54660..a2efe6e 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -2858,6 +2858,8 @@ gtk_calendar_key_press (GtkWidget   *widget,
 
           calendar_select_and_focus_day (calendar, day);
         }
+    default:
+      break;
     }
 
   return return_val;
diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c
index 691f195..4bac4c7 100644
--- a/gtk/gtkcellrenderertext.c
+++ b/gtk/gtkcellrenderertext.c
@@ -698,9 +698,9 @@ get_property_font_set_mask (guint prop_id)
       return PANGO_FONT_MASK_STRETCH;
     case PROP_SIZE_SET:
       return PANGO_FONT_MASK_SIZE;
+    default:
+      return 0;
     }
-
-  return 0;
 }
 
 static void
@@ -1222,6 +1222,8 @@ gtk_cell_renderer_text_set_property (GObject      *object,
                                             g_value_get_double (value) * PANGO_SCALE);
            g_object_notify_by_pspec (object, pspec);
            break;
+          default:
+            break;
          }
 
        if (priv->fixed_height_rows != -1)
@@ -1539,6 +1541,9 @@ get_layout (GtkCellRendererText *celltext,
           uline = PANGO_UNDERLINE_DOUBLE;
           break;
 
+        case PANGO_UNDERLINE_DOUBLE:
+        case PANGO_UNDERLINE_LOW:
+        case PANGO_UNDERLINE_ERROR:
         default:
           break;
         }
diff --git a/gtk/gtkcenterbox.c b/gtk/gtkcenterbox.c
index 88230b9..996e1ab 100644
--- a/gtk/gtkcenterbox.c
+++ b/gtk/gtkcenterbox.c
@@ -350,6 +350,8 @@ gtk_center_box_measure_opposite (GtkWidget      *widget,
           min_baseline = total_min - below_min;
           nat_baseline = total_nat - below_nat;
           break;
+        default:
+          break;
         }
 
       if (minimum_baseline)
@@ -476,6 +478,7 @@ gtk_center_box_size_allocate (GtkWidget           *widget,
            */
           switch (self->baseline_pos)
             {
+            default:
             case GTK_BASELINE_POSITION_TOP:
               baseline = min_above;
               break;
diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c
index 4bb6b51..c9c1f48 100644
--- a/gtk/gtkcombobox.c
+++ b/gtk/gtkcombobox.c
@@ -2583,6 +2583,8 @@ gtk_combo_box_real_move_active (GtkComboBox   *combo_box,
       found = tree_first (combo_box, priv->model, &new_iter);
       break;
 
+    case GTK_SCROLL_NONE:
+    case GTK_SCROLL_JUMP:
     default:
       return;
     }
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index 5e3fa99..820af54 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -2593,11 +2593,10 @@ _gtk_container_focus_sort (GtkContainer     *container,
     case GTK_DIR_LEFT:
     case GTK_DIR_RIGHT:
       return gtk_container_focus_sort_left_right (container, visible_children, direction, old_focus);
+    default:
+      g_assert_not_reached ();
+      return NULL;
     }
-
-  g_assert_not_reached ();
-
-  return NULL;
 }
 
 static gboolean
diff --git a/gtk/gtkcsscolorvalue.c b/gtk/gtkcsscolorvalue.c
index 0224018..4bd0f59 100644
--- a/gtk/gtkcsscolorvalue.c
+++ b/gtk/gtkcsscolorvalue.c
@@ -93,6 +93,8 @@ gtk_css_value_color_free (GtkCssValue *color)
     case COLOR_TYPE_WIN32:
       gtk_win32_theme_unref (color->sym_col.win32.theme);
       break;
+    case COLOR_TYPE_LITERAL:
+    case COLOR_TYPE_CURRENT_COLOR:
     default:
       break;
     }
@@ -770,6 +772,9 @@ _gtk_css_color_value_parse_function (GtkCssParser   *parser,
         case COLOR_MIX:
           value = _gtk_css_color_value_new_mix (child1, child2, d);
           break;
+        case COLOR_RGB:
+        case COLOR_RGBA:
+        case COLOR_WIN32:
         default:
           g_assert_not_reached ();
           value = NULL;
diff --git a/gtk/gtkcssimagebuiltin.c b/gtk/gtkcssimagebuiltin.c
index 5732a79..a8fd047 100644
--- a/gtk/gtkcssimagebuiltin.c
+++ b/gtk/gtkcssimagebuiltin.c
@@ -177,7 +177,7 @@ gtk_css_image_builtin_draw_arrow (GtkCssImage            *image,
   size = MIN (width, height);
 
   cairo_translate (cr, width / 2.0, height / 2.0);
-  switch (image_type)
+  switch ((guint) image_type)
   {
     case GTK_CSS_IMAGE_BUILTIN_ARROW_UP:
       break;
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index 8cdcd2e..670a87d 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -286,7 +286,9 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
     case GTK_CSS_FONT_KERNING_NONE:
       append_separated (s, "kern 0");
       break;
-    default: ;
+    case GTK_CSS_FONT_KERNING_AUTO:
+    default:
+      break;
     }
 
   value = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_FONT_VARIANT_LIGATURES);
@@ -326,7 +328,9 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
     case GTK_CSS_FONT_VARIANT_POSITION_SUPER:
       append_separated (s, "sups 1");
       break;
-    default: ;
+    case GTK_CSS_FONT_VARIANT_POSITION_NORMAL:
+    default:
+      break;
     }
 
   value = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_FONT_VARIANT_CAPS);
@@ -349,8 +353,10 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
       break;
     case GTK_CSS_FONT_VARIANT_CAPS_TITLING_CAPS:
       append_separated (s, "titl 1");
-    break;
-    default: ;
+      break;
+    case GTK_CSS_FONT_VARIANT_CAPS_NORMAL:
+    default:
+      break;
     }
 
   value = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_FONT_VARIANT_NUMERIC);
@@ -385,7 +391,9 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
     case GTK_CSS_FONT_VARIANT_ALTERNATE_HISTORICAL_FORMS:
       append_separated (s, "hist 1");
       break;
-    default: ;
+    case GTK_CSS_FONT_VARIANT_ALTERNATE_NORMAL:
+    default:
+      break;
     }
 
   value = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_FONT_VARIANT_EAST_ASIAN);
diff --git a/gtk/gtkcssstylefuncs.c b/gtk/gtkcssstylefuncs.c
index 4af0db5..347b23e 100644
--- a/gtk/gtkcssstylefuncs.c
+++ b/gtk/gtkcssstylefuncs.c
@@ -501,6 +501,8 @@ pattern_value_print (const GValue *value,
       break;
     case CAIRO_PATTERN_TYPE_LINEAR:
     case CAIRO_PATTERN_TYPE_RADIAL:
+    case CAIRO_PATTERN_TYPE_MESH:
+    case CAIRO_PATTERN_TYPE_RASTER_SOURCE:
       g_string_append (string, "none /* FIXME: add support for printing gradients */");
       break;
     case CAIRO_PATTERN_TYPE_SOLID:
diff --git a/gtk/gtkcsstypes.c b/gtk/gtkcsstypes.c
index 0399e49..8bae7c3 100644
--- a/gtk/gtkcsstypes.c
+++ b/gtk/gtkcsstypes.c
@@ -41,6 +41,8 @@ _gtk_css_blend_mode_get_operator (GskBlendMode mode)
       return CAIRO_OPERATOR_EXCLUSION;
     case GSK_BLEND_MODE_HARD_LIGHT:
       return CAIRO_OPERATOR_HARD_LIGHT;
+    case GSK_BLEND_MODE_SOFT_LIGHT:
+      return CAIRO_OPERATOR_SOFT_LIGHT;
     case GSK_BLEND_MODE_HUE:
       return CAIRO_OPERATOR_HSL_HUE;
     case GSK_BLEND_MODE_LIGHTEN:
diff --git a/gtk/gtkcsswin32sizevalue.c b/gtk/gtkcsswin32sizevalue.c
index 134078b..fd7970a 100644
--- a/gtk/gtkcsswin32sizevalue.c
+++ b/gtk/gtkcsswin32sizevalue.c
@@ -145,6 +145,10 @@ gtk_css_value_win32_size_equal (const GtkCssValue *value1,
       return value1->val.part.part == value2->val.part.part
           && value1->val.part.state == value2->val.part.state;
 
+    case GTK_WIN32_PART_BORDER_TOP:
+    case GTK_WIN32_PART_BORDER_RIGHT:
+    case GTK_WIN32_PART_BORDER_BOTTOM:
+    case GTK_WIN32_PART_BORDER_LEFT:
     default:
       g_assert_not_reached ();
       return FALSE;
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 67ec173..0bb71f7 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -732,7 +732,7 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
   info = gtk_drag_get_dest_info (context, TRUE);
 
   /* Find the widget for the event */
-  switch (event_type)
+  switch ((guint) event_type)
     {
     case GDK_DRAG_ENTER:
       break;
@@ -1789,7 +1789,7 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
   if (!info)
     return;
 
-  switch (gdk_event_get_event_type (event))
+  switch ((guint) gdk_event_get_event_type (event))
     {
     case GDK_DRAG_STATUS:
       {
@@ -2352,6 +2352,9 @@ gtk_drag_key_cb (GtkWidget   *widget,
               gtk_drag_cancel_internal (info, GTK_DRAG_RESULT_NO_TARGET, time);
             }
           break;
+        
+        default:
+          break;
        }
     }
 
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 225f3e9..002f5a4 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3536,7 +3536,7 @@ gtk_entry_event (GtkWidget *widget,
   sequence = gdk_event_get_event_sequence (event);
   device = gdk_event_get_device (event);
 
-  switch (gdk_event_get_event_type (event))
+  switch ((guint) gdk_event_get_event_type (event))
     {
     case GDK_TOUCH_BEGIN:
       if (icon_info->current_sequence)
@@ -4816,6 +4816,7 @@ gtk_entry_move_cursor (GtkEntry       *entry,
        case GTK_MOVEMENT_PARAGRAPHS:
        case GTK_MOVEMENT_PAGES:
        case GTK_MOVEMENT_HORIZONTAL_PAGES:
+        default:
          break;
        }
     }
@@ -4888,6 +4889,7 @@ gtk_entry_move_cursor (GtkEntry       *entry,
        case GTK_MOVEMENT_PARAGRAPHS:
        case GTK_MOVEMENT_PAGES:
        case GTK_MOVEMENT_HORIZONTAL_PAGES:
+        default:
          break;
        }
     }
@@ -4996,6 +4998,9 @@ gtk_entry_delete_from_cursor (GtkEntry       *entry,
     case GTK_DELETE_WHITESPACE:
       gtk_entry_delete_whitespace (entry);
       break;
+
+    default:
+      break;
     }
 
   if (gtk_entry_buffer_get_bytes (get_buffer (entry)) == old_n_bytes)
@@ -6634,6 +6639,9 @@ gtk_entry_clear_icon (GtkEntry             *entry,
                                             : PROP_GICON_SECONDARY]);
       break;
 
+    case GTK_IMAGE_EMPTY:
+    case GTK_IMAGE_ANIMATION:
+    case GTK_IMAGE_SURFACE:
     default:
       g_assert_not_reached ();
       break;
diff --git a/gtk/gtkeventcontrollerscroll.c b/gtk/gtkeventcontrollerscroll.c
index 61f9167..a250bfb 100644
--- a/gtk/gtkeventcontrollerscroll.c
+++ b/gtk/gtkeventcontrollerscroll.c
@@ -270,6 +270,7 @@ gtk_event_controller_scroll_handle_event (GtkEventController *controller,
         case GDK_SCROLL_RIGHT:
           dx += 1;
           break;
+        case GDK_SCROLL_SMOOTH:
         default:
           g_assert_not_reached ();
           break;
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index 6aac0e3..55ff549 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -739,6 +739,7 @@ focus_in_site (GtkExpander      *expander,
           return FALSE;
       }
     case FOCUS_NONE:
+    default:
       break;
     }
 
@@ -767,6 +768,7 @@ get_next_site (GtkExpander      *expander,
         case GTK_DIR_TAB_FORWARD:
         case GTK_DIR_DOWN:
         case GTK_DIR_RIGHT:
+        default:
           return FOCUS_WIDGET;
         }
       break;
@@ -780,6 +782,7 @@ get_next_site (GtkExpander      *expander,
           return ltr ? FOCUS_NONE : FOCUS_LABEL;
         case GTK_DIR_TAB_FORWARD:
         case GTK_DIR_DOWN:
+        default:
           return FOCUS_LABEL;
         case GTK_DIR_RIGHT:
           return ltr ? FOCUS_LABEL : FOCUS_NONE;
@@ -795,6 +798,7 @@ get_next_site (GtkExpander      *expander,
           return ltr ? FOCUS_WIDGET : FOCUS_CHILD;
         case GTK_DIR_TAB_FORWARD:
         case GTK_DIR_DOWN:
+        default:
           return FOCUS_CHILD;
         case GTK_DIR_RIGHT:
           return ltr ? FOCUS_CHILD : FOCUS_WIDGET;
@@ -810,12 +814,15 @@ get_next_site (GtkExpander      *expander,
         case GTK_DIR_TAB_FORWARD:
         case GTK_DIR_DOWN:
         case GTK_DIR_RIGHT:
+        default:
           return FOCUS_NONE;
         }
       break;
+    default:
+      g_assert_not_reached ();
+      break;
     }
-
-  g_assert_not_reached ();
+  
   return FOCUS_NONE;
 }
 
diff --git a/gtk/gtkfilechooserbutton.c b/gtk/gtkfilechooserbutton.c
index e868e04..abc6147 100644
--- a/gtk/gtkfilechooserbutton.c
+++ b/gtk/gtkfilechooserbutton.c
@@ -956,6 +956,8 @@ gtk_file_chooser_button_set_property (GObject      *object,
            g_value_set_enum ((GValue *) value, GTK_FILE_CHOOSER_ACTION_OPEN);
          }
          break;
+        default:
+          break;
        }
 
       g_object_set_property (G_OBJECT (priv->chooser), pspec->name, value);
@@ -1346,6 +1348,8 @@ gtk_file_chooser_button_mnemonic_activate (GtkWidget *widget,
     case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:
       return gtk_widget_mnemonic_activate (priv->combo_box, group_cycling);
       break;
+    case GTK_FILE_CHOOSER_ACTION_SAVE:
+    case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
     default:
       g_assert_not_reached ();
       break;
diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c
index 4e43298..25247b0 100644
--- a/gtk/gtkfilechooserentry.c
+++ b/gtk/gtkfilechooserentry.c
@@ -570,6 +570,7 @@ update_inline_completion (GtkFileChooserEntry *chooser_entry)
       break;
     case GTK_FILE_CHOOSER_ACTION_SAVE:
     case GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER:
+    default:
       gtk_entry_completion_set_inline_completion (completion, FALSE);
       break;
     }
@@ -975,6 +976,7 @@ _gtk_file_chooser_entry_set_action (GtkFileChooserEntry *chooser_entry,
        {
        case GTK_FILE_CHOOSER_ACTION_OPEN:
        case GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER:
+        default:
          gtk_entry_completion_set_popup_single_match (comp, FALSE);
          break;
        case GTK_FILE_CHOOSER_ACTION_SAVE:
diff --git a/gtk/gtkfilechoosernative.c b/gtk/gtkfilechoosernative.c
index b66e5a7..a9f6d20 100644
--- a/gtk/gtkfilechoosernative.c
+++ b/gtk/gtkfilechoosernative.c
@@ -780,6 +780,8 @@ gtk_file_chooser_native_hide (GtkNativeDialog *native)
     case MODE_PORTAL:
       gtk_file_chooser_native_portal_hide (self);
       break;
+    default:
+      break;
     }
 }
 
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index a077fb7..eda7045 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -6883,6 +6883,7 @@ gtk_file_chooser_widget_should_respond (GtkFileChooserEmbed *chooser_embed)
         case SAVE_ENTRY:
           goto save_entry;
 
+        case NOT_REACHED: 
         default:
           g_assert_not_reached ();
         }
diff --git a/gtk/gtkfilefilter.c b/gtk/gtkfilefilter.c
index cd19fb6..58decf9 100644
--- a/gtk/gtkfilefilter.c
+++ b/gtk/gtkfilefilter.c
@@ -710,6 +710,8 @@ _gtk_file_filter_get_as_patterns (GtkFileFilter      *filter)
              }
            break;
          }
+        default:
+          break;
        }
     }
 
@@ -804,6 +806,9 @@ gtk_file_filter_filter (GtkFileFilter           *filter,
          if (rule->u.custom.func (filter_info, rule->u.custom.data))
            return TRUE;
          break;
+
+        default:
+          break;
        }
     }
 
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c
index 33714a8..386188d 100644
--- a/gtk/gtkfilesystemmodel.c
+++ b/gtk/gtkfilesystemmodel.c
@@ -1264,6 +1264,10 @@ gtk_file_system_model_monitor_change (GFileMonitor *      monitor,
         /* FIXME: use freeze/thaw with this somehow? */
       case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
       case G_FILE_MONITOR_EVENT_UNMOUNTED:
+      case G_FILE_MONITOR_EVENT_MOVED:
+      case G_FILE_MONITOR_EVENT_RENAMED:
+      case G_FILE_MONITOR_EVENT_MOVED_IN:
+      case G_FILE_MONITOR_EVENT_MOVED_OUT:
       default:
         /* ignore these */
         break;
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index 9c32be9..e4a4b22 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -1371,6 +1371,7 @@ get_offset_pixels (GtkAlign align,
   case GTK_ALIGN_END:
     offset = pixels;
     break;
+  case GTK_ALIGN_BASELINE:
   default:
     g_assert_not_reached ();
     break;
@@ -2486,8 +2487,21 @@ autoscroll_cb (GtkWidget     *widget,
     case GTK_SCROLL_PAGE_BACKWARD:
       factor = - AUTOSCROLL_FACTOR_FAST;
       break;
+    case GTK_SCROLL_NONE:
+    case GTK_SCROLL_JUMP:
+    case GTK_SCROLL_STEP_UP:
+    case GTK_SCROLL_STEP_DOWN:
+    case GTK_SCROLL_STEP_LEFT:
+    case GTK_SCROLL_STEP_RIGHT:
+    case GTK_SCROLL_PAGE_UP:
+    case GTK_SCROLL_PAGE_DOWN:
+    case GTK_SCROLL_PAGE_LEFT:
+    case GTK_SCROLL_PAGE_RIGHT:
+    case GTK_SCROLL_START:
+    case GTK_SCROLL_END:
     default:
       g_assert_not_reached ();
+      break;
     }
 
   increment = gtk_adjustment_get_step_increment (adjustment) / factor;
@@ -3058,7 +3072,7 @@ gtk_flow_box_move_cursor (GtkFlowBox      *box,
 
   if (vertical)
     {
-       switch (step)
+       switch ((guint) step)
          {
          case GTK_MOVEMENT_VISUAL_POSITIONS:
            step = GTK_MOVEMENT_DISPLAY_LINES;
@@ -3066,12 +3080,13 @@ gtk_flow_box_move_cursor (GtkFlowBox      *box,
          case GTK_MOVEMENT_DISPLAY_LINES:
            step = GTK_MOVEMENT_VISUAL_POSITIONS;
            break;
-         default: ;
+         default:
+           break;
          }
     }
 
   child = NULL;
-  switch (step)
+  switch ((guint) step)
     {
     case GTK_MOVEMENT_VISUAL_POSITIONS:
       if (priv->cursor_child != NULL)
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index ada2258..754615f 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -1239,6 +1239,8 @@ pango_font_description_to_css (PangoFontDescription *desc)
         case PANGO_STYLE_ITALIC:
           g_string_append (s, "font-style: italic; ");
           break;
+        default:
+          break;
         }
     }
   if (set & PANGO_FONT_MASK_VARIANT)
@@ -1251,6 +1253,8 @@ pango_font_description_to_css (PangoFontDescription *desc)
         case PANGO_VARIANT_SMALL_CAPS:
           g_string_append (s, "font-variant: small-caps; ");
           break;
+        default:
+          break;
         }
     }
   if (set & PANGO_FONT_MASK_WEIGHT)
@@ -1287,6 +1291,8 @@ pango_font_description_to_css (PangoFontDescription *desc)
         case PANGO_WEIGHT_ULTRAHEAVY:
           g_string_append (s, "font-weight: 900; ");
           break;
+        default:
+          break;
         }
     }
   if (set & PANGO_FONT_MASK_STRETCH)
@@ -1320,6 +1326,8 @@ pango_font_description_to_css (PangoFontDescription *desc)
         case PANGO_STRETCH_ULTRA_EXPANDED:
           g_string_append (s, "font-stretch: ultra-expanded; ");
           break;
+        default:
+          break;
         }
     }
   if (set & PANGO_FONT_MASK_SIZE)
diff --git a/gtk/gtkgesture.c b/gtk/gtkgesture.c
index 67d9153..8c7ed95 100644
--- a/gtk/gtkgesture.c
+++ b/gtk/gtkgesture.c
@@ -1664,7 +1664,7 @@ _gtk_gesture_get_pointer_emulating_sequence (GtkGesture        *gesture,
 
   while (g_hash_table_iter_next (&iter, (gpointer*) &seq, (gpointer*) &data))
     {
-      switch (gdk_event_get_event_type (data->event))
+      switch ((guint) gdk_event_get_event_type (data->event))
         {
         case GDK_TOUCH_BEGIN:
         case GDK_TOUCH_UPDATE:
diff --git a/gtk/gtkgesturesingle.c b/gtk/gtkgesturesingle.c
index d87fc0c..9c6ad83 100644
--- a/gtk/gtkgesturesingle.c
+++ b/gtk/gtkgesturesingle.c
@@ -155,7 +155,7 @@ gtk_gesture_single_handle_event (GtkEventController *controller,
 
   event_type = gdk_event_get_event_type (event);
 
-  switch (event_type)
+  switch ((guint) event_type)
     {
     case GDK_TOUCH_BEGIN:
     case GDK_TOUCH_END:
diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c
index 73ae2eb..af06a1f 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
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index 6f9c329..51954a7 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -768,6 +768,10 @@ _gtk_icon_helper_set_pixbuf_scale (GtkIconHelper *self,
                                                                           scale));
       break;
 
+    case GTK_IMAGE_EMPTY:
+    case GTK_IMAGE_ICON_NAME:
+    case GTK_IMAGE_GICON:
+    case GTK_IMAGE_SURFACE:
     default:
       break;
   }
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index 2bd7a13..2a663c5 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -2797,14 +2797,14 @@ theme_dir_size_difference (IconThemeDir *dir,
     {
     case ICON_THEME_DIR_FIXED:
       return abs (scaled_size - scaled_dir_size);
-      break;
+
     case ICON_THEME_DIR_SCALABLE:
       if (scaled_size < (dir->min_size * dir->scale))
         return (dir->min_size * dir->scale) - scaled_size;
       if (size > (dir->max_size * dir->scale))
         return scaled_size - (dir->max_size * dir->scale);
       return 0;
-      break;
+
     case ICON_THEME_DIR_THRESHOLD:
       min = (dir->size - dir->threshold) * dir->scale;
       max = (dir->size + dir->threshold) * dir->scale;
@@ -2813,13 +2813,12 @@ theme_dir_size_difference (IconThemeDir *dir,
       if (scaled_size > max)
         return scaled_size - max;
       return 0;
-      break;
+
     case ICON_THEME_DIR_UNTHEMED:
+    default:
       g_assert_not_reached ();
-      break;
+      return 1000;
     }
-  g_assert_not_reached ();
-  return 1000;
 }
 
 static const gchar *
@@ -2835,10 +2834,12 @@ string_from_suffix (IconSuffix suffix)
       return ".png";
     case ICON_SUFFIX_SYMBOLIC_PNG:
       return ".symbolic.png";
+    case ICON_SUFFIX_NONE:
+    case HAS_ICON_FILE:
     default:
       g_assert_not_reached();
+      return NULL;
     }
-  return NULL;
 }
 
 static IconSuffix
@@ -3665,6 +3666,8 @@ apply_emblems_to_pixbuf (GdkPixbuf   *pixbuf,
               x = 0;
               y = 0;
               break;
+            default:
+              break;
             }
 
           if (icon == NULL)
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index df13372..4cd2487 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1757,7 +1757,8 @@ gtk_icon_view_snapshot (GtkWidget   *widget,
           rect.y = dest_item->cell_area.y;
           rect.width = 2;
           rect.height = dest_item->cell_area.height;
-       case GTK_ICON_VIEW_NO_DROP: ;
+       case GTK_ICON_VIEW_NO_DROP:
+        default:
          break;
         }
 
@@ -2590,6 +2591,7 @@ gtk_icon_view_real_toggle_cursor_item (GtkIconView *icon_view)
   switch (icon_view->priv->selection_mode)
     {
     case GTK_SELECTION_NONE:
+    default:
       break;
     case GTK_SELECTION_BROWSE:
       _gtk_icon_view_select_item (icon_view, icon_view->priv->cursor_item);
@@ -3506,8 +3508,14 @@ gtk_icon_view_real_move_cursor (GtkIconView     *icon_view,
     case GTK_MOVEMENT_BUFFER_ENDS:
       gtk_icon_view_move_cursor_start_end (icon_view, count);
       break;
+    case GTK_MOVEMENT_WORDS:
+    case GTK_MOVEMENT_DISPLAY_LINE_ENDS:
+    case GTK_MOVEMENT_PARAGRAPHS:
+    case GTK_MOVEMENT_PARAGRAPH_ENDS:
+    case GTK_MOVEMENT_HORIZONTAL_PAGES:
     default:
       g_assert_not_reached ();
+      break;
     }
 
   icon_view->priv->modify_selection_pressed = FALSE;
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 245d636..72bdeb7 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1375,6 +1375,9 @@ gtk_image_notify_for_storage_type (GtkImage     *image,
     case GTK_IMAGE_GICON:
       g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_GICON]);
       break;
+    case GTK_IMAGE_SURFACE:
+      g_object_notify_by_pspec (G_OBJECT (image), image_props[PROP_SURFACE]);
+      break;
     case GTK_IMAGE_EMPTY:
     default:
       break;
diff --git a/gtk/gtkkineticscrolling.c b/gtk/gtkkineticscrolling.c
index 29bf085..deb953d 100644
--- a/gtk/gtkkineticscrolling.c
+++ b/gtk/gtkkineticscrolling.c
@@ -208,6 +208,7 @@ gtk_kinetic_scrolling_tick (GtkKineticScrolling *data,
       }
 
     case GTK_KINETIC_SCROLLING_PHASE_FINISHED:
+    default:
       break;
     }
 
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index de33f39..6774ebc 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -4466,6 +4466,10 @@ gtk_label_focus (GtkWidget        *widget,
           break;
 
         default:
+        case GTK_DIR_UP:
+        case GTK_DIR_DOWN:
+        case GTK_DIR_LEFT:
+        case GTK_DIR_RIGHT:
           goto out;
         }
 
@@ -5840,6 +5844,7 @@ gtk_label_move_cursor (GtkLabel       *label,
         case GTK_MOVEMENT_PARAGRAPHS:
         case GTK_MOVEMENT_PAGES:
         case GTK_MOVEMENT_HORIZONTAL_PAGES:
+        default:
           break;
         }
     }
@@ -5900,6 +5905,7 @@ gtk_label_move_cursor (GtkLabel       *label,
         case GTK_MOVEMENT_PARAGRAPHS:
         case GTK_MOVEMENT_PAGES:
         case GTK_MOVEMENT_HORIZONTAL_PAGES:
+        default:
           break;
         }
     }
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index b1305d7..52f6398 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -1904,6 +1904,10 @@ gtk_list_box_focus (GtkWidget        *widget,
           if (next_focus_row == NULL)
             next_focus_row = gtk_list_box_get_last_focusable (box);
           break;
+        case GTK_DIR_DOWN:
+        case GTK_DIR_TAB_FORWARD:
+        case GTK_DIR_LEFT:
+        case GTK_DIR_RIGHT:
         default:
           next_focus_row = priv->selected_row;
           if (next_focus_row == NULL)
@@ -2722,7 +2726,7 @@ gtk_list_box_move_cursor (GtkListBox      *box,
   int height;
 
   row = NULL;
-  switch (step)
+  switch ((guint) step)
     {
     case GTK_MOVEMENT_BUFFER_ENDS:
       if (count < 0)
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 40b939f..e9894a5 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -1140,7 +1140,7 @@ rewrite_event_for_window (GdkEvent  *event,
 {
   event = gdk_event_copy (event);
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_SCROLL:
       rewrite_events_translate (event->any.window,
@@ -1211,7 +1211,7 @@ rewrite_event_for_grabs (GdkEvent *event)
   GdkDisplay *display;
   GdkDevice *device;
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_SCROLL:
     case GDK_BUTTON_PRESS:
@@ -1307,6 +1307,9 @@ get_virtual_notify_type (GdkNotifyType notify_type)
       return GDK_NOTIFY_VIRTUAL;
     case GDK_NOTIFY_NONLINEAR:
       return GDK_NOTIFY_NONLINEAR_VIRTUAL;
+    case GDK_NOTIFY_VIRTUAL:
+    case GDK_NOTIFY_NONLINEAR_VIRTUAL:
+    case GDK_NOTIFY_UNKNOWN:
     default:
       g_assert_not_reached ();
       return GDK_NOTIFY_UNKNOWN;
@@ -1441,7 +1444,7 @@ gtk_synthesize_crossing_events (GtkWindow       *toplevel,
 static gboolean
 is_pointing_event (GdkEvent *event)
 {
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_MOTION_NOTIFY:
     case GDK_ENTER_NOTIFY:
@@ -1485,7 +1488,7 @@ handle_pointing_event (GdkEvent *event)
 
   sequence = gdk_event_get_event_sequence (event);
 
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_LEAVE_NOTIFY:
       if (event->crossing.mode == GDK_CROSSING_GRAB ||
@@ -1842,6 +1845,9 @@ gtk_main_do_event (GdkEvent *event)
     case GDK_DROP_START:
       _gtk_drag_dest_handle_event (event_widget, event);
       break;
+    case GDK_SETTING:
+    case GDK_OWNER_CHANGE:
+    case GDK_EVENT_LAST:
     default:
       g_assert_not_reached ();
       break;
diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c
index 6d5eb92..cf80a08 100644
--- a/gtk/gtkmenu.c
+++ b/gtk/gtkmenu.c
@@ -1128,7 +1128,7 @@ gtk_menu_window_event (GtkWidget *window,
   g_object_ref (window);
   g_object_ref (menu);
 
-  switch (gdk_event_get_event_type (event))
+  switch ((guint) gdk_event_get_event_type (event))
     {
     case GDK_WINDOW_STATE:
       /* Window for the menu has been closed by the display server or by GDK.
@@ -3609,7 +3609,7 @@ gtk_menu_captured_event (GtkWidget *widget,
   source_device = gdk_event_get_source_device (event);
   gdk_event_get_root_coords (event, &x_root, &y_root);
 
-  switch (gdk_event_get_event_type (event))
+  switch ((guint) gdk_event_get_event_type (event))
     {
     case GDK_TOUCH_BEGIN:
     case GDK_BUTTON_PRESS:
@@ -4035,10 +4035,10 @@ get_horizontally_flipped_anchor (GdkGravity anchor)
       return GDK_GRAVITY_SOUTH;
     case GDK_GRAVITY_SOUTH_EAST:
       return GDK_GRAVITY_SOUTH_WEST;
+    default:
+      g_warning ("unknown GdkGravity: %d", anchor);
+      return anchor;
     }
-
-  g_warning ("unknown GdkGravity: %d", anchor);
-  return anchor;
 }
 
 static void
@@ -4450,7 +4450,10 @@ gtk_menu_move_current (GtkMenuShell         *menu_shell,
         case GTK_MENU_DIR_PARENT:
           direction = GTK_MENU_DIR_CHILD;
           break;
-        default: ;
+        case GTK_MENU_DIR_NEXT:
+        case GTK_MENU_DIR_PREV:
+        default:
+          break;
         }
     }
 
@@ -4634,7 +4637,7 @@ gtk_menu_real_move_scroll (GtkMenu       *menu,
   gint end_position = get_menu_height (menu);
   GtkMenuShell *menu_shell = GTK_MENU_SHELL (menu);
 
-  switch (type)
+  switch ((guint) type)
     {
     case GTK_SCROLL_PAGE_UP:
     case GTK_SCROLL_PAGE_DOWN:
diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c
index d18ea69..f3f753d 100644
--- a/gtk/gtkmenubar.c
+++ b/gtk/gtkmenubar.c
@@ -632,7 +632,10 @@ gtk_menu_bar_move_current (GtkMenuShell         *menu_shell,
            case GTK_MENU_DIR_NEXT:
              direction = GTK_MENU_DIR_PREV;
              break;
-           default: ;
+           case GTK_MENU_DIR_PARENT:
+           case GTK_MENU_DIR_CHILD:
+           default:
+              break;
            }
        }
     }
diff --git a/gtk/gtkmenubutton.c b/gtk/gtkmenubutton.c
index e0fd91c..110c7b5 100644
--- a/gtk/gtkmenubutton.c
+++ b/gtk/gtkmenubutton.c
@@ -264,6 +264,7 @@ popup_menu (GtkMenuButton *menu_button,
 
       switch (gtk_widget_get_halign (priv->menu))
         {
+        default:
         case GTK_ALIGN_FILL:
         case GTK_ALIGN_START:
         case GTK_ALIGN_BASELINE:
@@ -298,6 +299,7 @@ popup_menu (GtkMenuButton *menu_button,
 
       switch (gtk_widget_get_halign (priv->menu))
         {
+        default:
         case GTK_ALIGN_FILL:
         case GTK_ALIGN_START:
         case GTK_ALIGN_BASELINE:
@@ -327,6 +329,7 @@ popup_menu (GtkMenuButton *menu_button,
 
       switch (gtk_widget_get_valign (priv->menu))
         {
+        default:
         case GTK_ALIGN_FILL:
         case GTK_ALIGN_START:
         case GTK_ALIGN_BASELINE:
@@ -356,6 +359,7 @@ popup_menu (GtkMenuButton *menu_button,
 
       switch (gtk_widget_get_valign (priv->menu))
         {
+        default:
         case GTK_ALIGN_FILL:
         case GTK_ALIGN_START:
         case GTK_ALIGN_BASELINE:
@@ -384,6 +388,9 @@ popup_menu (GtkMenuButton *menu_button,
                     NULL);
 
       break;
+
+    default:
+      break;
     }
 
   gtk_menu_popup_at_widget (GTK_MENU (priv->menu),
@@ -593,6 +600,8 @@ set_arrow_type (GtkImage     *image,
     case GTK_ARROW_RIGHT:
       gtk_image_set_from_icon_name (image, "pan-end-symbolic", GTK_ICON_SIZE_BUTTON);
       break;
+    default:
+      break;
     }
 }
 
@@ -960,6 +969,8 @@ update_popover_direction (GtkMenuButton *menu_button)
     case GTK_ARROW_RIGHT:
       gtk_popover_set_position (GTK_POPOVER (priv->popover), GTK_POS_RIGHT);
       break;
+    default:
+      break;
     }
 }
 
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index efddab5..0c98806 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -1351,6 +1351,7 @@ popped_up_cb (GtkMenu            *menu,
           break;
 
         case GTK_DIRECTION_RIGHT:
+        default:
           menu_item->priv->submenu_direction = GTK_DIRECTION_LEFT;
           break;
         }
@@ -1425,6 +1426,7 @@ gtk_menu_item_real_popup_submenu (GtkWidget      *widget,
               break;
 
             case GTK_LEFT_RIGHT:
+            default:
               if (parent_menu && GTK_IS_MENU_ITEM (parent_menu->priv->parent_menu_item))
                 submenu_direction = GTK_MENU_ITEM 
(parent_menu->priv->parent_menu_item)->priv->submenu_direction;
               else
@@ -1451,6 +1453,7 @@ gtk_menu_item_real_popup_submenu (GtkWidget      *widget,
               switch (submenu_direction)
                 {
                 case GTK_DIRECTION_RIGHT:
+                default:
                   g_object_set (priv->submenu,
                                 "rect-anchor-dx", horizontal_offset + parent_padding.right + 
menu_padding.left,
                                 NULL);
diff --git a/gtk/gtkmenushell.c b/gtk/gtkmenushell.c
index 732f652..ebb7194 100644
--- a/gtk/gtkmenushell.c
+++ b/gtk/gtkmenushell.c
@@ -1413,6 +1413,9 @@ gtk_real_menu_shell_move_current (GtkMenuShell         *menu_shell,
       if (!had_selection && !priv->active_menu_item && priv->children)
         gtk_menu_shell_select_first (menu_shell, TRUE);
       break;
+
+    default:
+      break;
     }
 }
 
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index d1f90ab..144a5fc 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -1214,6 +1214,9 @@ gtk_notebook_focus_tab (GtkNotebook       *notebook,
           if (list)
             gtk_notebook_switch_focus_tab (notebook, list);
           break;
+
+        default:
+          break;
         }
 
       return TRUE;
@@ -1869,6 +1872,9 @@ gtk_notebook_get_preferred_tabs_size (GtkNotebook    *notebook,
               tab_width = MAX (tab_width, page->requisition.width);
               tab_max = MAX (tab_max, page->requisition.height);
               break;
+            default:
+              g_assert_not_reached ();
+              break;
             }
         }
       else if (gtk_widget_get_visible (page->tab_label))
@@ -2428,13 +2434,16 @@ get_drop_position (GtkNotebook *notebook)
                   if (allocation.x + allocation.width / 2 < x)
                     return children;
                 }
-
               break;
+
             case GTK_POS_LEFT:
             case GTK_POS_RIGHT:
               if (allocation.y + allocation.height / 2 > y)
                 return children;
+              break;
 
+            default:
+              g_assert_not_reached ();
               break;
             }
 
@@ -3608,7 +3617,7 @@ gtk_notebook_focus (GtkWidget        *widget,
 
       if (old_focus_child == priv->action_widget[ACTION_WIDGET_START])
         {
-          switch (effective_direction)
+          switch ((guint) effective_direction)
             {
             case GTK_DIR_DOWN:
               return focus_child_in (notebook, GTK_DIR_TAB_FORWARD);
@@ -3619,7 +3628,7 @@ gtk_notebook_focus (GtkWidget        *widget,
             case GTK_DIR_UP:
               return FALSE;
             default:
-              switch (direction)
+              switch ((guint) direction)
                 {
                 case GTK_DIR_TAB_FORWARD:
                   if ((priv->tab_pos == GTK_POS_RIGHT || priv->tab_pos == GTK_POS_BOTTOM) &&
@@ -3630,12 +3639,13 @@ gtk_notebook_focus (GtkWidget        *widget,
                   return FALSE;
                 default:
                   g_assert_not_reached ();
+                  break;
                 }
             }
         }
       else if (old_focus_child == priv->action_widget[ACTION_WIDGET_END])
         {
-          switch (effective_direction)
+          switch ((guint) effective_direction)
             {
             case GTK_DIR_DOWN:
               return focus_child_in (notebook, GTK_DIR_TAB_FORWARD);
@@ -3646,7 +3656,7 @@ gtk_notebook_focus (GtkWidget        *widget,
             case GTK_DIR_UP:
               return FALSE;
             default:
-              switch (direction)
+              switch ((guint) direction)
                 {
                 case GTK_DIR_TAB_FORWARD:
                   return FALSE;
@@ -3657,12 +3667,13 @@ gtk_notebook_focus (GtkWidget        *widget,
                   return focus_tabs_in (notebook);
                 default:
                   g_assert_not_reached ();
+                  break;
                 }
             }
         }
       else
         {
-          switch (effective_direction)
+          switch ((guint) effective_direction)
             {
             case GTK_DIR_TAB_BACKWARD:
             case GTK_DIR_UP:
@@ -3674,12 +3685,14 @@ gtk_notebook_focus (GtkWidget        *widget,
               return FALSE;
             case GTK_DIR_TAB_FORWARD:
               return focus_action_in (notebook, last_action, direction);
+            default:
+              break;
             }
         }
     }
   else if (widget_is_focus)     /* Focus was on tabs */
     {
-      switch (effective_direction)
+      switch ((guint) effective_direction)
         {
         case GTK_DIR_TAB_BACKWARD:
               return focus_action_in (notebook, first_action, direction);
@@ -3699,11 +3712,13 @@ gtk_notebook_focus (GtkWidget        *widget,
           return focus_tabs_move (notebook, direction, STEP_PREV);
         case GTK_DIR_RIGHT:
           return focus_tabs_move (notebook, direction, STEP_NEXT);
+        default:
+          break;
         }
     }
   else /* Focus was not on widget */
     {
-      switch (effective_direction)
+      switch ((guint) effective_direction)
         {
         case GTK_DIR_TAB_FORWARD:
         case GTK_DIR_DOWN:
@@ -3729,6 +3744,8 @@ gtk_notebook_focus (GtkWidget        *widget,
         case GTK_DIR_LEFT:
         case GTK_DIR_RIGHT:
           return focus_child_in (notebook, direction);
+        default:
+          break;
         }
     }
 
@@ -4420,6 +4437,9 @@ gtk_notebook_snapshot_tabs (GtkGizmo    *gizmo,
         case GTK_POS_RIGHT:
           step = STEP_PREV;
           break;
+        default:
+          g_assert_not_reached ();
+          break;
         }
     }
 
@@ -4601,6 +4621,9 @@ gtk_notebook_allocate_arrows (GtkNotebook   *notebook,
         }
       break;
 
+    default:
+      g_assert_not_reached ();
+      break;
     }
 }
 
@@ -4650,6 +4673,10 @@ gtk_notebook_tab_space (GtkNotebook         *notebook,
             *tab_space += page->requisition.height;
         }
       break;
+
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   if (!priv->scrollable)
@@ -4680,6 +4707,10 @@ gtk_notebook_tab_space (GtkNotebook         *notebook,
               *tab_space = tabs_allocation->height;
             }
           break;
+
+        default:
+          g_assert_not_reached ();
+          break;
         }
     }
 }
@@ -4903,14 +4934,14 @@ get_allocate_at_bottom (GtkWidget *widget,
       else
         return (search_direction == STEP_NEXT);
 
-      break;
     case GTK_POS_RIGHT:
     case GTK_POS_LEFT:
       return (search_direction == STEP_PREV);
-      break;
-    }
 
-  return FALSE;
+    default:
+      g_assert_not_reached ();
+      return FALSE;
+    }
 }
 
 static void
@@ -4939,7 +4970,6 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook          *notebook,
   widget = GTK_WIDGET (notebook);
   tab_pos = get_effective_tab_pos (notebook);
   allocate_at_bottom = get_allocate_at_bottom (widget, direction);
-  anchor = 0;
 
   child_allocation = *allocation;
 
@@ -4958,6 +4988,11 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook          *notebook,
         child_allocation.y += allocation->height;
       anchor = child_allocation.y;
       break;
+
+    default:
+      g_assert_not_reached ();
+      anchor = 0;
+      break;
     }
 
   gtk_widget_get_own_allocation (priv->cur_page->tab_widget, &drag_allocation);
@@ -5094,7 +5129,10 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook          *notebook,
 
               child_allocation.y = anchor;
             }
+          break;
 
+        default:
+          g_assert_not_reached ();
           break;
         }
 
@@ -5165,6 +5203,9 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook          *notebook,
             }
 
           break;
+        default:
+          g_assert_not_reached ();
+      break;
         }
     }
 
@@ -5192,6 +5233,9 @@ gtk_notebook_calculate_tabs_allocation (GtkNotebook          *notebook,
               (allocate_at_bottom && priv->drag_window_y < anchor))
             priv->drag_window_y = anchor;
           break;
+        default:
+          g_assert_not_reached ();
+          break;
         }
     }
 }
@@ -5319,6 +5363,9 @@ gtk_notebook_calc_tabs (GtkNotebook  *notebook,
             children = children->prev;
         }
       break;
+    default:
+      g_assert_not_reached ();
+      break;
     }
 }
 
@@ -5409,7 +5456,7 @@ gtk_notebook_page_select (GtkNotebook *notebook,
 {
   GtkNotebookPrivate *priv = notebook->priv;
   GtkNotebookPage *page;
-  GtkDirectionType dir = GTK_DIR_DOWN; /* Quiet GCC */
+  GtkDirectionType dir;
   GtkPositionType tab_pos = get_effective_tab_pos (notebook);
 
   if (!priv->focus_tab)
@@ -5434,6 +5481,10 @@ gtk_notebook_page_select (GtkNotebook *notebook,
         case GTK_POS_RIGHT:
           dir = GTK_DIR_LEFT;
           break;
+        default:
+          g_assert_not_reached ();
+          dir = GTK_DIR_DOWN;
+          break;
         }
 
       if (gtk_widget_child_focus (page->child, dir))
@@ -6242,6 +6293,9 @@ gtk_notebook_update_tab_pos (GtkNotebook *notebook)
       gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->box), GTK_ORIENTATION_HORIZONTAL);
       gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->header_widget), GTK_ORIENTATION_VERTICAL);
       break;
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   update_node_ordering (notebook);
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index 355ad9f..85d918c 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -124,6 +124,9 @@ effective_align (GtkAlign         align,
       return direction == GTK_TEXT_DIR_RTL ? GTK_ALIGN_END : GTK_ALIGN_START;
     case GTK_ALIGN_END:
       return direction == GTK_TEXT_DIR_RTL ? GTK_ALIGN_START : GTK_ALIGN_END;
+    case GTK_ALIGN_FILL:
+    case GTK_ALIGN_CENTER:
+    case GTK_ALIGN_BASELINE:
     default:
       return align;
     }
diff --git a/gtk/gtkpadcontroller.c b/gtk/gtkpadcontroller.c
index ad4457a..9161416 100644
--- a/gtk/gtkpadcontroller.c
+++ b/gtk/gtkpadcontroller.c
@@ -248,7 +248,7 @@ gtk_pad_controller_handle_event (GtkEventController *controller,
       return GDK_EVENT_PROPAGATE;
     }
 
-  switch (event_type)
+  switch ((guint) event_type)
     {
     case GDK_PAD_BUTTON_PRESS:
       type = GTK_PAD_ACTION_BUTTON;
diff --git a/gtk/gtkpagesetupunixdialog.c b/gtk/gtkpagesetupunixdialog.c
index 368f03a..044b5ed 100644
--- a/gtk/gtkpagesetupunixdialog.c
+++ b/gtk/gtkpagesetupunixdialog.c
@@ -936,6 +936,8 @@ set_orientation (GtkPageSetupUnixDialog *dialog,
     case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
       gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->reverse_landscape_radio), TRUE);
       break;
+    default:
+      break;
     }
 }
 
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index da21bc1..a759190 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -2346,6 +2346,8 @@ gtk_paned_move_handle (GtkPaned      *paned,
          new_position = priv->max_position;
          break;
 
+       case GTK_SCROLL_NONE:
+       case GTK_SCROLL_JUMP:
        default:
          break;
        }
diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c
index 98f787a..2c87e8c 100644
--- a/gtk/gtkpango.c
+++ b/gtk/gtkpango.c
@@ -761,8 +761,14 @@ pango_layout_get_line_before (PangoLayout     *layout,
                     start_index = 0;
                   end_index = prev_line->start_index + prev_line->length;
                   break;
+                case ATK_TEXT_BOUNDARY_CHAR:
+                case ATK_TEXT_BOUNDARY_WORD_START:
+                case ATK_TEXT_BOUNDARY_WORD_END:
+                case ATK_TEXT_BOUNDARY_SENTENCE_START:
+                case ATK_TEXT_BOUNDARY_SENTENCE_END:
                 default:
                   g_assert_not_reached();
+                  break;
                 }
             }
           else
@@ -823,8 +829,14 @@ pango_layout_get_line_at (PangoLayout     *layout,
               if (prev_line)
                 start_index = prev_line->start_index + prev_line->length;
               break;
+            case ATK_TEXT_BOUNDARY_CHAR:
+            case ATK_TEXT_BOUNDARY_WORD_START:
+            case ATK_TEXT_BOUNDARY_WORD_END:
+            case ATK_TEXT_BOUNDARY_SENTENCE_START:
+            case ATK_TEXT_BOUNDARY_SENTENCE_END:
             default:
               g_assert_not_reached();
+              break;
             }
 
           found = TRUE;
@@ -887,8 +899,14 @@ pango_layout_get_line_after (PangoLayout     *layout,
                   start_index = end_index;
                   end_index = line->start_index + line->length;
                   break;
+                case ATK_TEXT_BOUNDARY_CHAR:
+                case ATK_TEXT_BOUNDARY_WORD_START:
+                case ATK_TEXT_BOUNDARY_WORD_END:
+                case ATK_TEXT_BOUNDARY_SENTENCE_START:
+                case ATK_TEXT_BOUNDARY_SENTENCE_END:
                 default:
                   g_assert_not_reached();
+                  break;
                 }
             }
           else
@@ -1004,6 +1022,10 @@ _gtk_pango_get_text_before (PangoLayout     *layout,
     case ATK_TEXT_BOUNDARY_LINE_END:
       pango_layout_get_line_before (layout, boundary_type, offset, &start, &end);
       break;
+
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   *start_offset = start;
@@ -1111,6 +1133,10 @@ _gtk_pango_get_text_after (PangoLayout     *layout,
     case ATK_TEXT_BOUNDARY_LINE_END:
       pango_layout_get_line_after (layout, boundary_type, offset, &start, &end);
       break;
+
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   *start_offset = start;
@@ -1210,6 +1236,10 @@ _gtk_pango_get_text_at (PangoLayout     *layout,
     case ATK_TEXT_BOUNDARY_LINE_END:
       pango_layout_get_line_at (layout, boundary_type, offset, &start, &end);
       break;
+
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   *start_offset = start;
diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c
index 899fc1b..e58927f 100644
--- a/gtk/gtkpathbar.c
+++ b/gtk/gtkpathbar.c
@@ -1230,6 +1230,8 @@ set_button_image_get_info_cb (GCancellable *cancellable,
         g_set_object (&data->path_bar->priv->desktop_icon, icon);
        break;
 
+      case NORMAL_BUTTON:
+      case ROOT_BUTTON:
       default:
        break;
     };
@@ -1309,6 +1311,8 @@ set_button_image (GtkPathBar *path_bar,
                                   set_button_image_get_info_cb,
                                   data);
       break;
+
+    case NORMAL_BUTTON:
     default:
       break;
     }
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 8cb1a4f..21c2ad3 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -516,6 +516,7 @@ special_directory_get_gicon (GUserDirectory directory)
     ICON_CASE (TEMPLATES);
     ICON_CASE (VIDEOS);
 
+    case G_USER_N_DIRECTORIES:
     default:
       return g_themed_icon_new_with_default_fallbacks (ICON_NAME_FOLDER);
     }
diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c
index d31e30c..19a4e38 100644
--- a/gtk/gtkpopover.c
+++ b/gtk/gtkpopover.c
@@ -1180,6 +1180,8 @@ gtk_popover_update_position (GtkPopover *popover)
     case GTK_POS_RIGHT:
       rect.x -= priv->transition_diff;
       break;
+    default:
+      break;
     }
 
   _gtk_window_set_popover_position (priv->window, widget,
@@ -1363,6 +1365,8 @@ gtk_popover_size_allocate (GtkWidget           *widget,
       child_alloc.x += TAIL_HEIGHT;
       child_alloc.y += TAIL_HEIGHT / 2;
       break;
+    default:
+      break;
     }
 
   gtk_widget_size_allocate (priv->contents_widget, &child_alloc, -1, out_clip);
diff --git a/gtk/gtkprinteroptionwidget.c b/gtk/gtkprinteroptionwidget.c
index 2bd5832..1707e15 100644
--- a/gtk/gtkprinteroptionwidget.c
+++ b/gtk/gtkprinteroptionwidget.c
@@ -648,6 +648,14 @@ combo_changed_cb (GtkWidget              *combo,
         case GTK_PRINTER_OPTION_TYPE_PICKONE_REAL:
           filtered_val = filter_numeric (value, TRUE, TRUE, &changed);
           break;
+        case GTK_PRINTER_OPTION_TYPE_BOOLEAN:
+        case GTK_PRINTER_OPTION_TYPE_PICKONE:
+        case GTK_PRINTER_OPTION_TYPE_PICKONE_PASSWORD:
+        case GTK_PRINTER_OPTION_TYPE_PICKONE_STRING:
+        case GTK_PRINTER_OPTION_TYPE_ALTERNATIVE:
+        case GTK_PRINTER_OPTION_TYPE_STRING:
+        case GTK_PRINTER_OPTION_TYPE_FILESAVE:
+        case GTK_PRINTER_OPTION_TYPE_INFO:
         default:
           break;
         }
diff --git a/gtk/gtkprintoperation-portal.c b/gtk/gtkprintoperation-portal.c
index faeee25..97bec76 100644
--- a/gtk/gtkprintoperation-portal.c
+++ b/gtk/gtkprintoperation-portal.c
@@ -129,6 +129,9 @@ portal_start_page (GtkPrintOperation *op,
               case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
                 cairo_ps_surface_dsc_comment (op_portal->surface, "%%PageOrientation: Landscape");
                 break;
+
+              default:
+                break;
             }
          }
       else if (type == CAIRO_SURFACE_TYPE_PDF)
diff --git a/gtk/gtkprintoperation-unix.c b/gtk/gtkprintoperation-unix.c
index dee683f..2c45426 100644
--- a/gtk/gtkprintoperation-unix.c
+++ b/gtk/gtkprintoperation-unix.c
@@ -103,6 +103,8 @@ unix_start_page (GtkPrintOperation *op,
               case GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE:
                 cairo_ps_surface_dsc_comment (op_unix->surface, "%%PageOrientation: Landscape");
                 break;
+              default:
+                break;
             }
          }
       else if (type == CAIRO_SURFACE_TYPE_PDF)
diff --git a/gtk/gtkprintoperation.c b/gtk/gtkprintoperation.c
index 329a07a..516f694 100644
--- a/gtk/gtkprintoperation.c
+++ b/gtk/gtkprintoperation.c
@@ -324,8 +324,9 @@ preview_iface_is_selected (GtkPrintOperationPreview *preview,
            return TRUE;
        }
       return FALSE;
+    default:
+      return FALSE;
     }
-  return FALSE;
 }
 
 static void
diff --git a/gtk/gtkprintutils.c b/gtk/gtkprintutils.c
index 35affcf..6bcb6dc 100644
--- a/gtk/gtkprintutils.c
+++ b/gtk/gtkprintutils.c
@@ -29,6 +29,7 @@ _gtk_print_convert_to_mm (gdouble len,
       return len;
     case GTK_UNIT_INCH:
       return len * MM_PER_INCH;
+    case GTK_UNIT_NONE:
     default:
       g_warning ("Unsupported unit");
       /* Fall through */
@@ -48,6 +49,7 @@ _gtk_print_convert_from_mm (gdouble len,
       return len;
     case GTK_UNIT_INCH:
       return len / MM_PER_INCH;
+    case GTK_UNIT_NONE:
     default:
       g_warning ("Unsupported unit");
       /* Fall through */
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index c6fb78e..75d4126 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -2219,7 +2219,7 @@ autoscroll_cb (GtkWidget     *widget,
   step = gtk_adjustment_get_step_increment (adj);
   page = gtk_adjustment_get_page_increment (adj);
 
-  switch (priv->autoscroll_mode)
+  switch ((guint) priv->autoscroll_mode)
     {
     case GTK_SCROLL_STEP_FORWARD:
       increment = step / AUTOSCROLL_FACTOR;
@@ -2655,6 +2655,7 @@ gtk_range_scroll (GtkRange     *range,
       break;
 
     case GTK_SCROLL_NONE:
+    default:
       break;
     }
 
diff --git a/gtk/gtkrecentfilter.c b/gtk/gtkrecentfilter.c
index 4062db5..506e0aa 100644
--- a/gtk/gtkrecentfilter.c
+++ b/gtk/gtkrecentfilter.c
@@ -827,6 +827,9 @@ gtk_recent_filter_filter (GtkRecentFilter           *filter,
           if (rule->u.custom.func (filter_info, rule->u.custom.data))
             return TRUE;
           break;
+        default:
+          g_assert_not_reached ();
+          break;
         }
     }
   
diff --git a/gtk/gtkrecentmanager.c b/gtk/gtkrecentmanager.c
index 8182ff5..734eb44 100644
--- a/gtk/gtkrecentmanager.c
+++ b/gtk/gtkrecentmanager.c
@@ -556,6 +556,15 @@ gtk_recent_manager_monitor_changed (GFileMonitor      *monitor,
       gdk_threads_leave ();
       break;
 
+    case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
+    case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
+    case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
+    case G_FILE_MONITOR_EVENT_UNMOUNTED:
+    case G_FILE_MONITOR_EVENT_MOVED:
+    case G_FILE_MONITOR_EVENT_RENAMED:
+    case G_FILE_MONITOR_EVENT_MOVED_IN:
+    case G_FILE_MONITOR_EVENT_MOVED_OUT:
+
     default:
       break;
     }
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index 3d4bbba..39ffdf3 100644
--- a/gtk/gtkrender.c
+++ b/gtk/gtkrender.c
@@ -682,6 +682,10 @@ gtk_css_style_render_frame_gap (GtkCssStyle     *style,
       wc = border_width;
       hc = MAX (xy1_gap - xy0_gap - 2 * border_width, 0);
       break;
+
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   cairo_clip_extents (cr, &x0, &y0, &x1, &y1);
diff --git a/gtk/gtkrevealer.c b/gtk/gtkrevealer.c
index 4aeffd8..df11832 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;
         }
     }
 
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 48ff14f..5e9259e 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1316,6 +1316,9 @@ gtk_scale_get_range_border (GtkRange  *range,
         case GTK_POS_BOTTOM:
           border->bottom += value_size;
           break;
+        default:
+          g_assert_not_reached ();
+          break;
         }
     }
 
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index d73aff5..021ebf6 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -2872,6 +2872,8 @@ gtk_scrolled_window_scroll_child (GtkScrolledWindow *scrolled_window,
     case GTK_SCROLL_START:
     case GTK_SCROLL_END:
       break;
+    case GTK_SCROLL_NONE:
+    case GTK_SCROLL_JUMP:
     default:
       g_warning ("Invalid scroll type %u for GtkScrolledWindow::scroll-child", scroll);
       return FALSE;
@@ -2916,6 +2918,16 @@ gtk_scrolled_window_scroll_child (GtkScrolledWindow *scrolled_window,
        case GTK_SCROLL_END:
          value = gtk_adjustment_get_upper (adjustment);
          break;
+        case GTK_SCROLL_STEP_UP:
+        case GTK_SCROLL_STEP_DOWN:
+        case GTK_SCROLL_STEP_LEFT:
+        case GTK_SCROLL_STEP_RIGHT:
+        case GTK_SCROLL_PAGE_UP:
+        case GTK_SCROLL_PAGE_DOWN:
+        case GTK_SCROLL_PAGE_LEFT:
+        case GTK_SCROLL_PAGE_RIGHT:
+        case GTK_SCROLL_NONE:
+        case GTK_SCROLL_JUMP:
        default:
          g_assert_not_reached ();
          break;
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index e2b5d43..0f199ae 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -1402,6 +1402,9 @@ gtk_settings_notify (GObject    *object,
     case PROP_CURSOR_THEME_SIZE:
       settings_update_cursor_theme (settings);
       break;
+    default:
+      g_assert_not_reached ();
+      break;
     }
 }
 
diff --git a/gtk/gtkshortcutsshortcut.c b/gtk/gtkshortcutsshortcut.c
index 6ae5366..be280e9 100644
--- a/gtk/gtkshortcutsshortcut.c
+++ b/gtk/gtkshortcutsshortcut.c
@@ -240,7 +240,9 @@ update_icon_from_type (GtkShortcutsShortcut *self)
       icon = g_themed_icon_new ("gesture-swipe-right-symbolic");
       break;
 
-    default: ;
+    case GTK_SHORTCUT_ACCELERATOR:
+    case GTK_SHORTCUT_GESTURE:
+    default:
       icon = NULL;
       break;
     }
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 0785312..2cd6c28 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -1274,6 +1274,8 @@ gtk_spin_button_real_change_value (GtkSpinButton *spin,
         break;
       }
 
+    case GTK_SCROLL_NONE:
+    case GTK_SCROLL_JUMP:
     default:
       g_warning ("Invalid scroll type %d for GtkSpinButton::change-value", scroll);
       break;
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index f64f763..2bfa5c5 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -712,9 +712,23 @@ get_simple_transition_type (gboolean               new_child_first,
       return new_child_first ? GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT : GTK_STACK_TRANSITION_TYPE_OVER_LEFT;
     case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT:
       return new_child_first ? GTK_STACK_TRANSITION_TYPE_UNDER_LEFT : GTK_STACK_TRANSITION_TYPE_OVER_RIGHT;
-    default: ;
+    case GTK_STACK_TRANSITION_TYPE_SLIDE_UP:
+    case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN:
+    case GTK_STACK_TRANSITION_TYPE_OVER_UP:
+    case GTK_STACK_TRANSITION_TYPE_OVER_DOWN:
+    case GTK_STACK_TRANSITION_TYPE_UNDER_UP:
+    case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN:
+    case GTK_STACK_TRANSITION_TYPE_NONE:
+    case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT:
+    case GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT:
+    case GTK_STACK_TRANSITION_TYPE_OVER_LEFT:
+    case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT:
+    case GTK_STACK_TRANSITION_TYPE_UNDER_LEFT:
+    case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT:
+    case GTK_STACK_TRANSITION_TYPE_CROSSFADE:
+    default:
+      return transition_type;
     }
-  return transition_type;
 }
 
 static gint
@@ -858,11 +872,28 @@ effective_transition_type (GtkStack               *stack,
           return GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT;
         case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT:
           return GTK_STACK_TRANSITION_TYPE_UNDER_LEFT;
-        default: ;
+        case GTK_STACK_TRANSITION_TYPE_SLIDE_UP:
+        case GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN:
+        case GTK_STACK_TRANSITION_TYPE_OVER_UP:
+        case GTK_STACK_TRANSITION_TYPE_OVER_DOWN:
+        case GTK_STACK_TRANSITION_TYPE_UNDER_UP:
+        case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN:
+        case GTK_STACK_TRANSITION_TYPE_NONE:
+        case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT:
+        case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN:
+        case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN:
+        case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP:
+        case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT:
+        case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT:
+        case GTK_STACK_TRANSITION_TYPE_CROSSFADE:
+        default:
+          return transition_type;
         }
     }
-
-  return transition_type;
+  else
+    {
+      return transition_type;
+    }
 }
 
 static void
@@ -1847,7 +1878,7 @@ gtk_stack_snapshot_under (GtkWidget   *widget,
 
   pos_x = pos_y = 0;
 
-  switch (priv->active_transition_type)
+  switch ((guint) priv->active_transition_type)
     {
     case GTK_STACK_TRANSITION_TYPE_UNDER_DOWN:
       y = 0;
@@ -1913,7 +1944,7 @@ gtk_stack_snapshot_slide (GtkWidget   *widget,
       x = get_bin_window_x (stack);
       y = get_bin_window_y (stack);
 
-      switch (priv->active_transition_type)
+      switch ((guint) priv->active_transition_type)
         {
         case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT:
           x -= width;
@@ -2015,6 +2046,13 @@ gtk_stack_snapshot (GtkWidget   *widget,
             case GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT:
              gtk_stack_snapshot_under (widget, snapshot);
               break;
+            case GTK_STACK_TRANSITION_TYPE_NONE:
+            case GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT:
+            case GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN:
+            case GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN:
+            case GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP:
+            case GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT:
+            case GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT:
             default:
               g_assert_not_reached ();
             }
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index 81b95f5..b75ba63 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -4577,6 +4577,10 @@ _gtk_text_buffer_get_text_before (GtkTextBuffer   *buffer,
           gtk_text_iter_forward_to_line_end (end);
         }
       break;
+
+    default:
+      g_assert_not_reached ();
+      break;
     }
 }
 
@@ -4678,6 +4682,10 @@ _gtk_text_buffer_get_text_at (GtkTextBuffer   *buffer,
         }
       gtk_text_iter_forward_to_line_end (end);
       break;
+
+    default:
+      g_assert_not_reached ();
+      break;
    }
 }
 
@@ -4771,6 +4779,9 @@ _gtk_text_buffer_get_text_after (GtkTextBuffer   *buffer,
           gtk_text_iter_forward_to_line_end (end);
         }
       break;
+    default:
+      g_assert_not_reached ();
+      break;
     }
 }
 
diff --git a/gtk/gtktextbufferserialize.c b/gtk/gtktextbufferserialize.c
index 45ea75c..5df71c6 100644
--- a/gtk/gtktextbufferserialize.c
+++ b/gtk/gtktextbufferserialize.c
@@ -1334,6 +1334,8 @@ start_element_handler (GMarkupParseContext  *context,
                               attribute_names, attribute_values,
                               info, error);
       break;
+    case STATE_ATTR:
+    case STATE_PIXBUF:
     default:
       g_assert_not_reached ();
       break;
@@ -1451,6 +1453,7 @@ end_element_handler (GMarkupParseContext  *context,
       g_assert (peek_state (info) == STATE_APPLY_TAG ||
                peek_state (info) == STATE_TEXT);
       break;
+    case STATE_START:
     default:
       g_assert_not_reached ();
       break;
@@ -1493,13 +1496,9 @@ text_handler (GMarkupParseContext  *context,
       peek_state (info) != STATE_APPLY_TAG)
     return;
 
-  switch (peek_state (info))
+  if (peek_state (info) == STATE_TEXT ||
+      peek_state (info) == STATE_APPLY_TAG)
     {
-    case STATE_START:
-      g_assert_not_reached (); /* gmarkup shouldn't do this */
-      break;
-    case STATE_TEXT:
-    case STATE_APPLY_TAG:
       if (text_len == 0)
        return;
 
@@ -1508,10 +1507,6 @@ text_handler (GMarkupParseContext  *context,
       span->tags = g_slist_copy (info->tag_stack);
 
       info->spans = g_list_prepend (info->spans, span);
-      break;
-    default:
-      g_assert_not_reached ();
-      break;
     }
 }
 
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index ad3d1e0..75c37a5 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -1349,6 +1349,11 @@ set_para_values (GtkTextLayout      *layout,
     case PANGO_DIRECTION_RTL :
       display->direction = GTK_TEXT_DIR_RTL;
       break;
+    case PANGO_DIRECTION_LTR:
+    case PANGO_DIRECTION_TTB_LTR:
+    case PANGO_DIRECTION_TTB_RTL:
+    case PANGO_DIRECTION_WEAK_LTR:
+    case PANGO_DIRECTION_WEAK_RTL:
     default:
       display->direction = GTK_TEXT_DIR_LTR;
       break;
@@ -1411,6 +1416,7 @@ set_para_values (GtkTextLayout      *layout,
       break;
 
     case GTK_WRAP_NONE:
+    default:
       break;
     }
 
@@ -1998,7 +2004,7 @@ add_preedit_attrs (GtkTextLayout     *layout,
          PangoAttribute *attr = tmp_list->data;
          GdkRGBA rgba;
          
-         switch (attr->klass->type)
+         switch ((guint) attr->klass->type)
            {
            case PANGO_ATTR_FOREGROUND:
              convert_color (&rgba, (PangoAttrColor *)attr);
@@ -2583,6 +2589,7 @@ gtk_text_layout_get_line_display (GtkTextLayout *layout,
       switch (pango_layout_get_alignment (display->layout))
        {
        case PANGO_ALIGN_LEFT:
+        default:
          break;
        case PANGO_ALIGN_CENTER:
          display->x_offset += excess / 2;
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index 6dab6d7..e149e81 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -1044,9 +1044,9 @@ get_property_font_set_mask (guint prop_id)
       return PANGO_FONT_MASK_STRETCH;
     case PROP_SIZE_SET:
       return PANGO_FONT_MASK_SIZE;
+    default:
+      return 0;
     }
-
-  return 0;
 }
 
 static PangoFontMask
@@ -1322,6 +1322,9 @@ gtk_text_tag_set_property (GObject      *object,
                                             g_value_get_double (value) * PANGO_SCALE);
            g_object_notify (object, "size");
            break;
+
+          default:
+            break;
          }
 
        size_changed = TRUE;
@@ -1708,45 +1711,40 @@ gtk_text_tag_get_property (GObject      *object,
       break;
 
     case PROP_FAMILY:
+      gtk_text_tag_ensure_font (tag);
+      g_value_set_string (value, pango_font_description_get_family (priv->values->font));
+      break;
+      
     case PROP_STYLE:
+      gtk_text_tag_ensure_font (tag);
+      g_value_set_enum (value, pango_font_description_get_style (priv->values->font));
+      break;
+      
     case PROP_VARIANT:
+      gtk_text_tag_ensure_font (tag);
+      g_value_set_enum (value, pango_font_description_get_variant (priv->values->font));
+      break;
+      
     case PROP_WEIGHT:
+      gtk_text_tag_ensure_font (tag);
+      g_value_set_int (value, pango_font_description_get_weight (priv->values->font));
+      break;
+      
     case PROP_STRETCH:
+      gtk_text_tag_ensure_font (tag);
+      g_value_set_enum (value, pango_font_description_get_stretch (priv->values->font));
+      break;
+      
     case PROP_SIZE:
-    case PROP_SIZE_POINTS:
       gtk_text_tag_ensure_font (tag);
-      switch (prop_id)
-       {
-       case PROP_FAMILY:
-         g_value_set_string (value, pango_font_description_get_family (priv->values->font));
-         break;
-         
-       case PROP_STYLE:
-         g_value_set_enum (value, pango_font_description_get_style (priv->values->font));
-         break;
-         
-       case PROP_VARIANT:
-         g_value_set_enum (value, pango_font_description_get_variant (priv->values->font));
-         break;
-         
-       case PROP_WEIGHT:
-         g_value_set_int (value, pango_font_description_get_weight (priv->values->font));
-         break;
-         
-       case PROP_STRETCH:
-         g_value_set_enum (value, pango_font_description_get_stretch (priv->values->font));
-         break;
-         
-       case PROP_SIZE:
-         g_value_set_int (value, pango_font_description_get_size (priv->values->font));
-         break;
-         
-       case PROP_SIZE_POINTS:
-         g_value_set_double (value, ((double)pango_font_description_get_size (priv->values->font)) / 
(double)PANGO_SCALE);
-         break;
-       }
+      g_value_set_int (value, pango_font_description_get_size (priv->values->font));
       break;
       
+    case PROP_SIZE_POINTS:
+      gtk_text_tag_ensure_font (tag);
+      g_value_set_double (value, ((double)pango_font_description_get_size (priv->values->font)) / 
(double)PANGO_SCALE);
+      break;
+  
     case PROP_SCALE:
       g_value_set_double (value, priv->values->font_scale);
       break;
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 092f0c5..023e5e5 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -4939,7 +4939,7 @@ get_event_coordinates (GdkEvent *event, gint *x, gint *y)
   gdouble event_x, event_y;
 
   if (event)
-    switch (gdk_event_get_event_type (event))
+    switch ((guint) gdk_event_get_event_type (event))
       {
       case GDK_MOTION_NOTIFY:
       case GDK_BUTTON_PRESS:
@@ -6558,6 +6558,8 @@ gtk_text_view_move_cursor (GtkTextView     *text_view,
         gtk_text_buffer_get_iter_at_offset (get_buffer (text_view), &newplace, 0);
      break;
       
+    case GTK_MOVEMENT_PAGES:
+    case GTK_MOVEMENT_HORIZONTAL_PAGES:
     default:
       break;
     }
@@ -9700,7 +9702,12 @@ text_window_new (GtkTextWindowType  type,
         case GTK_TEXT_WINDOW_BOTTOM:
           gtk_css_node_add_class (win->css_node, g_quark_from_static_string (GTK_STYLE_CLASS_BOTTOM));
           break;
-        default: /* no extra style class */ ;
+        case GTK_TEXT_WINDOW_PRIVATE:
+        case GTK_TEXT_WINDOW_WIDGET:
+        case GTK_TEXT_WINDOW_TEXT:
+        default:
+          /* no extra style class */
+          break;
         }
     }
   g_object_unref (win->css_node);
@@ -9762,22 +9769,16 @@ text_window_realize (GtkTextWindow *win,
 
   gdk_window_show (win->bin_window);
 
-  switch (win->type)
+  if (win->type == GTK_TEXT_WINDOW_TEXT &&
+      gtk_widget_is_sensitive (widget))
     {
-    case GTK_TEXT_WINDOW_TEXT:
-      if (gtk_widget_is_sensitive (widget))
-        {
-          display = gdk_window_get_display (window);
-          cursor = gdk_cursor_new_from_name (display, "text");
-          gdk_window_set_cursor (win->bin_window, cursor);
-          g_clear_object (&cursor);
-        }
+      display = gdk_window_get_display (window);
+      cursor = gdk_cursor_new_from_name (display, "text");
+      gdk_window_set_cursor (win->bin_window, cursor);
+      g_clear_object (&cursor);
 
       gtk_im_context_set_client_widget (GTK_TEXT_VIEW (widget)->priv->im_context,
                                         widget);
-      break;
-    default:
-      break;
     }
 
   g_object_set_qdata (G_OBJECT (win->window),
@@ -9900,6 +9901,8 @@ text_window_invalidate_rect (GtkTextWindow *win,
       window_rect.height = win->allocation.height;
       break;
 
+    case GTK_TEXT_WINDOW_PRIVATE:
+    case GTK_TEXT_WINDOW_WIDGET:
     default:
       g_warning ("%s: bug!", G_STRFUNC);
       return;
@@ -10066,6 +10069,7 @@ gtk_text_view_get_window (GtkTextView *text_view,
       break;
 
     case GTK_TEXT_WINDOW_PRIVATE:
+    default:
       g_warning ("%s: You can't get GTK_TEXT_WINDOW_PRIVATE, it has \"PRIVATE\" in the name because it is 
private.", G_STRFUNC);
       return NULL;
       break;
@@ -10109,6 +10113,7 @@ gtk_text_view_get_css_node (GtkTextView       *text_view,
         return priv->bottom_window->css_node;
       break;
 
+    case GTK_TEXT_WINDOW_PRIVATE:
     default:
       break;
     }
@@ -10563,6 +10568,9 @@ gtk_text_view_set_border_window_size (GtkTextView      *text_view,
                          &priv->bottom_window);
       break;
 
+    case GTK_TEXT_WINDOW_PRIVATE:
+    case GTK_TEXT_WINDOW_WIDGET:
+    case GTK_TEXT_WINDOW_TEXT:
     default:
       g_warning ("Can only set size of left/right/top/bottom border windows with 
gtk_text_view_set_border_window_size()");
       break;
@@ -10609,6 +10617,9 @@ gtk_text_view_get_border_window_size (GtkTextView       *text_view,
         return priv->bottom_window->requisition.height;
       break;
       
+    case GTK_TEXT_WINDOW_PRIVATE:
+    case GTK_TEXT_WINDOW_WIDGET:
+    case GTK_TEXT_WINDOW_TEXT:
     default:
       g_warning ("Can only get size of left/right/top/bottom border windows with 
gtk_text_view_get_border_window_size()");
       break;
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c
index 8d98767..85b1c8b 100644
--- a/gtk/gtktoolbar.c
+++ b/gtk/gtktoolbar.c
@@ -2337,6 +2337,10 @@ show_menu (GtkToolbar     *toolbar,
                                 (GdkEvent *) event);
 
       break;
+
+    default:
+      g_assert_not_reached ();
+      break;
     }
 }
 
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c
index 7d2c20e..c94e1fd 100644
--- a/gtk/gtktoolbutton.c
+++ b/gtk/gtktoolbutton.c
@@ -500,6 +500,7 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
 
   switch (style)
     {
+    default:
     case GTK_TOOLBAR_ICONS:
       if (icon)
         gtk_container_add (GTK_CONTAINER (button->priv->button), icon);
diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c
index 2dd49f9..a21122c 100644
--- a/gtk/gtktoolitemgroup.c
+++ b/gtk/gtktoolitemgroup.c
@@ -357,6 +357,10 @@ gtk_tool_item_group_header_adjust_style (GtkToolItemGroup *group)
             gtk_label_set_ellipsize (GTK_LABEL (label_widget), priv->ellipsize);
           }
         break;
+
+      default:
+        g_assert_not_reached ();
+        break;
     }
 
   gtk_widget_set_margin_start (frame, dx);
diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c
index 7fab3c8..5bf8317 100644
--- a/gtk/gtktooltip.c
+++ b/gtk/gtktooltip.c
@@ -1442,7 +1442,7 @@ gtk_tooltip_handle_event_internal (GdkEventType  event_type,
       return;
     }
 
-  switch (event_type)
+  switch ((guint) event_type)
     {
       case GDK_BUTTON_PRESS:
       case GDK_KEY_PRESS:
diff --git a/gtk/gtktreeselection.c b/gtk/gtktreeselection.c
index 7150d1d..1bb43fc 100644
--- a/gtk/gtktreeselection.c
+++ b/gtk/gtktreeselection.c
@@ -1333,6 +1333,9 @@ gtk_tree_selection_real_modify_range (GtkTreeSelection *selection,
                                &end_node);
       anchor_path = start_path;
       break;
+    default:
+      g_assert_not_reached ();
+      break;
     }
 
   /* Invalid start or end node? */
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 2bb539c..5291940 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5153,6 +5153,9 @@ gtk_tree_view_bin_snapshot (GtkWidget   *widget,
             case GTK_TREE_VIEW_DROP_INTO_OR_AFTER:
               gtk_style_context_add_class (context, "into");
               break;
+
+            default:
+              break;
             }
 
           _gtk_tree_view_find_node (tree_view, drag_dest_path, &drag_tree, &drag_node);
@@ -5586,9 +5589,11 @@ gtk_tree_view_get_drop_column (GtkTreeView       *tree_view,
        else
          return (GtkTreeViewColumn *)0x1;
        break;
-    }
 
-  return (GtkTreeViewColumn *)0x1;
+      default:
+        return (GtkTreeViewColumn *)0x1;
+        break;
+    }
 }
 
 static gboolean
@@ -8541,6 +8546,11 @@ gtk_tree_view_real_move_cursor (GtkTreeView       *tree_view,
     case GTK_MOVEMENT_BUFFER_ENDS:
       gtk_tree_view_move_cursor_start_end (tree_view, count);
       break;
+    case GTK_MOVEMENT_WORDS:
+    case GTK_MOVEMENT_DISPLAY_LINE_ENDS:
+    case GTK_MOVEMENT_PARAGRAPHS:
+    case GTK_MOVEMENT_PARAGRAPH_ENDS:
+    case GTK_MOVEMENT_HORIZONTAL_PAGES:
     default:
       g_assert_not_reached ();
     }
diff --git a/gtk/gtktreeviewcolumn.c b/gtk/gtktreeviewcolumn.c
index eea86e7..8e30dfe 100644
--- a/gtk/gtktreeviewcolumn.c
+++ b/gtk/gtktreeviewcolumn.c
@@ -1053,7 +1053,7 @@ gtk_tree_view_column_button_event (GtkWidget *widget,
 
   if (priv->clickable == FALSE)
     {
-      switch (event_type)
+      switch ((guint) event_type)
        {
        case GDK_BUTTON_PRESS:
        case GDK_BUTTON_RELEASE:
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 3b425cb..51e39c3 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -5777,6 +5777,9 @@ effective_align (GtkAlign         align,
       return direction == GTK_TEXT_DIR_RTL ? GTK_ALIGN_END : GTK_ALIGN_START;
     case GTK_ALIGN_END:
       return direction == GTK_TEXT_DIR_RTL ? GTK_ALIGN_START : GTK_ALIGN_END;
+    case GTK_ALIGN_FILL:
+    case GTK_ALIGN_CENTER:
+    case GTK_ALIGN_BASELINE:
     default:
       return align;
     }
@@ -5792,6 +5795,7 @@ adjust_for_align (GtkAlign  align,
     {
     case GTK_ALIGN_BASELINE:
     case GTK_ALIGN_FILL:
+    default:
       /* change nothing */
       break;
     case GTK_ALIGN_START:
@@ -6695,7 +6699,7 @@ event_window_is_still_viewable (const GdkEvent *event)
    * at the last moment, since the event may have been queued
    * up behind other events, held over a recursive main loop, etc.
    */
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_EXPOSE:
     case GDK_MOTION_NOTIFY:
@@ -6762,7 +6766,7 @@ gtk_widget_event_internal (GtkWidget      *widget,
     return TRUE;
 
   /* Non input events get handled right away */
-  switch (event->type)
+  switch ((guint) event->type)
     {
     case GDK_VISIBILITY_NOTIFY:
     case GDK_EXPOSE:
@@ -6820,6 +6824,17 @@ gtk_widget_emit_event_signals (GtkWidget      *widget,
 
       switch (event->type)
        {
+        case GDK_DRAG_ENTER:
+        case GDK_DRAG_LEAVE:
+        case GDK_DRAG_MOTION:
+        case GDK_DRAG_STATUS:
+        case GDK_DROP_START:
+        case GDK_DROP_FINISHED:
+        case GDK_CLIENT_EVENT:
+        case GDK_SETTING:
+        case GDK_OWNER_CHANGE:
+        case GDK_DAMAGE:
+        case GDK_EVENT_LAST:
         case GDK_TOUCHPAD_SWIPE:
         case GDK_TOUCHPAD_PINCH:
         case GDK_PAD_BUTTON_PRESS:
@@ -7267,6 +7282,7 @@ gtk_widget_real_keynav_failed (GtkWidget        *widget,
     case GTK_DIR_DOWN:
     case GTK_DIR_LEFT:
     case GTK_DIR_RIGHT:
+    default:
       break;
     }
 
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 4d95aa2..91b637a 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1411,6 +1411,8 @@ gtk_window_titlebar_action (GtkWindow      *window,
     case GDK_BUTTON_SECONDARY:
       g_object_get (settings, "gtk-titlebar-right-click", &action, NULL);
       break;
+    default:
+      break;
     }
 
   if (action == NULL)
@@ -1531,6 +1533,14 @@ multipress_gesture_pressed_cb (GtkGestureMultiPress *gesture,
         gtk_gesture_set_sequence_state (GTK_GESTURE (gesture),
                                         sequence, GTK_EVENT_SEQUENCE_CLAIMED);
       break;
+    case GTK_WINDOW_REGION_EDGE_NW:
+    case GTK_WINDOW_REGION_EDGE_N:
+    case GTK_WINDOW_REGION_EDGE_NE:
+    case GTK_WINDOW_REGION_EDGE_W:
+    case GTK_WINDOW_REGION_EDGE_E:
+    case GTK_WINDOW_REGION_EDGE_SW:
+    case GTK_WINDOW_REGION_EDGE_S:
+    case GTK_WINDOW_REGION_EDGE_SE:
     default:
       if (!priv->maximized)
         {
@@ -1585,6 +1595,15 @@ drag_gesture_begin_cb (GtkGestureDrag *gesture,
           gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
 
         break;
+
+      case GTK_WINDOW_REGION_EDGE_NW:
+      case GTK_WINDOW_REGION_EDGE_N:
+      case GTK_WINDOW_REGION_EDGE_NE:
+      case GTK_WINDOW_REGION_EDGE_W:
+      case GTK_WINDOW_REGION_EDGE_E:
+      case GTK_WINDOW_REGION_EDGE_SW:
+      case GTK_WINDOW_REGION_EDGE_S:
+      case GTK_WINDOW_REGION_EDGE_SE:
       default:
         gtk_gesture_set_state (GTK_GESTURE (gesture), GTK_EVENT_SEQUENCE_DENIED);
     }
@@ -8502,6 +8521,7 @@ gtk_window_compute_configure_request (GtkWindow    *window,
           }
           break;
 
+        case GTK_WIN_POS_NONE:
         default:
           break;
         }
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 78b0d73..7f2ed0a 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -502,7 +502,16 @@ populate_render_node_properties (GtkListStore  *store,
       }
       break;
 
-    default: ;
+    case GSK_NOT_A_RENDER_NODE:
+    case GSK_CONTAINER_NODE:
+    case GSK_TRANSFORM_NODE:
+    case GSK_COLOR_MATRIX_NODE:
+    case GSK_REPEAT_NODE:
+    case GSK_CLIP_NODE:
+    case GSK_ROUNDED_CLIP_NODE:
+    case GSK_SHADOW_NODE:
+    default:
+      break;
     }
 }
 
diff --git a/meson.build b/meson.build
index 545e16d..5f2e82a 100644
--- a/meson.build
+++ b/meson.build
@@ -247,6 +247,8 @@ elif cc.get_id() == 'gcc' or cc.get_id() == 'clang'
     '-Wmissing-format-attribute',
     '-Wmissing-include-dirs',
     '-Wlogical-op',
+    '-Wswitch-default',
+    '-Wswitch-enum',
     '-Werror=redundant-decls',
     '-Werror=implicit',
     '-Werror=nonnull',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]