From e3fd43861c2beccd643bb141438a12c069cde72c Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 21 Jul 2020 23:03:02 +0200 Subject: [PATCH] pkg/semtech-loramac: allow pointer <-> function pointer cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Building on native reveals error: ISO C forbids initialization between function pointer and ‘void *’ Let's disable that. --- pkg/semtech-loramac/contrib/semtech_loramac.c | 2 +- pkg/semtech-loramac/contrib/semtech_loramac_timer.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/semtech-loramac/contrib/semtech_loramac.c b/pkg/semtech-loramac/contrib/semtech_loramac.c index 97c6e5055c..0cd3a46b4f 100644 --- a/pkg/semtech-loramac/contrib/semtech_loramac.c +++ b/pkg/semtech-loramac/contrib/semtech_loramac.c @@ -609,7 +609,7 @@ void *_semtech_loramac_event_loop(void *arg) case MSG_TYPE_MAC_TIMEOUT: { DEBUG("[semtech-loramac] MAC timer timeout\n"); - void (*callback)(void) = msg.content.ptr; + void (*callback)(void) = (void (*)(void))(uintptr_t)msg.content.value; callback(); break; } diff --git a/pkg/semtech-loramac/contrib/semtech_loramac_timer.c b/pkg/semtech-loramac/contrib/semtech_loramac_timer.c index c77b24d5b4..d1ed507407 100644 --- a/pkg/semtech-loramac/contrib/semtech_loramac_timer.c +++ b/pkg/semtech-loramac/contrib/semtech_loramac_timer.c @@ -44,7 +44,7 @@ void TimerStart(TimerEvent_t *obj) xtimer_t *timer = &(obj->dev); msg_t *msg = &(obj->msg); msg->type = MSG_TYPE_MAC_TIMEOUT; - msg->content.ptr = obj->cb; + msg->content.value = (uintptr_t)obj->cb; xtimer_set_msg(timer, obj->timeout, msg, semtech_loramac_pid); }