Fixed compiler warnings using Windows intrinsics
authorSam Lantinga <slouken@libsdl.org>
Mon, 17 Jan 2011 14:07:15 -0800
changeset 5016 cc879bc6c4cf
parent 5015 1bf9e38431ec
child 5017 a9a3b9852a4a
Fixed compiler warnings using Windows intrinsics
include/SDL_atomic.h
--- a/include/SDL_atomic.h	Mon Jan 17 14:05:43 2011 -0800
+++ b/include/SDL_atomic.h	Mon Jan 17 14:07:15 2011 -0800
@@ -115,12 +115,12 @@
 #if defined(__WIN32__)
 #include <intrin.h>
 
-#define SDL_AtomicSet(a, v)     _InterlockedExchange(&(a)->value, (v))
+#define SDL_AtomicSet(a, v)     _InterlockedExchange((long*)&(a)->value, (v))
 #define SDL_AtomicGet(a)        ((a)->value)
-#define SDL_AtomicAdd(a, v)     _InterlockedExchangeAdd(&(a)->value, (v))
-#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange(&(a)->value, (newval), (oldval)) == (oldval))
+#define SDL_AtomicAdd(a, v)     _InterlockedExchangeAdd((long*)&(a)->value, (v))
+#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange((long*)&(a)->value, (newval), (oldval)) == (oldval))
 #define SDL_AtomicSetPtr(a, v)  (void)_InterlockedExchangePointer((a), (v))
-#define SDL_AtomicGetPtr(a)     (*(a))
+#define SDL_AtomicGetPtr(a)     (*(a))
 #if _M_IX86
 #define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchange((long*)(a), (long)(newval), (long)(oldval)) == (long)(oldval))
 #else