From 25569ea7316a1e368cc2dc4f53090ba1a8926fe6 Mon Sep 17 00:00:00 2001 From: marcel Date: Wed, 4 Jun 2003 20:38:54 +0000 Subject: Make this compile without warnings on 64-bit architectures: Don't cast thread_self() to int. Cast to uintptr_t. Pull in the predefined printf format from --- lib/libc_r/test/mutex_d.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/libc_r') diff --git a/lib/libc_r/test/mutex_d.c b/lib/libc_r/test/mutex_d.c index 45d28a5..2f0c868 100644 --- a/lib/libc_r/test/mutex_d.c +++ b/lib/libc_r/test/mutex_d.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "pthread.h" #include #include @@ -465,8 +466,8 @@ waiter (void *arg) pthread_mutex_unlock (&waiter_mutex); } - log_trace ("Thread %d: Exiting thread 0x%x\n", (int) statep->id, - (int) pthread_self()); + log_trace ("Thread %d: Exiting thread 0x%" PRIxPTR "\n", + (int) statep->id, (uintptr_t) pthread_self()); pthread_exit (arg); return (NULL); } @@ -512,8 +513,8 @@ lock_twice (void *arg) if (statep->ret == 0) pthread_mutex_unlock (statep->cmd.mutex); - log_trace ("Thread %d: Exiting thread 0x%x\n", (int) statep->id, - (int) pthread_self()); + log_trace ("Thread %d: Exiting thread 0x%" PRIxPTR "\n", + (int) statep->id, (uintptr_t) pthread_self()); pthread_exit (arg); return (NULL); } @@ -522,8 +523,8 @@ lock_twice (void *arg) static void sighandler (int signo) { - log ("Signal handler caught signal %d, thread id 0x%x\n", - signo, (int) pthread_self()); + log ("Signal handler caught signal %d, thread id 0x%" PRIxPTR "\n", + signo, (uintptr_t) pthread_self()); if (signo == SIGINT) done = 1; -- cgit v1.1