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.
This commit is contained in:
Barnabás Pőcze 2023-02-25 20:45:28 +01:00
parent d776d378cd
commit 0e0a2627aa
2 changed files with 7 additions and 7 deletions

View file

@ -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;
}

View file

@ -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;