diff include/SDL_endian.h @ 3067:bcd41b269091

Fixed bug #537 Description From esigra 2008-01-07 16:20:21 (-) [reply] I try to get a clean compile for a project using SDL. But I get warnings from SDL headers when I use -Wold-style-cast. This is especially bad because I plan to build the software with -Werror=old-style-cast when we have switched over to GCC 4.2, which has that option. But this problem can be fixed in the SDL headers. I checked out the SVN version and made some patches. See the attached patch.
author Sam Lantinga <slouken@libsdl.org>
date Tue, 17 Feb 2009 04:57:39 +0000
parents 8cc00819c8d6
children d3baf5ac4e37
line wrap: on
line diff
--- a/include/SDL_endian.h	Sun Feb 15 06:12:52 2009 +0000
+++ b/include/SDL_endian.h	Tue Feb 17 04:57:39 2009 +0000
@@ -174,9 +174,9 @@
     Uint32 hi, lo;
 
     /* Separate into high and low 32-bit values and swap them */
-    lo = (Uint32) (x & 0xFFFFFFFF);
+    lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
     x >>= 32;
-    hi = (Uint32) (x & 0xFFFFFFFF);
+    hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
     x = SDL_Swap32(lo);
     x <<= 32;
     x |= SDL_Swap32(hi);