Mercurial > sdl-ios-xcode
diff src/atomic/linux/SDL_atomic.c @ 3216:48a80f2a7ff2
volitile... duh, yeah the variable need to be labeled volitile
author | Bob Pendleton <bob@pendleton.com> |
---|---|
date | Thu, 09 Jul 2009 21:31:27 +0000 |
parents | 759032c318d8 |
children | 72b542f34739 |
line wrap: on
line diff
--- a/src/atomic/linux/SDL_atomic.c Tue Jul 07 14:02:57 2009 +0000 +++ b/src/atomic/linux/SDL_atomic.c Thu Jul 09 21:31:27 2009 +0000 @@ -137,7 +137,7 @@ /* 8 bit atomic operations */ Uint8 -SDL_AtomicExchange8(Uint8 * ptr, Uint8 value) +SDL_AtomicExchange8(volatile Uint8 * ptr, Uint8 value) { #ifdef nativeExchange8 return nativeExchange8(ptr, value); @@ -154,7 +154,7 @@ } SDL_bool -SDL_AtomicCompareThenSet8(Uint8 * ptr, Uint8 oldvalue, Uint8 newvalue) +SDL_AtomicCompareThenSet8(volatile Uint8 * ptr, Uint8 oldvalue, Uint8 newvalue) { #ifdef nativeCompareThenSet8 return (SDL_bool)nativeCompareThenSet8(ptr, oldvalue, newvalue); @@ -174,7 +174,7 @@ } SDL_bool -SDL_AtomicTestThenSet8(Uint8 * ptr) +SDL_AtomicTestThenSet8(volatile Uint8 * ptr) { #ifdef nativeTestThenSet8 return (SDL_bool)nativeTestThenSet8(ptr); @@ -194,7 +194,7 @@ } void -SDL_AtomicClear8(Uint8 * ptr) +SDL_AtomicClear8(volatile Uint8 * ptr) { #ifdef nativeClear8 nativeClear8(ptr); @@ -208,7 +208,7 @@ } Uint8 -SDL_AtomicFetchThenIncrement8(Uint8 * ptr) +SDL_AtomicFetchThenIncrement8(volatile Uint8 * ptr) { #ifdef nativeFetchThenIncrement8 return nativeFetchThenIncrement8(ptr); @@ -225,7 +225,7 @@ } Uint8 -SDL_AtomicFetchThenDecrement8(Uint8 * ptr) +SDL_AtomicFetchThenDecrement8(volatile Uint8 * ptr) { #ifdef nativeFetchThenDecrement8 return nativeFetchThenDecrement8(ptr); @@ -242,7 +242,7 @@ } Uint8 -SDL_AtomicFetchThenAdd8(Uint8 * ptr, Uint8 value) +SDL_AtomicFetchThenAdd8(volatile Uint8 * ptr, Uint8 value) { #ifdef nativeFetchThenAdd8 return nativeFetchThenAdd8(ptr, value); @@ -259,7 +259,7 @@ } Uint8 -SDL_AtomicFetchThenSubtract8(Uint8 * ptr, Uint8 value) +SDL_AtomicFetchThenSubtract8(volatile Uint8 * ptr, Uint8 value) { #ifdef nativeFetchThenSubtract8 return nativeFetchThenSubtract8(ptr, value); @@ -276,7 +276,7 @@ } Uint8 -SDL_AtomicIncrementThenFetch8(Uint8 * ptr) +SDL_AtomicIncrementThenFetch8(volatile Uint8 * ptr) { #ifdef nativeIncrementThenFetch8 return nativeIncrementThenFetch8(ptr); @@ -293,7 +293,7 @@ } Uint8 -SDL_AtomicDecrementThenFetch8(Uint8 * ptr) +SDL_AtomicDecrementThenFetch8(volatile Uint8 * ptr) { #ifdef nativeDecrementThenFetch8 return nativeDecrementThenFetch8(ptr); @@ -310,7 +310,7 @@ } Uint8 -SDL_AtomicAddThenFetch8(Uint8 * ptr, Uint8 value) +SDL_AtomicAddThenFetch8(volatile Uint8 * ptr, Uint8 value) { #ifdef nativeAddThenFetch8 return nativeAddThenFetch8(ptr, value); @@ -327,7 +327,7 @@ } Uint8 -SDL_AtomicSubtractThenFetch8(Uint8 * ptr, Uint8 value) +SDL_AtomicSubtractThenFetch8(volatile Uint8 * ptr, Uint8 value) { #ifdef nativeSubtractThenFetch8 return nativeSubtractThenFetch8(ptr, value); @@ -346,7 +346,7 @@ /* 16 bit atomic operations */ Uint16 -SDL_AtomicExchange16(Uint16 * ptr, Uint16 value) +SDL_AtomicExchange16(volatile Uint16 * ptr, Uint16 value) { #ifdef nativeExchange16 return nativeExchange16(ptr, value); @@ -363,7 +363,7 @@ } SDL_bool -SDL_AtomicCompareThenSet16(Uint16 * ptr, Uint16 oldvalue, Uint16 newvalue) +SDL_AtomicCompareThenSet16(volatile Uint16 * ptr, Uint16 oldvalue, Uint16 newvalue) { #ifdef nativeCompareThenSet16 return (SDL_bool)nativeCompareThenSet16(ptr, oldvalue, newvalue); @@ -383,7 +383,7 @@ } SDL_bool -SDL_AtomicTestThenSet16(Uint16 * ptr) +SDL_AtomicTestThenSet16(volatile Uint16 * ptr) { #ifdef nativeTestThenSet16 return (SDL_bool)nativeTestThenSet16(ptr); @@ -403,7 +403,7 @@ } void -SDL_AtomicClear16(Uint16 * ptr) +SDL_AtomicClear16(volatile Uint16 * ptr) { #ifdef nativeClear16 nativeClear16(ptr); @@ -417,7 +417,7 @@ } Uint16 -SDL_AtomicFetchThenIncrement16(Uint16 * ptr) +SDL_AtomicFetchThenIncrement16(volatile Uint16 * ptr) { #ifdef nativeFetchThenIncrement16 return nativeFetchThenIncrement16(ptr); @@ -434,7 +434,7 @@ } Uint16 -SDL_AtomicFetchThenDecrement16(Uint16 * ptr) +SDL_AtomicFetchThenDecrement16(volatile Uint16 * ptr) { #ifdef nativeFetchThenDecrement16 return nativeFetchThenDecrement16(ptr); @@ -451,7 +451,7 @@ } Uint16 -SDL_AtomicFetchThenAdd16(Uint16 * ptr, Uint16 value) +SDL_AtomicFetchThenAdd16(volatile Uint16 * ptr, Uint16 value) { #ifdef nativeFetchThenAdd16 return nativeFetchThenAdd16(ptr, value); @@ -468,7 +468,7 @@ } Uint16 -SDL_AtomicFetchThenSubtract16(Uint16 * ptr, Uint16 value) +SDL_AtomicFetchThenSubtract16(volatile Uint16 * ptr, Uint16 value) { #ifdef nativeFetchThenSubtract16 return nativeFetchThenSubtract16(ptr, value); @@ -485,7 +485,7 @@ } Uint16 -SDL_AtomicIncrementThenFetch16(Uint16 * ptr) +SDL_AtomicIncrementThenFetch16(volatile Uint16 * ptr) { #ifdef nativeIncrementThenFetch16 return nativeIncrementThenFetch16(ptr); @@ -502,7 +502,7 @@ } Uint16 -SDL_AtomicDecrementThenFetch16(Uint16 * ptr) +SDL_AtomicDecrementThenFetch16(volatile Uint16 * ptr) { #ifdef nativeDecrementThenFetch16 return nativeDecrementThenFetch16(ptr); @@ -519,7 +519,7 @@ } Uint16 -SDL_AtomicAddThenFetch16(Uint16 * ptr, Uint16 value) +SDL_AtomicAddThenFetch16(volatile Uint16 * ptr, Uint16 value) { #ifdef nativeAddThenFetch16 return nativeAddThenFetch16(ptr, value); @@ -536,7 +536,7 @@ } Uint16 -SDL_AtomicSubtractThenFetch16(Uint16 * ptr, Uint16 value) +SDL_AtomicSubtractThenFetch16(volatile Uint16 * ptr, Uint16 value) { #ifdef nativeSubtractThenFetch16 return nativeSubtractThenFetch16(ptr, value); @@ -555,7 +555,7 @@ /* 32 bit atomic operations */ Uint32 -SDL_AtomicExchange32(Uint32 * ptr, Uint32 value) +SDL_AtomicExchange32(volatile Uint32 * ptr, Uint32 value) { #ifdef nativeExchange32 return nativeExchange32(ptr, value); @@ -572,7 +572,7 @@ } SDL_bool -SDL_AtomicCompareThenSet32(Uint32 * ptr, Uint32 oldvalue, Uint32 newvalue) +SDL_AtomicCompareThenSet32(volatile Uint32 * ptr, Uint32 oldvalue, Uint32 newvalue) { #ifdef nativeCompareThenSet32 return (SDL_bool)nativeCompareThenSet32(ptr, oldvalue, newvalue); @@ -592,7 +592,7 @@ } SDL_bool -SDL_AtomicTestThenSet32(Uint32 * ptr) +SDL_AtomicTestThenSet32(volatile Uint32 * ptr) { #ifdef nativeTestThenSet32 return (SDL_bool)nativeTestThenSet32(ptr); @@ -612,7 +612,7 @@ } void -SDL_AtomicClear32(Uint32 * ptr) +SDL_AtomicClear32(volatile Uint32 * ptr) { #ifdef nativeClear32 nativeClear32(ptr); @@ -626,7 +626,7 @@ } Uint32 -SDL_AtomicFetchThenIncrement32(Uint32 * ptr) +SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr) { #ifdef nativeFetchThenIncrement32 return nativeFetchThenIncrement32(ptr); @@ -643,7 +643,7 @@ } Uint32 -SDL_AtomicFetchThenDecrement32(Uint32 * ptr) +SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr) { #ifdef nativeFetchThenDecrement32 return nativeFetchThenDecrement32(ptr); @@ -660,7 +660,7 @@ } Uint32 -SDL_AtomicFetchThenAdd32(Uint32 * ptr, Uint32 value) +SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value) { #ifdef nativeFetchThenAdd32 return nativeFetchThenAdd32(ptr, value); @@ -677,7 +677,7 @@ } Uint32 -SDL_AtomicFetchThenSubtract32(Uint32 * ptr, Uint32 value) +SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value) { #ifdef nativeFetchThenSubtract32 return nativeFetchThenSubtract32(ptr, value); @@ -694,7 +694,7 @@ } Uint32 -SDL_AtomicIncrementThenFetch32(Uint32 * ptr) +SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr) { #ifdef nativeIncrementThenFetch32 return nativeIncrementThenFetch32(ptr); @@ -711,7 +711,7 @@ } Uint32 -SDL_AtomicDecrementThenFetch32(Uint32 * ptr) +SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr) { #ifdef nativeDecrementThenFetch32 return nativeDecrementThenFetch32(ptr); @@ -728,7 +728,7 @@ } Uint32 -SDL_AtomicAddThenFetch32(Uint32 * ptr, Uint32 value) +SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value) { #ifdef nativeAddThenFetch32 return nativeAddThenFetch32(ptr, value); @@ -745,7 +745,7 @@ } Uint32 -SDL_AtomicSubtractThenFetch32(Uint32 * ptr, Uint32 value) +SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value) { #ifdef nativeSubtractThenFetch32 return nativeSubtractThenFetch32(ptr, value); @@ -765,7 +765,7 @@ #ifdef SDL_HAS_64BIT_TYPE Uint64 -SDL_AtomicExchange64(Uint64 * ptr, Uint64 value) +SDL_AtomicExchange64(volatile Uint64 * ptr, Uint64 value) { #ifdef nativeExchange64 return nativeExchange64(ptr, value); @@ -782,7 +782,7 @@ } SDL_bool -SDL_AtomicCompareThenSet64(Uint64 * ptr, Uint64 oldvalue, Uint64 newvalue) +SDL_AtomicCompareThenSet64(volatile Uint64 * ptr, Uint64 oldvalue, Uint64 newvalue) { #ifdef nativeCompareThenSet64 return (SDL_bool)nativeCompareThenSet64(ptr, oldvalue, newvalue); @@ -802,7 +802,7 @@ } SDL_bool -SDL_AtomicTestThenSet64(Uint64 * ptr) +SDL_AtomicTestThenSet64(volatile Uint64 * ptr) { #ifdef nativeTestThenSet64 return (SDL_bool)nativeTestThenSet64(ptr); @@ -822,7 +822,7 @@ } void -SDL_AtomicClear64(Uint64 * ptr) +SDL_AtomicClear64(volatile Uint64 * ptr) { #ifdef nativeClear64 nativeClear64(ptr); @@ -836,7 +836,7 @@ } Uint64 -SDL_AtomicFetchThenIncrement64(Uint64 * ptr) +SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr) { #ifdef nativeFetchThenIncrement64 return nativeFetchThenIncrement64(ptr); @@ -853,7 +853,7 @@ } Uint64 -SDL_AtomicFetchThenDecrement64(Uint64 * ptr) +SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr) { #ifdef nativeFetchThenDecrement64 return nativeFetchThenDecrement64(ptr); @@ -870,7 +870,7 @@ } Uint64 -SDL_AtomicFetchThenAdd64(Uint64 * ptr, Uint64 value) +SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value) { #ifdef nativeFetchThenAdd64 return nativeFetchThenAdd64(ptr, value); @@ -887,7 +887,7 @@ } Uint64 -SDL_AtomicFetchThenSubtract64(Uint64 * ptr, Uint64 value) +SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value) { #ifdef nativeFetchThenSubtract64 return nativeFetchThenSubtract64(ptr, value); @@ -904,7 +904,7 @@ } Uint64 -SDL_AtomicIncrementThenFetch64(Uint64 * ptr) +SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr) { #ifdef nativeIncrementThenFetch64 return nativeIncrementThenFetch64(ptr); @@ -921,7 +921,7 @@ } Uint64 -SDL_AtomicDecrementThenFetch64(Uint64 * ptr) +SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr) { #ifdef nativeDecrementThenFetch64 return nativeDecrementThenFetch64(ptr); @@ -938,7 +938,7 @@ } Uint64 -SDL_AtomicAddThenFetch64(Uint64 * ptr, Uint64 value) +SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value) { #ifdef nativeAddThenFetch64 return nativeAddThenFetch64(ptr, value); @@ -955,7 +955,7 @@ } Uint64 -SDL_AtomicSubtractThenFetch64(Uint64 * ptr, Uint64 value) +SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value) { #ifdef nativeSubtractThenFetch64 return nativeSubtractThenFetch64(ptr, value);