From e1de8e3c33257b4e7d6b98767a67414efc31b6c7 Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 4 Mar 2011 08:03:46 +0000 Subject: Casting fixups --- tests/barrier3.c | 4 ++-- tests/barrier5.c | 4 ++-- tests/cancel2.c | 4 ++-- tests/cancel3.c | 4 ++-- tests/cancel4.c | 4 ++-- tests/cancel5.c | 4 ++-- tests/cancel6a.c | 4 ++-- tests/cancel6d.c | 4 ++-- tests/cleanup0.c | 4 ++-- tests/cleanup1.c | 4 ++-- tests/cleanup2.c | 4 ++-- tests/cleanup3.c | 4 ++-- tests/condvar1_2.c | 2 +- tests/condvar2.c | 2 +- tests/condvar2_1.c | 4 ++-- tests/condvar3.c | 2 +- tests/condvar3_1.c | 4 ++-- tests/condvar3_2.c | 6 +++--- tests/condvar3_3.c | 4 ++-- tests/condvar4.c | 4 ++-- tests/condvar5.c | 4 ++-- tests/condvar6.c | 2 +- tests/condvar8.c | 2 +- tests/condvar9.c | 2 +- tests/delay2.c | 2 +- tests/exception1.c | 10 +++++----- tests/inherit1.c | 2 +- tests/join0.c | 2 +- tests/join1.c | 2 +- tests/join2.c | 2 +- tests/join3.c | 2 +- tests/mutex6e.c | 2 +- tests/mutex6es.c | 2 +- tests/mutex6r.c | 2 +- tests/mutex6rs.c | 2 +- tests/mutex7e.c | 2 +- tests/mutex7r.c | 2 +- tests/mutex8.c | 2 +- tests/mutex8e.c | 2 +- tests/mutex8n.c | 2 +- tests/mutex8r.c | 2 +- tests/priority1.c | 2 +- tests/priority2.c | 2 +- tests/rwlock2_t.c | 2 +- tests/rwlock3_t.c | 2 +- tests/rwlock4_t.c | 2 +- tests/rwlock5_t.c | 2 +- tests/rwlock6.c | 6 +++--- tests/rwlock6_t.c | 14 +++++++------- tests/rwlock6_t2.c | 12 ++++++------ tests/semaphore1.c | 2 +- tests/semaphore4.c | 2 +- tests/spin4.c | 4 ++-- tests/tsd1.c | 2 +- tests/tsd2.c | 2 +- 55 files changed, 92 insertions(+), 92 deletions(-) (limited to 'tests') diff --git a/tests/barrier3.c b/tests/barrier3.c index 3e40090..66fe895 100644 --- a/tests/barrier3.c +++ b/tests/barrier3.c @@ -45,7 +45,7 @@ static int result = 1; void * func(void * arg) { - return (void *) pthread_barrier_wait(&barrier); + return (void *) (size_t)pthread_barrier_wait(&barrier); } int @@ -60,7 +60,7 @@ main() assert(pthread_create(&t, NULL, func, NULL) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result == PTHREAD_BARRIER_SERIAL_THREAD); diff --git a/tests/barrier5.c b/tests/barrier5.c index 851398c..4510be0 100644 --- a/tests/barrier5.c +++ b/tests/barrier5.c @@ -72,7 +72,7 @@ func(void * crossings) } } - return (void *) serialThreads; + return (void *) (size_t)serialThreads; } int @@ -103,7 +103,7 @@ main() serialThreadsTotal = 0; for (i = 1; i <= j; i++) { - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); serialThreadsTotal += result; } diff --git a/tests/cancel2.c b/tests/cancel2.c index 6ef2043..d738a21 100644 --- a/tests/cancel2.c +++ b/tests/cancel2.c @@ -157,7 +157,7 @@ mythread(void * arg) */ result += 1000; - return (void *) result; + return (void *) (size_t)result; } int @@ -219,7 +219,7 @@ main() int fail = 0; int result = 0; - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); fail = (result != (int) PTHREAD_CANCELED); if (fail) { diff --git a/tests/cancel3.c b/tests/cancel3.c index 1560ccf..050b4ee 100644 --- a/tests/cancel3.c +++ b/tests/cancel3.c @@ -116,7 +116,7 @@ mythread (void *arg) for (bag->count = 0; bag->count < 100; bag->count++) Sleep (100); - return (void *) result; + return (void *) (size_t)result; } int @@ -180,7 +180,7 @@ main () * a return value of PTHREAD_CANCELED confirms that async * cancelation succeeded. */ - assert (pthread_join (t[i], (void **) &result) == 0); + assert (pthread_join (t[i], (void *) &result) == 0); fail = (result != (int) PTHREAD_CANCELED); diff --git a/tests/cancel4.c b/tests/cancel4.c index 6d6d3dc..ea792af 100644 --- a/tests/cancel4.c +++ b/tests/cancel4.c @@ -118,7 +118,7 @@ mythread(void * arg) for (bag->count = 0; bag->count < 20; bag->count++) Sleep(100); - return (void *) result; + return (void *) (size_t)result; } int @@ -180,7 +180,7 @@ main() * a return value of PTHREAD_CANCELED indicates that async * cancelation occurred. */ - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); fail = (result == (int) PTHREAD_CANCELED); diff --git a/tests/cancel5.c b/tests/cancel5.c index dd6cb8b..81b5ea0 100644 --- a/tests/cancel5.c +++ b/tests/cancel5.c @@ -116,7 +116,7 @@ mythread (void *arg) for (bag->count = 0; bag->count < 100; bag->count++) Sleep (100); - return (void *) result; + return (void *) (size_t)result; } int @@ -178,7 +178,7 @@ main () * a return value of PTHREAD_CANCELED confirms that async * cancelation succeeded. */ - assert (pthread_join (t[i], (void **) &result) == 0); + assert (pthread_join (t[i], (void *) &result) == 0); fail = (result != (int) PTHREAD_CANCELED); diff --git a/tests/cancel6a.c b/tests/cancel6a.c index 644cd4a..8deb435 100644 --- a/tests/cancel6a.c +++ b/tests/cancel6a.c @@ -105,7 +105,7 @@ mythread(void * arg) for (bag->count = 0; bag->count < 100; bag->count++) Sleep(100); - return (void *) result; + return (void *) (size_t)result; } int @@ -168,7 +168,7 @@ main() * a return value of PTHREAD_CANCELED confirms that async * cancelation succeeded. */ - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); fail = (result != (int) PTHREAD_CANCELED); diff --git a/tests/cancel6d.c b/tests/cancel6d.c index d0ad7ac..bf770d2 100644 --- a/tests/cancel6d.c +++ b/tests/cancel6d.c @@ -109,7 +109,7 @@ mythread(void * arg) pthread_testcancel(); } - return (void *) result; + return (void *) (size_t)result; } int @@ -167,7 +167,7 @@ main() int fail = 0; int result = 0; - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); fail = (result != (int) PTHREAD_CANCELED); diff --git a/tests/cleanup0.c b/tests/cleanup0.c index 77626eb..18092d0 100644 --- a/tests/cleanup0.c +++ b/tests/cleanup0.c @@ -137,7 +137,7 @@ mythread(void * arg) #pragma inline_depth() #endif - return (void *) result; + return (void *) (size_t)result; } int @@ -191,7 +191,7 @@ main() int fail = 0; int result = 0; - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); fail = (result == (int) PTHREAD_CANCELED); diff --git a/tests/cleanup1.c b/tests/cleanup1.c index 385aed9..b35013b 100644 --- a/tests/cleanup1.c +++ b/tests/cleanup1.c @@ -146,7 +146,7 @@ mythread(void * arg) #pragma inline_depth() #endif - return (void *) result; + return (void *) (size_t)result; } int @@ -205,7 +205,7 @@ main() int fail = 0; int result = 0; - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); fail = (result != (int) PTHREAD_CANCELED); diff --git a/tests/cleanup2.c b/tests/cleanup2.c index 4c63918..e530f74 100644 --- a/tests/cleanup2.c +++ b/tests/cleanup2.c @@ -131,7 +131,7 @@ mythread(void * arg) #pragma inline_depth() #endif - return (void *) result; + return (void *) (size_t)result; } int @@ -180,7 +180,7 @@ main() int fail = 0; int result = 0; - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); fail = (result != 0); diff --git a/tests/cleanup3.c b/tests/cleanup3.c index b595ab4..4187396 100644 --- a/tests/cleanup3.c +++ b/tests/cleanup3.c @@ -136,7 +136,7 @@ mythread(void * arg) #pragma inline_depth() #endif - return (void *) result; + return (void *) (size_t)result; } int @@ -185,7 +185,7 @@ main() int fail = 0; int result = 0; - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); fail = (result != 0); diff --git a/tests/condvar1_2.c b/tests/condvar1_2.c index 503e821..ff71fc6 100644 --- a/tests/condvar1_2.c +++ b/tests/condvar1_2.c @@ -116,7 +116,7 @@ main() } while (j > 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert (result == 0); } diff --git a/tests/condvar2.c b/tests/condvar2.c index 793bb36..9bd0aba 100644 --- a/tests/condvar2.c +++ b/tests/condvar2.c @@ -99,7 +99,7 @@ main() /* get current system time */ PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/condvar2_1.c b/tests/condvar2_1.c index bf08f44..1dd106f 100644 --- a/tests/condvar2_1.c +++ b/tests/condvar2_1.c @@ -116,7 +116,7 @@ main() /* get current system time */ PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 5; @@ -132,7 +132,7 @@ main() for (i = 1; i <= NUMTHREADS; i++) { - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); assert(result == i); } diff --git a/tests/condvar3.c b/tests/condvar3.c index 8e7e6eb..47077b3 100644 --- a/tests/condvar3.c +++ b/tests/condvar3.c @@ -126,7 +126,7 @@ main() /* get current system time */ PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; assert(pthread_create(&t[1], NULL, mythread, (void *) 1) == 0); diff --git a/tests/condvar3_1.c b/tests/condvar3_1.c index 87671a4..3221969 100644 --- a/tests/condvar3_1.c +++ b/tests/condvar3_1.c @@ -139,7 +139,7 @@ main() /* get current system time */ PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 5; @@ -168,7 +168,7 @@ main() for (i = 1; i <= NUMTHREADS; i++) { - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); assert(result == i); } diff --git a/tests/condvar3_2.c b/tests/condvar3_2.c index 33d800c..0abe38a 100644 --- a/tests/condvar3_2.c +++ b/tests/condvar3_2.c @@ -100,7 +100,7 @@ mythread(void * arg) abstime2.tv_sec = abstime.tv_sec; - if ((int) arg % 3 == 0) + if ((int) (size_t)arg % 3 == 0) { abstime2.tv_sec += 2; } @@ -138,7 +138,7 @@ main() /* get current system time */ PTW32_FTIME(&currSysTime); - abstime.tv_sec = abstime2.tv_sec = currSysTime.time + 5; + abstime.tv_sec = abstime2.tv_sec = (long)currSysTime.time + 5; abstime.tv_nsec = abstime2.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; assert(pthread_mutex_lock(&mutex) == 0); @@ -152,7 +152,7 @@ main() for (i = 1; i <= NUMTHREADS; i++) { - assert(pthread_join(t[i], (void **) &result) == 0); + assert(pthread_join(t[i], (void *) &result) == 0); assert(result == i); /* * Approximately 2/3rds of the threads are expected to time out. diff --git a/tests/condvar3_3.c b/tests/condvar3_3.c index 2a4495f..af95046 100644 --- a/tests/condvar3_3.c +++ b/tests/condvar3_3.c @@ -96,7 +96,7 @@ int main() /* get current system time */ PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; @@ -120,7 +120,7 @@ int main() assert(pthread_mutex_lock(&mtx) == 0); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/condvar4.c b/tests/condvar4.c index c27aafb..42a8168 100644 --- a/tests/condvar4.c +++ b/tests/condvar4.c @@ -130,7 +130,7 @@ main() /* get current system time */ PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 5; @@ -143,7 +143,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 5; diff --git a/tests/condvar5.c b/tests/condvar5.c index 7e6ab38..c1cd3e5 100644 --- a/tests/condvar5.c +++ b/tests/condvar5.c @@ -129,7 +129,7 @@ main() /* get current system time */ PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 5; @@ -142,7 +142,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 5; diff --git a/tests/condvar6.c b/tests/condvar6.c index 70da6a7..e7be0da 100644 --- a/tests/condvar6.c +++ b/tests/condvar6.c @@ -159,7 +159,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 5; diff --git a/tests/condvar8.c b/tests/condvar8.c index 53bfc52..564a3ea 100644 --- a/tests/condvar8.c +++ b/tests/condvar8.c @@ -166,7 +166,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 10; diff --git a/tests/condvar9.c b/tests/condvar9.c index 5443e8b..8adffb6 100644 --- a/tests/condvar9.c +++ b/tests/condvar9.c @@ -174,7 +174,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 5; diff --git a/tests/delay2.c b/tests/delay2.c index 8ecaf0b..8e8e375 100644 --- a/tests/delay2.c +++ b/tests/delay2.c @@ -74,7 +74,7 @@ main(int argc, char * argv[]) assert(pthread_mutex_unlock(&mx) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result == (int) PTHREAD_CANCELED); return 0; diff --git a/tests/exception1.c b/tests/exception1.c index 3f9f595..4340078 100644 --- a/tests/exception1.c +++ b/tests/exception1.c @@ -98,7 +98,7 @@ exceptionedThread(void * arg) #if defined(_MSC_VER) && !defined(__cplusplus) __try { - int zero = (int) arg; /* Passed in from arg to avoid compiler error */ + int zero = (int) (size_t)arg; /* Passed in from arg to avoid compiler error */ int one = 1; /* * The deliberate exception condition (zero divide) is @@ -133,7 +133,7 @@ exceptionedThread(void * arg) } #endif - return (void *) result; + return (void *) (size_t)result; } void * @@ -184,7 +184,7 @@ canceledThread(void * arg) } #endif - return (void *) result; + return (void *) (size_t)result; } int @@ -229,13 +229,13 @@ main() int result = 0; /* Canceled thread */ - assert(pthread_join(ct[i], (void **) &result) == 0); + assert(pthread_join(ct[i], (void *) &result) == 0); assert(!(fail = (result != (int) PTHREAD_CANCELED))); failed = (failed || fail); /* Exceptioned thread */ - assert(pthread_join(et[i], (void **) &result) == 0); + assert(pthread_join(et[i], (void *) &result) == 0); assert(!(fail = (result != ((int) PTHREAD_CANCELED + 2)))); failed = (failed || fail); diff --git a/tests/inherit1.c b/tests/inherit1.c index 482a5a8..1933bb1 100644 --- a/tests/inherit1.c +++ b/tests/inherit1.c @@ -89,7 +89,7 @@ void * func(void * arg) struct sched_param param; assert(pthread_getschedparam(pthread_self(), &policy, ¶m) == 0); - return (void *) param.sched_priority; + return (void *) (size_t)param.sched_priority; } diff --git a/tests/join0.c b/tests/join0.c index a6cb25d..c8367d3 100644 --- a/tests/join0.c +++ b/tests/join0.c @@ -58,7 +58,7 @@ main(int argc, char * argv[]) /* Create a single thread and wait for it to exit. */ assert(pthread_create(&id, NULL, func, (void *) 123) == 0); - assert(pthread_join(id, (void **) &result) == 0); + assert(pthread_join(id, (void *) &result) == 0); assert(result == 123); diff --git a/tests/join1.c b/tests/join1.c index 8b11e95..cf92a05 100644 --- a/tests/join1.c +++ b/tests/join1.c @@ -69,7 +69,7 @@ main(int argc, char * argv[]) for (i = 0; i < 4; i++) { - assert(pthread_join(id[i], (void **) &result) == 0); + assert(pthread_join(id[i], (void *) &result) == 0); assert(result == i); } diff --git a/tests/join2.c b/tests/join2.c index 4fa3012..5d829d1 100644 --- a/tests/join2.c +++ b/tests/join2.c @@ -60,7 +60,7 @@ main(int argc, char * argv[]) for (i = 0; i < 4; i++) { - assert(pthread_join(id[i], (void **) &result) == 0); + assert(pthread_join(id[i], (void *) &result) == 0); assert(result == i); } diff --git a/tests/join3.c b/tests/join3.c index 70cf3e9..62cc908 100644 --- a/tests/join3.c +++ b/tests/join3.c @@ -66,7 +66,7 @@ main(int argc, char * argv[]) for (i = 0; i < 4; i++) { - assert(pthread_join(id[i], (void **) &result) == 0); + assert(pthread_join(id[i], (void *) &result) == 0); assert(result == i); } diff --git a/tests/mutex6e.c b/tests/mutex6e.c index 8af9274..c17c920 100644 --- a/tests/mutex6e.c +++ b/tests/mutex6e.c @@ -86,7 +86,7 @@ main() assert(pthread_create(&t, NULL, locker, NULL) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result == 555); assert(lockCount == 2); diff --git a/tests/mutex6es.c b/tests/mutex6es.c index 0d879c4..c8e6d2a 100644 --- a/tests/mutex6es.c +++ b/tests/mutex6es.c @@ -79,7 +79,7 @@ main() assert(pthread_create(&t, NULL, locker, NULL) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result == 555); assert(lockCount == 2); diff --git a/tests/mutex6r.c b/tests/mutex6r.c index 4bf853f..cc1a780 100644 --- a/tests/mutex6r.c +++ b/tests/mutex6r.c @@ -85,7 +85,7 @@ main() assert(pthread_create(&t, NULL, locker, NULL) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result == 555); assert(lockCount == 2); diff --git a/tests/mutex6rs.c b/tests/mutex6rs.c index 4ebe44e..0f03d6a 100644 --- a/tests/mutex6rs.c +++ b/tests/mutex6rs.c @@ -78,7 +78,7 @@ main() assert(pthread_create(&t, NULL, locker, NULL) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result == 555); assert(lockCount == 2); diff --git a/tests/mutex7e.c b/tests/mutex7e.c index 854789b..d715150 100644 --- a/tests/mutex7e.c +++ b/tests/mutex7e.c @@ -86,7 +86,7 @@ main() assert(pthread_create(&t, NULL, locker, NULL) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result == 555); assert(lockCount == 2); diff --git a/tests/mutex7r.c b/tests/mutex7r.c index f9e5ff0..7a1c206 100644 --- a/tests/mutex7r.c +++ b/tests/mutex7r.c @@ -85,7 +85,7 @@ main() assert(pthread_create(&t, NULL, locker, NULL) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result == 555); assert(lockCount == 2); diff --git a/tests/mutex8.c b/tests/mutex8.c index 827fae0..f019006 100644 --- a/tests/mutex8.c +++ b/tests/mutex8.c @@ -49,7 +49,7 @@ void * locker(void * arg) PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/mutex8e.c b/tests/mutex8e.c index e358630..4720bc6 100644 --- a/tests/mutex8e.c +++ b/tests/mutex8e.c @@ -57,7 +57,7 @@ void * locker(void * arg) PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/mutex8n.c b/tests/mutex8n.c index 1a96f2e..193107e 100644 --- a/tests/mutex8n.c +++ b/tests/mutex8n.c @@ -57,7 +57,7 @@ void * locker(void * arg) PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/mutex8r.c b/tests/mutex8r.c index 1a76097..e48df5b 100644 --- a/tests/mutex8r.c +++ b/tests/mutex8r.c @@ -57,7 +57,7 @@ void * locker(void * arg) PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/priority1.c b/tests/priority1.c index c270e99..66c5a4c 100644 --- a/tests/priority1.c +++ b/tests/priority1.c @@ -91,7 +91,7 @@ func(void * arg) assert(pthread_getschedparam(threadID, &policy, ¶m) == 0); assert(policy == SCHED_OTHER); - return (void *) (param.sched_priority); + return (void *) (size_t)(param.sched_priority); } void * diff --git a/tests/priority2.c b/tests/priority2.c index a5575ab..b435203 100644 --- a/tests/priority2.c +++ b/tests/priority2.c @@ -95,7 +95,7 @@ void * func(void * arg) assert(policy == SCHED_OTHER); result = pthread_barrier_wait(&endBarrier); assert(result == 0 || result == PTHREAD_BARRIER_SERIAL_THREAD); - return (void *) param.sched_priority; + return (void *) (size_t)param.sched_priority; } diff --git a/tests/rwlock2_t.c b/tests/rwlock2_t.c index a34d351..f49879e 100644 --- a/tests/rwlock2_t.c +++ b/tests/rwlock2_t.c @@ -55,7 +55,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/rwlock3_t.c b/tests/rwlock3_t.c index 71aa02a..f77fccb 100644 --- a/tests/rwlock3_t.c +++ b/tests/rwlock3_t.c @@ -68,7 +68,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/rwlock4_t.c b/tests/rwlock4_t.c index 3eec003..5df5c05 100644 --- a/tests/rwlock4_t.c +++ b/tests/rwlock4_t.c @@ -68,7 +68,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/rwlock5_t.c b/tests/rwlock5_t.c index a3a9497..4e6d644 100644 --- a/tests/rwlock5_t.c +++ b/tests/rwlock5_t.c @@ -70,7 +70,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; diff --git a/tests/rwlock6.c b/tests/rwlock6.c index 22d10db..9679d46 100644 --- a/tests/rwlock6.c +++ b/tests/rwlock6.c @@ -89,9 +89,9 @@ main() Sleep(500); assert(pthread_create(&wrt2, NULL, wrfunc, NULL) == 0); - assert(pthread_join(wrt1, (void **) &wr1Result) == 0); - assert(pthread_join(rdt, (void **) &rdResult) == 0); - assert(pthread_join(wrt2, (void **) &wr2Result) == 0); + assert(pthread_join(wrt1, (void *) &wr1Result) == 0); + assert(pthread_join(rdt, (void *) &rdResult) == 0); + assert(pthread_join(wrt2, (void *) &wr2Result) == 0); assert(wr1Result == 10); assert(rdResult == 10); diff --git a/tests/rwlock6_t.c b/tests/rwlock6_t.c index 37a332a..f8a05f1 100644 --- a/tests/rwlock6_t.c +++ b/tests/rwlock6_t.c @@ -67,17 +67,17 @@ void * rdfunc(void * arg) PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; - if ((int) arg == 1) + if ((int) (size_t)arg == 1) { abstime.tv_sec += 1; assert(pthread_rwlock_timedrdlock(&rwlock1, &abstime) == ETIMEDOUT); ba = 0; } - else if ((int) arg == 2) + else if ((int) (size_t)arg == 2) { abstime.tv_sec += 3; assert(pthread_rwlock_timedrdlock(&rwlock1, &abstime) == 0); @@ -110,10 +110,10 @@ main() Sleep(500); assert(pthread_create(&rdt2, NULL, rdfunc, (void *) 2) == 0); - assert(pthread_join(wrt1, (void **) &wr1Result) == 0); - assert(pthread_join(rdt1, (void **) &rd1Result) == 0); - assert(pthread_join(wrt2, (void **) &wr2Result) == 0); - assert(pthread_join(rdt2, (void **) &rd2Result) == 0); + assert(pthread_join(wrt1, (void *) &wr1Result) == 0); + assert(pthread_join(rdt1, (void *) &rd1Result) == 0); + assert(pthread_join(wrt2, (void *) &wr2Result) == 0); + assert(pthread_join(rdt2, (void *) &rd2Result) == 0); assert(wr1Result == 10); assert(rd1Result == 0); diff --git a/tests/rwlock6_t2.c b/tests/rwlock6_t2.c index 1bce439..0c7191f 100644 --- a/tests/rwlock6_t2.c +++ b/tests/rwlock6_t2.c @@ -54,7 +54,7 @@ void * wrfunc(void * arg) int result; result = pthread_rwlock_timedwrlock(&rwlock1, &abstime); - if ((int) arg == 1) + if ((int) (size_t)arg == 1) { assert(result == 0); Sleep(2000); @@ -62,7 +62,7 @@ void * wrfunc(void * arg) assert(pthread_rwlock_unlock(&rwlock1) == 0); return ((void *) bankAccount); } - else if ((int) arg == 2) + else if ((int) (size_t)arg == 2) { assert(result == ETIMEDOUT); return ((void *) 100); @@ -94,7 +94,7 @@ main() PTW32_FTIME(&currSysTime); - abstime.tv_sec = currSysTime.time; + abstime.tv_sec = (long)currSysTime.time; abstime.tv_nsec = NANOSEC_PER_MILLISEC * currSysTime.millitm; abstime.tv_sec += 1; @@ -107,9 +107,9 @@ main() Sleep(100); assert(pthread_create(&wrt2, NULL, wrfunc, (void *) 2) == 0); - assert(pthread_join(wrt1, (void **) &wr1Result) == 0); - assert(pthread_join(rdt, (void **) &rdResult) == 0); - assert(pthread_join(wrt2, (void **) &wr2Result) == 0); + assert(pthread_join(wrt1, (void *) &wr1Result) == 0); + assert(pthread_join(rdt, (void *) &rdResult) == 0); + assert(pthread_join(wrt2, (void *) &wr2Result) == 0); assert(wr1Result == 10); assert(rdResult == 0); diff --git a/tests/semaphore1.c b/tests/semaphore1.c index f89a430..59e6aee 100644 --- a/tests/semaphore1.c +++ b/tests/semaphore1.c @@ -122,7 +122,7 @@ main() int result; assert(pthread_create(&t, NULL, thr, NULL) == 0); - assert(pthread_join(t, (void **)&result) == 0); + assert(pthread_join(t, (void *)&result) == 0); assert(result == 0); assert(sem_init(&s, PTHREAD_PROCESS_PRIVATE, 0) == 0); diff --git a/tests/semaphore4.c b/tests/semaphore4.c index 37613ac..c2fc948 100644 --- a/tests/semaphore4.c +++ b/tests/semaphore4.c @@ -114,7 +114,7 @@ main() assert(pthread_cancel(t[50]) == 0); { int result; - assert(pthread_join(t[50], (void **) &result) == 0); + assert(pthread_join(t[50], (void *) &result) == 0); // printf("result = %d\n", result); fflush(stdout); } assert(sem_getvalue(&s, &value) == 0); diff --git a/tests/spin4.c b/tests/spin4.c index 93e8d90..b6d3059 100644 --- a/tests/spin4.c +++ b/tests/spin4.c @@ -57,7 +57,7 @@ void * func(void * arg) assert(pthread_spin_unlock(&lock) == 0); PTW32_FTIME(&currSysTimeStop); - return (void *) GetDurationMilliSecs(currSysTimeStart, currSysTimeStop); + return (void *) (size_t)GetDurationMilliSecs(currSysTimeStart, currSysTimeStop); } int @@ -92,7 +92,7 @@ main() assert(pthread_spin_unlock(&lock) == 0); - assert(pthread_join(t, (void **) &result) == 0); + assert(pthread_join(t, (void *) &result) == 0); assert(result > 1000); assert(pthread_spin_destroy(&lock) == 0); diff --git a/tests/tsd1.c b/tests/tsd1.c index c28e4c5..de5055a 100644 --- a/tests/tsd1.c +++ b/tests/tsd1.c @@ -181,7 +181,7 @@ main() { int result = 0; - assert(pthread_join(thread[i], (void **) &result) == 0); + assert(pthread_join(thread[i], (void *) &result) == 0); } assert(pthread_key_delete(key) == 0); diff --git a/tests/tsd2.c b/tests/tsd2.c index d1f50cd..8aef83b 100644 --- a/tests/tsd2.c +++ b/tests/tsd2.c @@ -185,7 +185,7 @@ main() { int result = 0; - assert(pthread_join(thread[i], (void **) &result) == 0); + assert(pthread_join(thread[i], (void *) &result) == 0); } assert(pthread_key_delete(key) == 0); -- cgit v1.2.3