From ce5141ace66c29752e86482baa91c5c3e66ad076 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Fri, 15 Jun 2018 00:44:02 +0200 Subject: [PATCH] unittests: Qualifier cast for pktsnip test initializers --- tests/unittests/tests-pkt/tests-pkt.c | 4 ++-- tests/unittests/tests-pktbuf/tests-pktbuf.c | 2 +- tests/unittests/tests-pktqueue/tests-pktqueue.c | 4 ++-- .../tests-priority_pktqueue/tests-priority_pktqueue.c | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/unittests/tests-pkt/tests-pkt.c b/tests/unittests/tests-pkt/tests-pkt.c index 7f0fbfcb1c..0d192993b4 100644 --- a/tests/unittests/tests-pkt/tests-pkt.c +++ b/tests/unittests/tests-pkt/tests-pkt.c @@ -27,10 +27,10 @@ #include "tests-pkt.h" #define _INIT_ELEM(len, _data, _next) \ - { .users = 1, .next = (_next), .data = (_data), \ + { .users = 1, .next = (_next), .data = (void *)(_data), \ .size = (len), .type = GNRC_NETTYPE_UNDEF \ } -#define _INIT_ELEM_STATIC_DATA(data, next) _INIT_ELEM(sizeof(data), data, next) +#define _INIT_ELEM_STATIC_DATA(data, next) _INIT_ELEM(sizeof(data), (void *)(data), (next)) #define _INIT_ELEM_STATIC_TYPE(_type, _next) \ { .users = 1, .next = (_next), .data = NULL, .size = 0, .type = (_type) } diff --git a/tests/unittests/tests-pktbuf/tests-pktbuf.c b/tests/unittests/tests-pktbuf/tests-pktbuf.c index 3994c0f7fe..baa0731325 100644 --- a/tests/unittests/tests-pktbuf/tests-pktbuf.c +++ b/tests/unittests/tests-pktbuf/tests-pktbuf.c @@ -709,7 +709,7 @@ static void test_pktbuf_hold__pkt_null(void) static void test_pktbuf_hold__pkt_external(void) { - gnrc_pktsnip_t pkt = { NULL, TEST_STRING8, sizeof(TEST_STRING8), 1, GNRC_NETTYPE_TEST }; + gnrc_pktsnip_t pkt = { NULL, (void *)TEST_STRING8, sizeof(TEST_STRING8), 1, GNRC_NETTYPE_TEST }; gnrc_pktbuf_hold(&pkt, 1); TEST_ASSERT(gnrc_pktbuf_is_empty()); diff --git a/tests/unittests/tests-pktqueue/tests-pktqueue.c b/tests/unittests/tests-pktqueue/tests-pktqueue.c index 6d10f6ee2c..858d9005d4 100644 --- a/tests/unittests/tests-pktqueue/tests-pktqueue.c +++ b/tests/unittests/tests-pktqueue/tests-pktqueue.c @@ -22,8 +22,8 @@ #include "tests-pktqueue.h" #define PKT_INIT_ELEM(len, data, next) \ - { (next), (data), (len), 1, GNRC_NETTYPE_UNDEF } -#define PKT_INIT_ELEM_STATIC_DATA(data, next) PKT_INIT_ELEM(sizeof(data), data, next) + { (next), (void *)(data), (len), 1, GNRC_NETTYPE_UNDEF } +#define PKT_INIT_ELEM_STATIC_DATA(data, next) PKT_INIT_ELEM(sizeof(data), (void *)(data), (next)) #define PKTQUEUE_INIT_ELEM(pkt) { NULL, pkt } static gnrc_pktqueue_t *root; diff --git a/tests/unittests/tests-priority_pktqueue/tests-priority_pktqueue.c b/tests/unittests/tests-priority_pktqueue/tests-priority_pktqueue.c index 3f90257857..7c544b6499 100644 --- a/tests/unittests/tests-priority_pktqueue/tests-priority_pktqueue.c +++ b/tests/unittests/tests-priority_pktqueue/tests-priority_pktqueue.c @@ -23,8 +23,8 @@ #include "tests-priority_pktqueue.h" #define PKT_INIT_ELEM(len, data, next) \ - { (next), (data), (len), 1, GNRC_NETTYPE_UNDEF } -#define PKT_INIT_ELEM_STATIC_DATA(data, next) PKT_INIT_ELEM(sizeof(data), data, next) + { (next), (void *)(data), (len), 1, GNRC_NETTYPE_UNDEF } +#define PKT_INIT_ELEM_STATIC_DATA(data, next) PKT_INIT_ELEM(sizeof(data), (void *)(data), (next)) #define PKTQUEUE_INIT_ELEM(pkt) { NULL, pkt } static gnrc_priority_pktqueue_t pkt_queue;