diff options
author | Sam Lantinga <slouken@libsdl.org> | 2006-03-11 22:54:12 +0000 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2006-03-11 22:54:12 +0000 |
commit | 2a752c3732e9e80b253fc1206a07620e8f6208ba (patch) | |
tree | 28b1abf057a6593a74157bd80df24870f792f5ff /test/testsem.c | |
parent | c2a4bb7b9ab6ba7d728dba30ae149da24ea21ab5 (diff) |
Might have fixed 64-bit issues. :)
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401499
Diffstat (limited to 'test/testsem.c')
-rw-r--r-- | test/testsem.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/testsem.c b/test/testsem.c index 9034220b..f0a98599 100644 --- a/test/testsem.c +++ b/test/testsem.c @@ -15,15 +15,16 @@ int alive = 1; int ThreadFunc(void *data) { + uintptr_t threadnum = (uintptr_t)data; while ( alive ) { SDL_SemWait(sem); - fprintf(stderr, "Thread number %d has got the semaphore (value = %d)!\n", (int)data, SDL_SemValue(sem)); + fprintf(stderr, "Thread number %d has got the semaphore (value = %d)!\n", threadnum, SDL_SemValue(sem)); SDL_Delay(200); SDL_SemPost(sem); - fprintf(stderr, "Thread number %d has released the semaphore (value = %d)!\n", (int)data, SDL_SemValue(sem)); + fprintf(stderr, "Thread number %d has released the semaphore (value = %d)!\n", threadnum, SDL_SemValue(sem)); SDL_Delay(1); /* For the scheduler */ } - printf("Thread number %d exiting.\n", (int)data); + printf("Thread number %d exiting.\n", threadnum); return 0; } @@ -35,7 +36,8 @@ static void killed(int sig) int main(int argc, char **argv) { SDL_Thread *threads[NUM_THREADS]; - int i, init_sem; + uintptr_t i; + int init_sem; if(argc < 2) { fprintf(stderr,"Usage: %s init_value\n", argv[0]); |