Fixed compiler errors
authorSam Lantinga
Mon, 17 Jan 2011 13:54:13 -0800
changeset 50139d6b527e0912
parent 5012 2e282002bac3
child 5014 22751715e11a
Fixed compiler errors
test/testatomic.c
     1.1 --- a/test/testatomic.c	Mon Jan 17 13:53:31 2011 -0800
     1.2 +++ b/test/testatomic.c	Mon Jan 17 13:54:13 2011 -0800
     1.3 @@ -30,6 +30,7 @@
     1.4      int value;
     1.5      SDL_SpinLock lock = 0;
     1.6  
     1.7 +    SDL_atomic_t v;
     1.8      SDL_bool tfret = SDL_FALSE;
     1.9  
    1.10      printf("\nspin lock---------------------------------------\n\n");
    1.11 @@ -40,33 +41,31 @@
    1.12      printf("AtomicUnlock                 lock=%d\n", lock);
    1.13  
    1.14      printf("\natomic -----------------------------------------\n\n");
    1.15 -
    1.16 -    SDL_atomic_t v;
    1.17       
    1.18      SDL_AtomicSet(&v, 0);
    1.19      tfret = SDL_AtomicSet(&v, 10) == 0;
    1.20 -    printf("AtomicSet(10)        tfret=%s val=%"PRIu32"\n", tf(tfret), SDL_AtomicGet(&v));
    1.21 +    printf("AtomicSet(10)        tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v));
    1.22      tfret = SDL_AtomicAdd(&v, 10) == 10;
    1.23 -    printf("AtomicAdd(10)        tfret=%s val=%"PRIu32"\n", tf(tfret), SDL_AtomicGet(&v));
    1.24 +    printf("AtomicAdd(10)        tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v));
    1.25  
    1.26      SDL_AtomicSet(&v, 0);
    1.27      SDL_AtomicIncRef(&v);
    1.28      tfret = (SDL_AtomicGet(&v) == 1);
    1.29 -    printf("AtomicIncRef()       tfret=%s val=%"PRIu32"\n", tf(tfret), SDL_AtomicGet(&v));
    1.30 +    printf("AtomicIncRef()       tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v));
    1.31      SDL_AtomicIncRef(&v);
    1.32      tfret = (SDL_AtomicGet(&v) == 2);
    1.33 -    printf("AtomicIncRef()       tfret=%s val=%"PRIu32"\n", tf(tfret), SDL_AtomicGet(&v));
    1.34 +    printf("AtomicIncRef()       tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v));
    1.35      tfret = (SDL_AtomicDecRef(&v) == SDL_FALSE);
    1.36 -    printf("AtomicDecRef()       tfret=%s val=%"PRIu32"\n", tf(tfret), SDL_AtomicGet(&v));
    1.37 +    printf("AtomicDecRef()       tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v));
    1.38      tfret = (SDL_AtomicDecRef(&v) == SDL_TRUE);
    1.39 -    printf("AtomicDecRef()       tfret=%s val=%"PRIu32"\n", tf(tfret), SDL_AtomicGet(&v));
    1.40 +    printf("AtomicDecRef()       tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v));
    1.41  
    1.42      SDL_AtomicSet(&v, 10);
    1.43      tfret = (SDL_AtomicCAS(&v, 0, 20) == SDL_FALSE);
    1.44 -    printf("AtomicCAS()          tfret=%s val=%"PRIu32"\n", tf(tfret), SDL_AtomicGet(&v));
    1.45 +    printf("AtomicCAS()          tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v));
    1.46      value = SDL_AtomicGet(&v);
    1.47      tfret = (SDL_AtomicCAS(&v, value, 20) == SDL_TRUE);
    1.48 -    printf("AtomicCAS()          tfret=%s val=%"PRIu32"\n", tf(tfret), SDL_AtomicGet(&v));
    1.49 +    printf("AtomicCAS()          tfret=%s val=%d\n", tf(tfret), SDL_AtomicGet(&v));
    1.50  }
    1.51  
    1.52  /* Atomic operation test, adapted from code by Michael Davidsaver at: