Commit f619466f authored by Sam Lantinga's avatar Sam Lantinga

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.

--HG--
branch : SDL-1.2
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/branches/SDL-1.2%403989
parent 0cfa331d
...@@ -160,9 +160,9 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x) ...@@ -160,9 +160,9 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x)
Uint32 hi, lo; Uint32 hi, lo;
/* Separate into high and low 32-bit values and swap them */ /* Separate into high and low 32-bit values and swap them */
lo = (Uint32)(x&0xFFFFFFFF); lo = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
x >>= 32; x >>= 32;
hi = (Uint32)(x&0xFFFFFFFF); hi = SDL_static_cast(Uint32, x & 0xFFFFFFFF);
x = SDL_Swap32(lo); x = SDL_Swap32(lo);
x <<= 32; x <<= 32;
x |= SDL_Swap32(hi); x |= SDL_Swap32(hi);
......
...@@ -266,7 +266,7 @@ do { \ ...@@ -266,7 +266,7 @@ do { \
"cld\n\t" \ "cld\n\t" \
"rep ; stosl\n\t" \ "rep ; stosl\n\t" \
: "=&D" (u0), "=&a" (u1), "=&c" (u2) \ : "=&D" (u0), "=&a" (u1), "=&c" (u2) \
: "0" (dst), "1" (val), "2" ((Uint32)(len)) \ : "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len)) \
: "memory" ); \ : "memory" ); \
} while(0) } while(0)
#endif #endif
...@@ -275,7 +275,7 @@ do { \ ...@@ -275,7 +275,7 @@ do { \
do { \ do { \
unsigned _count = (len); \ unsigned _count = (len); \
unsigned _n = (_count + 3) / 4; \ unsigned _n = (_count + 3) / 4; \
Uint32 *_p = (Uint32 *)(dst); \ Uint32 *_p = SDL_static_cast(Uint32 *, dst); \
Uint32 _val = (val); \ Uint32 _val = (val); \
if (len == 0) break; \ if (len == 0) break; \
switch (_count % 4) { \ switch (_count % 4) { \
...@@ -306,7 +306,7 @@ do { \ ...@@ -306,7 +306,7 @@ do { \
"movsb\n" \ "movsb\n" \
"2:" \ "2:" \
: "=&c" (u0), "=&D" (u1), "=&S" (u2) \ : "=&c" (u0), "=&D" (u1), "=&S" (u2) \
: "0" ((unsigned)(len)/4), "q" (len), "1" (dst),"2" (src) \ : "0" (SDL_static_cast(unsigned, len)/4), "q" (len), "1" (dst),"2" (src) \
: "memory" ); \ : "memory" ); \
} while(0) } while(0)
#endif #endif
...@@ -331,7 +331,7 @@ do { \ ...@@ -331,7 +331,7 @@ do { \
"cld\n\t" \ "cld\n\t" \
"rep ; movsl" \ "rep ; movsl" \
: "=&c" (ecx), "=&D" (edi), "=&S" (esi) \ : "=&c" (ecx), "=&D" (edi), "=&S" (esi) \
: "0" ((unsigned)(len)), "1" (dst), "2" (src) \ : "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src) \
: "memory" ); \ : "memory" ); \
} while(0) } while(0)
#endif #endif
...@@ -343,8 +343,8 @@ do { \ ...@@ -343,8 +343,8 @@ do { \
#define SDL_revcpy(dst, src, len) \ #define SDL_revcpy(dst, src, len) \
do { \ do { \
int u0, u1, u2; \ int u0, u1, u2; \
char *dstp = (char *)(dst); \ char *dstp = SDL_static_cast(char *, dst); \
char *srcp = (char *)(src); \ char *srcp = SDL_static_cast(char *, src); \
int n = (len); \ int n = (len); \
if ( n >= 4 ) { \ if ( n >= 4 ) { \
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment