From 39f18fb22040ff9fdc330e667e6999f34ba28921 Mon Sep 17 00:00:00 2001 From: Kurt Miller Date: Fri, 6 Oct 2006 13:11:59 +0000 Subject: eliminate warnings on 64bit archs --- regress/lib/libpthread/blocked_close/blocked_close.c | 16 ++++++++-------- regress/lib/libpthread/blocked_dup2/blocked_dup2.c | 16 ++++++++-------- regress/lib/libpthread/close_race/close_race.c | 8 ++++---- regress/lib/libpthread/dup2_race/dup2_race.c | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) (limited to 'regress/lib/libpthread') diff --git a/regress/lib/libpthread/blocked_close/blocked_close.c b/regress/lib/libpthread/blocked_close/blocked_close.c index d439aa5b03a..5ad339ba311 100644 --- a/regress/lib/libpthread/blocked_close/blocked_close.c +++ b/regress/lib/libpthread/blocked_close/blocked_close.c @@ -1,4 +1,4 @@ -/* $OpenBSD: blocked_close.c,v 1.1 2006/09/22 18:29:47 kurt Exp $ */ +/* $OpenBSD: blocked_close.c,v 1.2 2006/10/06 13:11:58 kurt Exp $ */ /* * Copyright (c) 2006 Kurt Miller * @@ -44,7 +44,7 @@ deadlock_detector(void *arg) static void * waiting_read(void *arg) { - int fd = (int)arg; + int fd = *(int *)arg; struct sockaddr remote_addr; char readBuf; int n, remote_addr_len = sizeof(struct sockaddr); @@ -52,20 +52,20 @@ waiting_read(void *arg) n = recvfrom(fd, &readBuf, 1, 0, &remote_addr, &remote_addr_len); if (n == -1) - return ((void *)errno); + return ((caddr_t)NULL + errno); else - return (0); + return (NULL); } static void * busy_thread(void *arg) { - int fd = (int)arg; + int fd = *(int *)arg; /* loop until error */ while(fcntl(fd, F_GETFD, NULL) != -1); - return ((void *)errno); + return ((caddr_t)NULL + errno); } int @@ -95,10 +95,10 @@ main(int argc, char *argv[]) CHECKr(bind(fd, (struct sockaddr *)&addr, sizeof(addr))); for (j = 0; j < BUSY_THREADS; j++) CHECKr(pthread_create(&busy_threads[j], NULL, - busy_thread, (void *)fd)); + busy_thread, (void *)&fd)); for (j = 0; j < WAITING_THREADS; j++) CHECKr(pthread_create(&waiting_threads[j], NULL, - waiting_read, (void *)fd)); + waiting_read, (void *)&fd)); nanosleep(&rqtp, NULL); CHECKr(close(fd)); for (j = 0; j < BUSY_THREADS; j++) { diff --git a/regress/lib/libpthread/blocked_dup2/blocked_dup2.c b/regress/lib/libpthread/blocked_dup2/blocked_dup2.c index 0b4922387bd..a76dc5e83a1 100644 --- a/regress/lib/libpthread/blocked_dup2/blocked_dup2.c +++ b/regress/lib/libpthread/blocked_dup2/blocked_dup2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: blocked_dup2.c,v 1.2 2006/10/03 16:06:52 kurt Exp $ */ +/* $OpenBSD: blocked_dup2.c,v 1.3 2006/10/06 13:11:58 kurt Exp $ */ /* * Copyright (c) 2006 Kurt Miller * @@ -44,7 +44,7 @@ deadlock_detector(void *arg) static void * waiting_read(void *arg) { - int fd = (int)arg; + int fd = *(int *)arg; struct sockaddr remote_addr; char readBuf; int n, remote_addr_len = sizeof(struct sockaddr); @@ -52,20 +52,20 @@ waiting_read(void *arg) n = recvfrom(fd, &readBuf, 1, 0, &remote_addr, &remote_addr_len); if (n == -1) - return ((void *)errno); + return ((caddr_t)NULL + errno); else - return (0); + return (NULL); } static void * busy_thread(void *arg) { - int fd = (int)arg; + int fd = *(int *)arg; /* loop until error */ while(fcntl(fd, F_GETFD, NULL) != -1); - return ((void *)errno); + return ((caddr_t)NULL + errno); } int @@ -99,10 +99,10 @@ main(int argc, char *argv[]) for (i = 0; i < ITERATIONS; i++) { for (j = 0; j < BUSY_THREADS; j++) CHECKr(pthread_create(&busy_threads[j], NULL, - busy_thread, (void *)newfd)); + busy_thread, (void *)&newfd)); for (j = 0; j < WAITING_THREADS; j++) CHECKr(pthread_create(&waiting_threads[j], NULL, - waiting_read, (void *)newfd)); + waiting_read, (void *)&newfd)); nanosleep(&rqtp, NULL); CHECKe(dup2(fd, newfd)); for (j = 0; j < BUSY_THREADS; j++) { diff --git a/regress/lib/libpthread/close_race/close_race.c b/regress/lib/libpthread/close_race/close_race.c index 212fd52400f..05ce8a1519f 100644 --- a/regress/lib/libpthread/close_race/close_race.c +++ b/regress/lib/libpthread/close_race/close_race.c @@ -1,4 +1,4 @@ -/* $OpenBSD: close_race.c,v 1.1 2006/09/22 18:32:16 kurt Exp $ */ +/* $OpenBSD: close_race.c,v 1.2 2006/10/06 13:11:58 kurt Exp $ */ /* * Copyright (c) 2006 Kurt Miller * @@ -40,12 +40,12 @@ deadlock_detector(void *arg) static void * busy_thread(void *arg) { - int fd = (int)arg; + int fd = *(int *)arg; /* loop until error */ while(fcntl(fd, F_GETFD, NULL) != -1); - return ((void *)errno); + return ((caddr_t)NULL + errno); } int @@ -66,7 +66,7 @@ main(int argc, char *argv[]) CHECKe(fd = socket(AF_INET, SOCK_DGRAM, 0)); for (j = 0; j < BUSY_THREADS; j++) CHECKr(pthread_create(&busy_threads[j], NULL, - busy_thread, (void *)fd)); + busy_thread, (void *)&fd)); nanosleep(&rqtp, NULL); CHECKr(close(fd)); for (j = 0; j < 5; j++) { diff --git a/regress/lib/libpthread/dup2_race/dup2_race.c b/regress/lib/libpthread/dup2_race/dup2_race.c index faccc325a4f..41fcb2c8d92 100644 --- a/regress/lib/libpthread/dup2_race/dup2_race.c +++ b/regress/lib/libpthread/dup2_race/dup2_race.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dup2_race.c,v 1.2 2006/10/03 16:06:52 kurt Exp $ */ +/* $OpenBSD: dup2_race.c,v 1.3 2006/10/06 13:11:58 kurt Exp $ */ /* * Copyright (c) 2006 Kurt Miller * @@ -40,12 +40,12 @@ deadlock_detector(void *arg) static void * busy_thread(void *arg) { - int fd = (int)arg; + int fd = *(int *)arg; /* loop until error */ while(fcntl(fd, F_GETFD, NULL) != -1); - return ((void *)errno); + return ((caddr_t)NULL + errno); } int @@ -68,7 +68,7 @@ main(int argc, char *argv[]) CHECKe(newfd = socket(AF_INET, SOCK_DGRAM, 0)); for (j = 0; j < BUSY_THREADS; j++) CHECKr(pthread_create(&busy_threads[j], NULL, - busy_thread, (void *)newfd)); + busy_thread, (void *)&newfd)); nanosleep(&rqtp, NULL); CHECKe(dup2(fd, newfd)); for (j = 0; j < BUSY_THREADS; j++) { -- cgit v1.2.3