Fix builds with G_DISABLE_ASSERT

Commit 25f416c13d added additional compilation warnings, including
-Werror=return-type. There are several places where this results
in build failures if `g_assert_not_reached()` is disabled at compile
time and the compiler misses a return value.

https://gitlab.gnome.org/GNOME/mutter/issues/447
This commit is contained in:
Florian Müllner 2019-01-25 00:47:44 +01:00
parent de41f3ea28
commit d5a7bbd094
20 changed files with 25 additions and 0 deletions

View File

@ -994,6 +994,7 @@ get_connector_type_name (MetaConnectorType connector_type)
case META_CONNECTOR_TYPE_DSI: return "DSI"; case META_CONNECTOR_TYPE_DSI: return "DSI";
default: g_assert_not_reached (); default: g_assert_not_reached ();
} }
return NULL;
} }
static GList * static GList *

View File

@ -37,4 +37,5 @@ meta_monitor_transform_invert (MetaMonitorTransform transform)
return transform; return transform;
} }
g_assert_not_reached (); g_assert_not_reached ();
return 0;
} }

View File

@ -479,6 +479,7 @@ discrete_steps_to_scroll_direction (unsigned int axis,
return CLUTTER_SCROLL_RIGHT; return CLUTTER_SCROLL_RIGHT;
g_assert_not_reached (); g_assert_not_reached ();
return 0;
} }
static gboolean static gboolean

View File

@ -924,6 +924,7 @@ is_cursor_hw_state_valid (MetaCursorSprite *cursor_sprite,
} }
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
#ifdef HAVE_WAYLAND #ifdef HAVE_WAYLAND

View File

@ -173,6 +173,7 @@ meta_monitor_transform_to_xrandr (MetaMonitorTransform transform)
} }
g_assert_not_reached (); g_assert_not_reached ();
return 0;
} }
static gboolean static gboolean

View File

@ -70,6 +70,7 @@ get_x11_cogl_winsys_vtable (CoglRenderer *renderer)
break; break;
} }
g_assert_not_reached (); g_assert_not_reached ();
return NULL;
} }
static CoglRenderer * static CoglRenderer *

View File

@ -635,6 +635,7 @@ texture_has_alpha (CoglTexture *texture)
return FALSE; return FALSE;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
} }

View File

@ -348,6 +348,7 @@ meta_surface_actor_is_argb32 (MetaSurfaceActor *self)
return FALSE; return FALSE;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
} }

View File

@ -1246,6 +1246,7 @@ meta_rectangle_edge_aligns (const MetaRectangle *rect, const MetaEdge *edge)
BOX_LEFT (edge->rect) <= BOX_RIGHT (*rect); BOX_LEFT (edge->rect) <= BOX_RIGHT (*rect);
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
} }

View File

@ -1603,6 +1603,7 @@ get_event_route_from_grab_op (MetaGrabOp op)
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return 0;
} }
} }
@ -2622,6 +2623,7 @@ meta_display_supports_extended_barriers (MetaDisplay *display)
} }
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
/** /**

View File

@ -308,6 +308,7 @@ movement_towards_edge (MetaSide side, int increment)
return increment > 0; return increment > 0;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
} }

View File

@ -86,6 +86,7 @@ get_window_for_event (MetaDisplay *display,
return display->grab_window; return display->grab_window;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return NULL;
} }
} }

View File

@ -992,6 +992,7 @@ meta_get_locale_direction (void)
return META_LOCALE_DIRECTION_RTL; return META_LOCALE_DIRECTION_RTL;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return 0;
} }
} }

View File

@ -5498,6 +5498,7 @@ meta_window_get_workspaces (MetaWindow *window)
return NULL; return NULL;
else else
g_assert_not_reached (); g_assert_not_reached ();
return NULL;
} }
static void static void

View File

@ -955,6 +955,7 @@ grab_op_from_resize_control (MetaFrameControl control)
return META_GRAB_OP_RESIZING_W; return META_GRAB_OP_RESIZING_W;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return META_GRAB_OP_NONE;
} }
} }
@ -1003,6 +1004,7 @@ get_button_number (const ClutterEvent *event)
return clutter_event_get_button (event); return clutter_event_get_button (event);
g_assert_not_reached (); g_assert_not_reached ();
return -1;
} }
static gboolean static gboolean
@ -1105,6 +1107,7 @@ meta_frame_left_click_event (MetaUIFrame *frame,
return FALSE; return FALSE;
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
} }

View File

@ -373,6 +373,7 @@ meta_wayland_buffer_attach (MetaWaylandBuffer *buffer,
} }
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
CoglTexture * CoglTexture *

View File

@ -94,6 +94,7 @@ cogl_subpixel_order_to_wl_output_subpixel (CoglSubpixelOrder subpixel_order)
} }
g_assert_not_reached (); g_assert_not_reached ();
return WL_OUTPUT_SUBPIXEL_UNKNOWN;
} }
static enum wl_output_subpixel static enum wl_output_subpixel

View File

@ -1832,6 +1832,7 @@ positioner_anchor_to_placement_anchor (uint32_t anchor)
return (META_PLACEMENT_ANCHOR_BOTTOM | META_PLACEMENT_ANCHOR_RIGHT); return (META_PLACEMENT_ANCHOR_BOTTOM | META_PLACEMENT_ANCHOR_RIGHT);
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return META_PLACEMENT_ANCHOR_NONE;
} }
} }
@ -1860,6 +1861,7 @@ positioner_gravity_to_placement_gravity (uint32_t gravity)
return (META_PLACEMENT_GRAVITY_BOTTOM | META_PLACEMENT_GRAVITY_RIGHT); return (META_PLACEMENT_GRAVITY_BOTTOM | META_PLACEMENT_GRAVITY_RIGHT);
default: default:
g_assert_not_reached (); g_assert_not_reached ();
return META_PLACEMENT_GRAVITY_NONE;
} }
} }

View File

@ -302,6 +302,7 @@ standard_pict_format_for_depth (int depth)
default: default:
g_assert_not_reached (); g_assert_not_reached ();
} }
return 0;
} }
static XRenderPictFormat * static XRenderPictFormat *

View File

@ -931,6 +931,7 @@ is_edge_constraint_resizable (MetaEdgeConstraint constraint)
} }
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
static gboolean static gboolean
@ -946,6 +947,7 @@ is_edge_constraint_tiled (MetaEdgeConstraint constraint)
} }
g_assert_not_reached (); g_assert_not_reached ();
return FALSE;
} }
static unsigned long static unsigned long