comparison 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
comparison
equal deleted inserted replaced
3066:8cbf68bdf81b 3067:bcd41b269091
172 SDL_Swap64(Uint64 x) 172 SDL_Swap64(Uint64 x)
173 { 173 {
174 Uint32 hi, lo; 174 Uint32 hi, lo;
175 175
176 /* Separate into high and low 32-bit values and swap them */ 176 /* Separate into high and low 32-bit values and swap them */
177 lo = (Uint32) (x & 0xFFFFFFFF); 177 lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
178 x >>= 32; 178 x >>= 32;
179 hi = (Uint32) (x & 0xFFFFFFFF); 179 hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
180 x = SDL_Swap32(lo); 180 x = SDL_Swap32(lo);
181 x <<= 32; 181 x <<= 32;
182 x |= SDL_Swap32(hi); 182 x |= SDL_Swap32(hi);
183 return (x); 183 return (x);
184 } 184 }