diff options
author | marcel <marcel@FreeBSD.org> | 2003-06-04 20:38:54 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-06-04 20:38:54 +0000 |
commit | 25569ea7316a1e368cc2dc4f53090ba1a8926fe6 (patch) | |
tree | 7ac0b28a6d1dd5d48c23d6c6eb7f2d83b6e35776 /lib/libc_r | |
parent | ca51ecc2f17ca1745d1ee9c89490dd9078d181f1 (diff) | |
download | FreeBSD-src-25569ea7316a1e368cc2dc4f53090ba1a8926fe6.zip FreeBSD-src-25569ea7316a1e368cc2dc4f53090ba1a8926fe6.tar.gz |
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 <inttypes.h>
Diffstat (limited to 'lib/libc_r')
-rw-r--r-- | lib/libc_r/test/mutex_d.c | 13 |
1 files changed, 7 insertions, 6 deletions
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 <sys/ioctl.h> #include <assert.h> #include <errno.h> +#include <inttypes.h> #include "pthread.h" #include <sched.h> #include <signal.h> @@ -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; |