aboutsummaryrefslogtreecommitdiff
path: root/pthreads/tests/join1.c
diff options
context:
space:
mode:
Diffstat (limited to 'pthreads/tests/join1.c')
-rw-r--r--pthreads/tests/join1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pthreads/tests/join1.c b/pthreads/tests/join1.c
index 8b11e9503..337af832d 100644
--- a/pthreads/tests/join1.c
+++ b/pthreads/tests/join1.c
@@ -41,7 +41,7 @@
void *
func(void * arg)
{
- int i = (int) arg;
+ int i = (int)(size_t)arg;
Sleep(i * 100);
@@ -56,12 +56,12 @@ main(int argc, char * argv[])
{
pthread_t id[4];
int i;
- int result;
+ void* result = (void*)-1;
/* Create a few threads and then exit. */
for (i = 0; i < 4; i++)
{
- assert(pthread_create(&id[i], NULL, func, (void *) i) == 0);
+ assert(pthread_create(&id[i], NULL, func, (void *)(size_t)i) == 0);
}
/* Some threads will finish before they are joined, some after. */
@@ -69,8 +69,8 @@ main(int argc, char * argv[])
for (i = 0; i < 4; i++)
{
- assert(pthread_join(id[i], (void **) &result) == 0);
- assert(result == i);
+ assert(pthread_join(id[i], &result) == 0);
+ assert((int)(size_t)result == i);
}
/* Success. */