mirror of https://github.com/encounter/SDL.git
removed a useless restriction from Watcom version of SDL_Swap32()
also did a little whitespace tidy-up.
This commit is contained in:
parent
b8d2185277
commit
55a385a333
|
@ -178,19 +178,10 @@ SDL_Swap32(Uint32 x)
|
|||
}
|
||||
#elif defined(__WATCOMC__) && defined(__386__)
|
||||
extern _inline Uint32 SDL_Swap32(Uint32);
|
||||
#ifndef __SW_3 /* 486+ */
|
||||
#pragma aux SDL_Swap32 = \
|
||||
"bswap eax" \
|
||||
parm [eax] \
|
||||
modify [eax];
|
||||
#else /* 386-only */
|
||||
#pragma aux SDL_Swap32 = \
|
||||
"xchg al, ah" \
|
||||
"ror eax, 16" \
|
||||
"xchg al, ah" \
|
||||
parm [eax] \
|
||||
modify [eax];
|
||||
#endif
|
||||
#elif defined(_MSC_VER)
|
||||
#pragma intrinsic(_byteswap_ulong)
|
||||
#define SDL_Swap32(x) _byteswap_ulong(x)
|
||||
|
@ -211,18 +202,16 @@ SDL_Swap32(Uint32 x)
|
|||
SDL_FORCE_INLINE Uint64
|
||||
SDL_Swap64(Uint64 x)
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
union {
|
||||
struct {
|
||||
Uint32 a, b;
|
||||
} s;
|
||||
Uint64 u;
|
||||
} v;
|
||||
v.u = x;
|
||||
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1": "=r"(v.s.a), "=r"(v.s.b):"0"(v.s.a),
|
||||
"1"(v.s.
|
||||
b));
|
||||
__asm__("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
|
||||
: "=r"(v.s.a), "=r"(v.s.b)
|
||||
: "0" (v.s.a), "1"(v.s.b));
|
||||
return v.u;
|
||||
}
|
||||
#elif defined(__GNUC__) && defined(__x86_64__)
|
||||
|
@ -264,8 +253,7 @@ SDL_Swap64(Uint64 x)
|
|||
SDL_FORCE_INLINE float
|
||||
SDL_SwapFloat(float x)
|
||||
{
|
||||
union
|
||||
{
|
||||
union {
|
||||
float f;
|
||||
Uint32 ui32;
|
||||
} swapper;
|
||||
|
|
Loading…
Reference in New Issue