diff --git a/core/lib/include/priority_queue.h b/core/lib/include/priority_queue.h index 3c58b75bb3..a33e545d73 100644 --- a/core/lib/include/priority_queue.h +++ b/core/lib/include/priority_queue.h @@ -32,7 +32,7 @@ extern "C" { typedef struct priority_queue_node { struct priority_queue_node *next; /**< next queue node */ uint32_t priority; /**< queue node priority */ - unsigned int data; /**< queue node data */ + uintptr_t data; /**< queue node data */ } priority_queue_node_t; /** diff --git a/core/lib/priority_queue.c b/core/lib/priority_queue.c index c7f734cc7a..e02db44697 100644 --- a/core/lib/priority_queue.c +++ b/core/lib/priority_queue.c @@ -78,14 +78,14 @@ void priority_queue_print(priority_queue_t *root) printf("queue:\n"); for (priority_queue_node_t *node = root->first; node; node = node->next) { - printf("Data: %u Priority: %lu\n", node->data, - (unsigned long)node->priority); + printf("Data: %" PRIuPTR " Priority: %" PRIu32 "\n", node->data, + node->priority); } } void priority_queue_print_node(priority_queue_node_t *node) { - printf("Data: %u Priority: %lu Next: %u\n", (unsigned int)node->data, - (unsigned long)node->priority, (unsigned int)node->next); + printf("Data: %" PRIuPTR " Priority: %" PRIu32 " Next: %p\n", node->data, + node->priority, (void *)node->next); } #endif diff --git a/core/mbox.c b/core/mbox.c index dce9140cf6..f636804a3c 100644 --- a/core/mbox.c +++ b/core/mbox.c @@ -64,8 +64,8 @@ int _mbox_put(mbox_t *mbox, msg_t *msg, int blocking) list_node_t *next = list_remove_head(&mbox->readers); if (next) { - DEBUG("mbox: Thread %" PRIkernel_pid " mbox 0x%08x: _tryput(): " - "there's a waiter.\n", thread_getpid(), (unsigned)mbox); + DEBUG("mbox: Thread %" PRIkernel_pid " mbox 0x%08" PRIxPTR ": _tryput(): " + "there's a waiter.\n", thread_getpid(), (uintptr_t)mbox); thread_t *thread = container_of((clist_node_t *)next, thread_t, rq_entry); *(msg_t *)thread->wait_data = *msg; @@ -84,8 +84,8 @@ int _mbox_put(mbox_t *mbox, msg_t *msg, int blocking) } } - DEBUG("mbox: Thread %" PRIkernel_pid " mbox 0x%08x: _tryput(): " - "queued message.\n", thread_getpid(), (unsigned)mbox); + DEBUG("mbox: Thread %" PRIkernel_pid " mbox 0x%08" PRIxPTR ": _tryput(): " + "queued message.\n", thread_getpid(), (uintptr_t)mbox); msg->sender_pid = thread_getpid(); /* copy msg into queue */ mbox->msg_array[cib_put_unsafe(&mbox->cib)] = *msg; @@ -99,8 +99,8 @@ int _mbox_get(mbox_t *mbox, msg_t *msg, int blocking) unsigned irqstate = irq_disable(); if (cib_avail(&mbox->cib)) { - DEBUG("mbox: Thread %" PRIkernel_pid " mbox 0x%08x: _tryget(): " - "got queued message.\n", thread_getpid(), (unsigned)mbox); + DEBUG("mbox: Thread %" PRIkernel_pid " mbox 0x%08" PRIxPTR ": _tryget(): " + "got queued message.\n", thread_getpid(), (uintptr_t)mbox); /* copy msg from queue */ *msg = mbox->msg_array[cib_get_unsafe(&mbox->cib)]; list_node_t *next = list_remove_head(&mbox->writers); diff --git a/core/thread_flags.c b/core/thread_flags.c index 1d4db08f10..be3c1bf44f 100644 --- a/core/thread_flags.c +++ b/core/thread_flags.c @@ -29,7 +29,7 @@ static inline int __attribute__((always_inline)) _thread_flags_wake( thread_t *thread) { unsigned wakeup; - thread_flags_t mask = (uint16_t)(unsigned)thread->wait_data; + thread_flags_t mask = (uint16_t)(uintptr_t)thread->wait_data; switch (thread->status) { case STATUS_FLAG_BLOCKED_ANY: @@ -76,7 +76,7 @@ static void _thread_flags_wait(thread_flags_t mask, thread_t *thread, "_thread_flags_wait: me->flags=0x%08x me->mask=0x%08x. going blocked.\n", (unsigned)thread->flags, (unsigned)mask); - thread->wait_data = (void *)(unsigned)mask; + thread->wait_data = (void *)(uintptr_t)mask; sched_set_status(thread, threadstate); irq_restore(irqstate); thread_yield_higher();