[mutter/wip/fmuellner/shut-up-compiler-warning: 1/2] clutter: Fix builds with G_DISABLE_ASSERT



commit de41f3ea28021d5dbc4d09ee33b8e8acabd37819
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Jan 24 23:09:15 2019 +0100

    clutter: Fix builds with G_DISABLE_ASSERT
    
    Commit 25f416c13db 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

 clutter/clutter/clutter-pan-action.c       | 1 +
 clutter/clutter/clutter-shader-effect.c    | 1 +
 clutter/clutter/evdev/clutter-seat-evdev.c | 1 +
 3 files changed, 3 insertions(+)
---
diff --git a/clutter/clutter/clutter-pan-action.c b/clutter/clutter/clutter-pan-action.c
index fa08efaf9..5faee72d5 100644
--- a/clutter/clutter/clutter-pan-action.c
+++ b/clutter/clutter/clutter-pan-action.c
@@ -961,6 +961,7 @@ clutter_pan_action_get_motion_delta (ClutterPanAction *self,
       return clutter_pan_action_get_interpolated_delta (self, delta_x, delta_y);
     default:
       g_assert_not_reached ();
+      return 0.0f;
     }
 }
 
diff --git a/clutter/clutter/clutter-shader-effect.c b/clutter/clutter/clutter-shader-effect.c
index 5e3cabfb5..a5ae1ee40 100644
--- a/clutter/clutter/clutter-shader-effect.c
+++ b/clutter/clutter/clutter-shader-effect.c
@@ -333,6 +333,7 @@ clutter_shader_effect_create_shader (ClutterShaderEffect *self)
 
     default:
       g_assert_not_reached ();
+      return COGL_INVALID_HANDLE;
     }
 }
 
diff --git a/clutter/clutter/evdev/clutter-seat-evdev.c b/clutter/clutter/evdev/clutter-seat-evdev.c
index 6a7dd267a..329a6d6fd 100644
--- a/clutter/clutter/evdev/clutter-seat-evdev.c
+++ b/clutter/clutter/evdev/clutter-seat-evdev.c
@@ -766,6 +766,7 @@ discrete_to_direction (double discrete_dx,
     return CLUTTER_SCROLL_UP;
   else
     g_assert_not_reached ();
+  return 0;
 }
 
 void


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