[mutter/wip/fmuellner/shut-up-compiler-warning: 1/3] cogl: Fix builds with G_DISABLE_ASSERT
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/fmuellner/shut-up-compiler-warning: 1/3] cogl: Fix builds with G_DISABLE_ASSERT
- Date: Thu, 24 Jan 2019 23:50:49 +0000 (UTC)
commit 5c3ec27b4b4b13191edf92f8bcea3d8ac98c49e8
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Jan 25 00:19:21 2019 +0100
cogl: 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
cogl/cogl/cogl-bitmap-conversion.c | 1 +
cogl/cogl/driver/gl/cogl-buffer-gl.c | 1 +
cogl/cogl/winsys/cogl-winsys-egl.c | 2 ++
cogl/tests/conform/test-point-size-attribute.c | 1 +
cogl/tests/conform/test-point-size.c | 1 +
5 files changed, 6 insertions(+)
---
diff --git a/cogl/cogl/cogl-bitmap-conversion.c b/cogl/cogl/cogl-bitmap-conversion.c
index 9d20a47df..f1b91cee3 100644
--- a/cogl/cogl/cogl-bitmap-conversion.c
+++ b/cogl/cogl/cogl-bitmap-conversion.c
@@ -355,6 +355,7 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
}
g_assert_not_reached ();
+ return FALSE;
}
CoglBool
diff --git a/cogl/cogl/driver/gl/cogl-buffer-gl.c b/cogl/cogl/driver/gl/cogl-buffer-gl.c
index 6f542d5dd..871a6ff84 100644
--- a/cogl/cogl/driver/gl/cogl-buffer-gl.c
+++ b/cogl/cogl/driver/gl/cogl-buffer-gl.c
@@ -112,6 +112,7 @@ update_hints_to_gl_enum (CoglBuffer *buffer)
}
g_assert_not_reached ();
+ return 0;
}
static GLenum
diff --git a/cogl/cogl/winsys/cogl-winsys-egl.c b/cogl/cogl/winsys/cogl-winsys-egl.c
index 222e5a6e7..8153f3579 100644
--- a/cogl/cogl/winsys/cogl-winsys-egl.c
+++ b/cogl/cogl/winsys/cogl-winsys-egl.c
@@ -135,6 +135,7 @@ get_error_string (void)
return "Invalid surface";
default:
g_assert_not_reached ();
+ return NULL;
}
}
@@ -219,6 +220,7 @@ _cogl_winsys_renderer_connect (CoglRenderer *renderer,
{
/* This function must be overridden by a platform winsys */
g_assert_not_reached ();
+ return FALSE;
}
static void
diff --git a/cogl/tests/conform/test-point-size-attribute.c b/cogl/tests/conform/test-point-size-attribute.c
index 538f26a0f..5bc605142 100644
--- a/cogl/tests/conform/test-point-size-attribute.c
+++ b/cogl/tests/conform/test-point-size-attribute.c
@@ -30,6 +30,7 @@ calc_coord_offset (int pos, int pos_index, int point_size)
}
g_assert_not_reached ();
+ return 0;
}
static void
diff --git a/cogl/tests/conform/test-point-size.c b/cogl/tests/conform/test-point-size.c
index c64b7e266..c25840e9a 100644
--- a/cogl/tests/conform/test-point-size.c
+++ b/cogl/tests/conform/test-point-size.c
@@ -22,6 +22,7 @@ calc_coord_offset (int pos, int pos_index, int point_size)
}
g_assert_not_reached ();
+ return 0;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]