From 0510bf4cd57ea023e23d781d3e1f38b2ea473df0 Mon Sep 17 00:00:00 2001 From: Ernestas Kulik <ernestask@gnome.org> Date: Fri, 16 Feb 2018 18:19:19 +0200 Subject: [PATCH 08/18] tests: data-input-stream: fix -Wduplicated-branches The fix makes things a bit awkward, but it seems to work just fine. https://bugzilla.gnome.org/show_bug.cgi?id=793399 --- gio/tests/data-input-stream.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/gio/tests/data-input-stream.c b/gio/tests/data-input-stream.c index 58a3b3ac2..ce232b37e 100644 --- a/gio/tests/data-input-stream.c +++ b/gio/tests/data-input-stream.c @@ -333,14 +333,15 @@ enum TestDataType { TEST_DATA_UINT64 }; +/* The order is reversed to avoid -Wduplicated-branches. */ #define TEST_DATA_RETYPE_BUFF(a, t, v) \ - (a == TEST_DATA_BYTE ? (t) *(guchar*)v : \ - (a == TEST_DATA_INT16 ? (t) *(gint16*)v : \ - (a == TEST_DATA_UINT16 ? (t) *(guint16*)v : \ - (a == TEST_DATA_INT32 ? (t) *(gint32*)v : \ - (a == TEST_DATA_UINT32 ? (t) *(guint32*)v : \ - (a == TEST_DATA_INT64 ? (t) *(gint64*)v : \ - (t) *(guint64*)v )))))) + (a == TEST_DATA_UINT64 ? (t) *(guint64*)v : \ + (a == TEST_DATA_INT64 ? (t) *(gint64*)v : \ + (a == TEST_DATA_UINT32 ? (t) *(guint32*)v : \ + (a == TEST_DATA_INT32 ? (t) *(gint32*)v : \ + (a == TEST_DATA_UINT16 ? (t) *(guint16*)v : \ + (a == TEST_DATA_INT16 ? (t) *(gint16*)v : \ + (t) *(guchar*)v )))))) static void -- 2.13.6