Commit 9ccb05a0 authored by Sam Lantinga's avatar Sam Lantinga

Ugh, more 64-bit cleanup

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401622
parent 403b4f89
......@@ -21,26 +21,26 @@ int TestTypes(SDL_bool verbose)
if ( badsize(sizeof(Uint8), 1) ) {
if ( verbose )
printf("sizeof(Uint8) != 1, instead = %d\n",
printf("sizeof(Uint8) != 1, instead = %ul\n",
sizeof(Uint8));
++error;
}
if ( badsize(sizeof(Uint16), 2) ) {
if ( verbose )
printf("sizeof(Uint16) != 2, instead = %d\n",
printf("sizeof(Uint16) != 2, instead = %ul\n",
sizeof(Uint16));
++error;
}
if ( badsize(sizeof(Uint32), 4) ) {
if ( verbose )
printf("sizeof(Uint32) != 4, instead = %d\n",
printf("sizeof(Uint32) != 4, instead = %ul\n",
sizeof(Uint32));
++error;
}
#ifdef SDL_HAS_64BIT_TYPE
if ( badsize(sizeof(Uint64), 8) ) {
if ( verbose )
printf("sizeof(Uint64) != 8, instead = %d\n",
printf("sizeof(Uint64) != 8, instead = %ul\n",
sizeof(Uint64));
++error;
}
......@@ -110,7 +110,11 @@ int TestEndian(SDL_bool verbose)
}
#ifdef SDL_HAS_64BIT_TYPE
if ( verbose ) {
#ifdef _MSC_VER
printf("Value 64 = 0x%I64X, swapped = 0x%I64X\n", value64, SDL_Swap64(value64));
#else
printf("Value 64 = 0x%llX, swapped = 0x%llX\n", value64, SDL_Swap64(value64));
#endif
}
if ( SDL_Swap64(value64) != swapped64 ) {
if ( verbose ) {
......
......@@ -15,7 +15,7 @@ int alive = 1;
int ThreadFunc(void *data)
{
uintptr_t threadnum = (uintptr_t)data;
int threadnum = (int)(uintptr_t)data;
while ( alive ) {
SDL_SemWait(sem);
fprintf(stderr, "Thread number %d has got the semaphore (value = %d)!\n", threadnum, SDL_SemValue(sem));
......
......@@ -12,13 +12,6 @@
static int ticks = 0;
/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
static void quit(int rc)
{
SDL_Quit();
exit(rc);
}
static Uint32 ticktock(Uint32 interval)
{
++ticks;
......@@ -27,7 +20,7 @@ static Uint32 ticktock(Uint32 interval)
static Uint32 callback(Uint32 interval, void *param)
{
printf("Timer %d : param = %d\n", interval, (uintptr_t)param);
printf("Timer %d : param = %d\n", interval, (int)(uintptr_t)param);
return interval;
}
......
......@@ -31,7 +31,7 @@ int ThreadFunc(void *data) {
SDL_Thread *sub_threads[NUMTHREADS];
int flags[NUMTHREADS];
int i;
uintptr_t tid = (uintptr_t)data;
int tid = (int)(uintptr_t)data;
fprintf(stderr, "Creating Thread %d\n", tid);
......@@ -59,7 +59,7 @@ int ThreadFunc(void *data) {
int main(int argc, char *argv[])
{
SDL_Thread *threads[NUMTHREADS];
uintptr_t i;
int i;
/* Load the SDL library */
if ( SDL_Init(0) < 0 ) {
......@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
signal(SIGSEGV, SIG_DFL);
for(i = 0; i < NUMTHREADS; i++) {
time_for_threads_to_die[i] = 0;
threads[i] = SDL_CreateThread(ThreadFunc, (void *) i);
threads[i] = SDL_CreateThread(ThreadFunc, (void *)(uintptr_t)i);
if ( threads[i] == NULL ) {
fprintf(stderr,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment