From 0e0a2627aaeb8c387eedcdcfab9bfeb6c9275727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sat, 25 Feb 2023 20:45:28 +0100 Subject: [PATCH] treewide: print `pthread_t` as a pointer On glibc, `pthread_t` is `unsigned long int` while on musl it has a pointer type. To avoid format string warnings, cast it to `void *` and use the `%p` format specifier. --- pipewire-jack/src/pipewire-jack.c | 10 +++++----- spa/plugins/support/loop.c | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pipewire-jack/src/pipewire-jack.c b/pipewire-jack/src/pipewire-jack.c index cf5de8fd3..5c221f72b 100644 --- a/pipewire-jack/src/pipewire-jack.c +++ b/pipewire-jack/src/pipewire-jack.c @@ -6276,9 +6276,9 @@ int jack_client_stop_thread(jack_client_t* client, jack_native_thread_t thread) spa_return_val_if_fail(client != NULL, -EINVAL); - pw_log_debug("join thread %lu", thread); + pw_log_debug("join thread %p", (void *) thread); spa_thread_utils_join(&c->context.thread_utils, (struct spa_thread*)thread, &status); - pw_log_debug("stopped thread %lu", thread); + pw_log_debug("stopped thread %p", (void *) thread); return 0; } @@ -6293,11 +6293,11 @@ int jack_client_kill_thread(jack_client_t* client, jack_native_thread_t thread) spa_return_val_if_fail(client != NULL, -EINVAL); - pw_log_debug("cancel thread %lu", thread); + pw_log_debug("cancel thread %p", (void *) thread); pthread_cancel(thread); - pw_log_debug("join thread %lu", thread); + pw_log_debug("join thread %p", (void *) thread); spa_thread_utils_join(&c->context.thread_utils, (struct spa_thread*)thread, &status); - pw_log_debug("stopped thread %lu", thread); + pw_log_debug("stopped thread %p", (void *) thread); return 0; } diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c index b4cc59768..e06457251 100644 --- a/spa/plugins/support/loop.c +++ b/spa/plugins/support/loop.c @@ -336,7 +336,7 @@ static void loop_enter(void *object) spa_return_if_fail(impl->thread == thread_id); impl->enter_count++; } - spa_log_trace(impl->log, "%p: enter %lu", impl, impl->thread); + spa_log_trace(impl->log, "%p: enter %p", impl, (void *) impl->thread); } static void loop_leave(void *object) @@ -347,7 +347,7 @@ static void loop_leave(void *object) spa_return_if_fail(impl->enter_count > 0); spa_return_if_fail(impl->thread == thread_id); - spa_log_trace(impl->log, "%p: leave %lu", impl, impl->thread); + spa_log_trace(impl->log, "%p: leave %p", impl, (void *) impl->thread); if (--impl->enter_count == 0) { impl->thread = 0;