# HG changeset patch # User Sam Lantinga # Date 1142117652 0 # Node ID 1dd8bf30a1098308915ff5028bc92ce0e33d6c6c # Parent 4da1926c287cef4845bd06dc215450f174e57f0d Might have fixed 64-bit issues. :) diff -r 4da1926c287c -r 1dd8bf30a109 test/testsem.c --- a/test/testsem.c Sat Mar 11 20:16:50 2006 +0000 +++ b/test/testsem.c Sat Mar 11 22:54:12 2006 +0000 @@ -15,15 +15,16 @@ 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 @@ 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]); diff -r 4da1926c287c -r 1dd8bf30a109 test/torturethread.c --- a/test/torturethread.c Sat Mar 11 20:16:50 2006 +0000 +++ b/test/torturethread.c Sat Mar 11 22:54:12 2006 +0000 @@ -31,7 +31,7 @@ SDL_Thread *sub_threads[NUMTHREADS]; int flags[NUMTHREADS]; int i; - int tid = (int ) data; + uintptr_t tid = (uintptr_t)data; fprintf(stderr, "Creating Thread %d\n", tid); @@ -59,7 +59,7 @@ int main(int argc, char *argv[]) { SDL_Thread *threads[NUMTHREADS]; - int i; + uintptr_t i; /* Load the SDL library */ if ( SDL_Init(0) < 0 ) {