summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-08-23 04:26:06 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2001-08-23 04:26:06 +0000
commit254f7200ee45570299fcd3d272dd82c49fed6ef3 (patch)
treed90832bf8c6361a8d493528d88413c9e56afcb7f /regress
parent2f85919fc122b831358535e79384969cd14e897c (diff)
while im here, remove -Wall warnings.
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libc_r/cancel/cancel.c8
-rw-r--r--regress/lib/libc_r/group/group.c6
-rw-r--r--regress/lib/libc_r/poll/poll.c10
-rw-r--r--regress/lib/libpthread/cancel/cancel.c8
-rw-r--r--regress/lib/libpthread/group/group.c6
-rw-r--r--regress/lib/libpthread/poll/poll.c10
6 files changed, 24 insertions, 24 deletions
diff --git a/regress/lib/libc_r/cancel/cancel.c b/regress/lib/libc_r/cancel/cancel.c
index 2dd0d4c1940..be344ba7731 100644
--- a/regress/lib/libc_r/cancel/cancel.c
+++ b/regress/lib/libc_r/cancel/cancel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cancel.c,v 1.1 2001/08/15 14:37:10 fgsch Exp $ */
+/* $OpenBSD: cancel.c,v 1.2 2001/08/23 04:26:05 fgsch Exp $ */
/* David Leonard <d@openbsd.org>, 1999. Public Domain. */
#include <pthread.h>
@@ -34,9 +34,9 @@ void v() {
}
void
-c1handler(void *fd)
+c1handler(void *arg)
{
- CHECKe(close((int)fd));
+ CHECKe(close(*(int *)arg));
v();
}
@@ -52,7 +52,7 @@ child1fn(arg)
CHECKr(pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL));
/* something that will block */
CHECKe(fd = open("/dev/tty", O_RDONLY));
- pthread_cleanup_push(c1handler, (void *)fd);
+ pthread_cleanup_push(c1handler, (void *)&fd);
v();
while (1) {
CHECKe(len = read(fd, &buf, sizeof buf));
diff --git a/regress/lib/libc_r/group/group.c b/regress/lib/libc_r/group/group.c
index cc81df6cf01..8c78c50d84a 100644
--- a/regress/lib/libc_r/group/group.c
+++ b/regress/lib/libc_r/group/group.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: group.c,v 1.1 2001/08/15 14:37:11 fgsch Exp $ */
+/* $OpenBSD: group.c,v 1.2 2001/08/23 04:26:05 fgsch Exp $ */
/* David Leonard <d@openbsd.org>, 2001. Public Domain. */
/*
@@ -25,7 +25,7 @@ pthread_mutex_t display2;
void*
test(void* arg)
{
- gid_t gid = (int)arg;
+ gid_t gid = *(gid_t *)arg;
gid_t ogid;
struct group grpbuf;
struct group *grp;
@@ -152,7 +152,7 @@ main()
/* Get separate threads to do a group open separately */
for (gid = 0; gid < NGRPS; gid++) {
- CHECKr(pthread_create(&thread[gid], NULL, test, (void *)gid));
+ CHECKr(pthread_create(&thread[gid], NULL, test, (void *)&gid));
}
/* Allow all threads to run their first part */
diff --git a/regress/lib/libc_r/poll/poll.c b/regress/lib/libc_r/poll/poll.c
index 360f8f800cb..fc0d9422cce 100644
--- a/regress/lib/libc_r/poll/poll.c
+++ b/regress/lib/libc_r/poll/poll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: poll.c,v 1.1 2001/08/15 14:37:12 fgsch Exp $ */
+/* $OpenBSD: poll.c,v 1.2 2001/08/23 04:26:05 fgsch Exp $ */
/* David Leonard <d@openbsd.org>, 2001. Public Domain. */
#include <pthread.h>
@@ -33,7 +33,7 @@ static void *
writer(arg)
void *arg;
{
- int fd = (int)arg;
+ int fd = *(int *)arg;
const char msg[1] = { '!' };
ASSERTe(write(fd, &msg, sizeof msg), == sizeof msg);
@@ -44,7 +44,7 @@ static void *
reader(arg)
void *arg;
{
- int fd = (int)arg;
+ int fd = *(int *)arg;
char buf[1];
ASSERTe(read(fd, &buf, sizeof buf), == sizeof buf);
@@ -122,14 +122,14 @@ main(argc, argv)
/* Start a writing thread to the write end [1] */
printf("bg writing to wpipe\n");
- CHECKr(pthread_create(&t, NULL, writer, (void *)tube[1]));
+ CHECKr(pthread_create(&t, NULL, writer, (void *)&tube[1]));
/* The read end [0] should soon be ready for read (POLLIN) */
p[0].fd = tube[0];
p[0].events = POLLIN;
ASSERTe(poll(p, 1, INFTIM), == 1);
printf("rpipe p[0]="); print_pollfd(&p[0]); putchar('\n');
ASSERT(p[0].revents == POLLIN);
- reader((void *)tube[0]); /* consume */
+ reader((void *)&tube[0]); /* consume */
CHECKr(pthread_join(t, &result));
SUCCEED;
diff --git a/regress/lib/libpthread/cancel/cancel.c b/regress/lib/libpthread/cancel/cancel.c
index 2dd0d4c1940..be344ba7731 100644
--- a/regress/lib/libpthread/cancel/cancel.c
+++ b/regress/lib/libpthread/cancel/cancel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cancel.c,v 1.1 2001/08/15 14:37:10 fgsch Exp $ */
+/* $OpenBSD: cancel.c,v 1.2 2001/08/23 04:26:05 fgsch Exp $ */
/* David Leonard <d@openbsd.org>, 1999. Public Domain. */
#include <pthread.h>
@@ -34,9 +34,9 @@ void v() {
}
void
-c1handler(void *fd)
+c1handler(void *arg)
{
- CHECKe(close((int)fd));
+ CHECKe(close(*(int *)arg));
v();
}
@@ -52,7 +52,7 @@ child1fn(arg)
CHECKr(pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL));
/* something that will block */
CHECKe(fd = open("/dev/tty", O_RDONLY));
- pthread_cleanup_push(c1handler, (void *)fd);
+ pthread_cleanup_push(c1handler, (void *)&fd);
v();
while (1) {
CHECKe(len = read(fd, &buf, sizeof buf));
diff --git a/regress/lib/libpthread/group/group.c b/regress/lib/libpthread/group/group.c
index cc81df6cf01..8c78c50d84a 100644
--- a/regress/lib/libpthread/group/group.c
+++ b/regress/lib/libpthread/group/group.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: group.c,v 1.1 2001/08/15 14:37:11 fgsch Exp $ */
+/* $OpenBSD: group.c,v 1.2 2001/08/23 04:26:05 fgsch Exp $ */
/* David Leonard <d@openbsd.org>, 2001. Public Domain. */
/*
@@ -25,7 +25,7 @@ pthread_mutex_t display2;
void*
test(void* arg)
{
- gid_t gid = (int)arg;
+ gid_t gid = *(gid_t *)arg;
gid_t ogid;
struct group grpbuf;
struct group *grp;
@@ -152,7 +152,7 @@ main()
/* Get separate threads to do a group open separately */
for (gid = 0; gid < NGRPS; gid++) {
- CHECKr(pthread_create(&thread[gid], NULL, test, (void *)gid));
+ CHECKr(pthread_create(&thread[gid], NULL, test, (void *)&gid));
}
/* Allow all threads to run their first part */
diff --git a/regress/lib/libpthread/poll/poll.c b/regress/lib/libpthread/poll/poll.c
index 360f8f800cb..fc0d9422cce 100644
--- a/regress/lib/libpthread/poll/poll.c
+++ b/regress/lib/libpthread/poll/poll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: poll.c,v 1.1 2001/08/15 14:37:12 fgsch Exp $ */
+/* $OpenBSD: poll.c,v 1.2 2001/08/23 04:26:05 fgsch Exp $ */
/* David Leonard <d@openbsd.org>, 2001. Public Domain. */
#include <pthread.h>
@@ -33,7 +33,7 @@ static void *
writer(arg)
void *arg;
{
- int fd = (int)arg;
+ int fd = *(int *)arg;
const char msg[1] = { '!' };
ASSERTe(write(fd, &msg, sizeof msg), == sizeof msg);
@@ -44,7 +44,7 @@ static void *
reader(arg)
void *arg;
{
- int fd = (int)arg;
+ int fd = *(int *)arg;
char buf[1];
ASSERTe(read(fd, &buf, sizeof buf), == sizeof buf);
@@ -122,14 +122,14 @@ main(argc, argv)
/* Start a writing thread to the write end [1] */
printf("bg writing to wpipe\n");
- CHECKr(pthread_create(&t, NULL, writer, (void *)tube[1]));
+ CHECKr(pthread_create(&t, NULL, writer, (void *)&tube[1]));
/* The read end [0] should soon be ready for read (POLLIN) */
p[0].fd = tube[0];
p[0].events = POLLIN;
ASSERTe(poll(p, 1, INFTIM), == 1);
printf("rpipe p[0]="); print_pollfd(&p[0]); putchar('\n');
ASSERT(p[0].revents == POLLIN);
- reader((void *)tube[0]); /* consume */
+ reader((void *)&tube[0]); /* consume */
CHECKr(pthread_join(t, &result));
SUCCEED;