Mercurial > sdl-ios-xcode
comparison include/SDL_endian.h @ 4283:cd511a8560b7 SDL-1.2
Ozkan Sezer 2009-04-01 23:17:13 PDT
This change should be applied to the 1.2 branch, too, because the svn version
SDL_net requires it.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 08 Oct 2009 07:45:55 +0000 |
parents | 4c4113c2162c |
children | 124629b76853 |
comparison
equal
deleted
inserted
replaced
4282:4909c960832e | 4283:cd511a8560b7 |
---|---|
158 static __inline__ Uint64 SDL_Swap64(Uint64 x) | 158 static __inline__ Uint64 SDL_Swap64(Uint64 x) |
159 { | 159 { |
160 Uint32 hi, lo; | 160 Uint32 hi, lo; |
161 | 161 |
162 /* Separate into high and low 32-bit values and swap them */ | 162 /* Separate into high and low 32-bit values and swap them */ |
163 lo = (Uint32)(x&0xFFFFFFFF); | 163 lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF); |
164 x >>= 32; | 164 x >>= 32; |
165 hi = (Uint32)(x&0xFFFFFFFF); | 165 hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF); |
166 x = SDL_Swap32(lo); | 166 x = SDL_Swap32(lo); |
167 x <<= 32; | 167 x <<= 32; |
168 x |= SDL_Swap32(hi); | 168 x |= SDL_Swap32(hi); |
169 return(x); | 169 return(x); |
170 } | 170 } |