comparison test/torturethread.c @ 1615:d5298e8f22b3

Ugh, more 64-bit cleanup
author Sam Lantinga <slouken@libsdl.org>
date Fri, 31 Mar 2006 06:27:47 +0000
parents 1dd8bf30a109
children 3b08574f4c60
comparison
equal deleted inserted replaced
1614:6162b8d921ce 1615:d5298e8f22b3
29 29
30 int ThreadFunc(void *data) { 30 int ThreadFunc(void *data) {
31 SDL_Thread *sub_threads[NUMTHREADS]; 31 SDL_Thread *sub_threads[NUMTHREADS];
32 int flags[NUMTHREADS]; 32 int flags[NUMTHREADS];
33 int i; 33 int i;
34 uintptr_t tid = (uintptr_t)data; 34 int tid = (int)(uintptr_t)data;
35 35
36 fprintf(stderr, "Creating Thread %d\n", tid); 36 fprintf(stderr, "Creating Thread %d\n", tid);
37 37
38 for(i = 0; i < NUMTHREADS; i++) { 38 for(i = 0; i < NUMTHREADS; i++) {
39 flags[i] = 0; 39 flags[i] = 0;
57 } 57 }
58 58
59 int main(int argc, char *argv[]) 59 int main(int argc, char *argv[])
60 { 60 {
61 SDL_Thread *threads[NUMTHREADS]; 61 SDL_Thread *threads[NUMTHREADS];
62 uintptr_t i; 62 int i;
63 63
64 /* Load the SDL library */ 64 /* Load the SDL library */
65 if ( SDL_Init(0) < 0 ) { 65 if ( SDL_Init(0) < 0 ) {
66 fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError()); 66 fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
67 return(1); 67 return(1);
68 } 68 }
69 69
70 signal(SIGSEGV, SIG_DFL); 70 signal(SIGSEGV, SIG_DFL);
71 for(i = 0; i < NUMTHREADS; i++) { 71 for(i = 0; i < NUMTHREADS; i++) {
72 time_for_threads_to_die[i] = 0; 72 time_for_threads_to_die[i] = 0;
73 threads[i] = SDL_CreateThread(ThreadFunc, (void *) i); 73 threads[i] = SDL_CreateThread(ThreadFunc, (void *)(uintptr_t)i);
74 74
75 if ( threads[i] == NULL ) { 75 if ( threads[i] == NULL ) {
76 fprintf(stderr, 76 fprintf(stderr,
77 "Couldn't create thread: %s\n", SDL_GetError()); 77 "Couldn't create thread: %s\n", SDL_GetError());
78 quit(1); 78 quit(1);