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
This commit is contained in:
Ernestas Kulik 2018-02-16 18:19:19 +02:00 committed by Philip Withnall
parent 59d4ee99f2
commit c01c255895

View File

@ -337,14 +337,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