summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-12-20 22:56:28 +0000
committerPeter Harris <pharris@opentext.com>2013-02-06 11:19:18 -0500
commit3577db110e03985d4486cae6caf3ceb5696c45e9 (patch)
treed27873caf1f29b38ff36307563951f8fdd274d41
parent98fea59c11e5dbea4c4e1b6458f03754e311180b (diff)
downloadutil-image-3577db110e03985d4486cae6caf3ceb5696c45e9.tar.gz
Fix compilation when NDEBUG is defined
XORG_DEFAULT_OPTIONS enables -Werror=return-type xcb_image_get_pixel() and xcb_image_create_native() assume assert(0) is noreturn, and don't return a value in that case. But assert(0) isn't noreturn if NDEBUG is defined. Fix this by returning a suitable value. (Also, on the MinGW target, assert(0) is non-standard and may return even in the !NDEBUG case, as the C runtime may ask the user if they want to abort or not...) /jhbuild/checkout/xcb/xcb-util-image/image/xcb_image.c: In function 'xcb_image_get_pixel': /jhbuild/checkout/xcb/xcb-util-image/image/xcb_image.c:754:1: error: control reaches end of non-void function [-Wreturn-type] /jhbuild/checkout/xcb/xcb-util-image/image/xcb_image.c: In function 'xcb_image_create_native': /jhbuild/checkout/xcb/xcb-util-image/image/xcb_image.c:190:1: error: control reaches end of non-void function [-Wreturn-type] Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Peter Harris <pharris@opentext.com>
-rw-r--r--image/xcb_image.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/image/xcb_image.c b/image/xcb_image.c
index e426cbd..101aa4f 100644
--- a/image/xcb_image.c
+++ b/image/xcb_image.c
@@ -187,6 +187,7 @@ xcb_image_create_native (xcb_connection_t * c,
assert(0);
}
assert(0);
+ return NULL;
}
@@ -751,6 +752,7 @@ xcb_image_get_pixel (xcb_image_t *image,
default:
assert(0);
}
+ return 0;
}