changeset 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 4909c960832e
children 261ad7b40a31
files include/SDL_endian.h include/SDL_stdinc.h
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/include/SDL_endian.h	Thu Oct 08 07:09:04 2009 +0000
+++ b/include/SDL_endian.h	Thu Oct 08 07:45:55 2009 +0000
@@ -160,9 +160,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);
--- a/include/SDL_stdinc.h	Thu Oct 08 07:09:04 2009 +0000
+++ b/include/SDL_stdinc.h	Thu Oct 08 07:45:55 2009 +0000
@@ -266,7 +266,7 @@
 		"cld\n\t"					\
 		"rep ; stosl\n\t"				\
 		: "=&D" (u0), "=&a" (u1), "=&c" (u2)		\
-		: "0" (dst), "1" (val), "2" ((Uint32)(len))	\
+		: "0" (dst), "1" (val), "2" (SDL_static_cast(Uint32, len))	\
 		: "memory" );					\
 } while(0)
 #endif
@@ -275,7 +275,7 @@
 do {						\
 	unsigned _count = (len);		\
 	unsigned _n = (_count + 3) / 4;		\
-	Uint32 *_p = (Uint32 *)(dst);		\
+	Uint32 *_p = SDL_static_cast(Uint32 *, dst);	\
 	Uint32 _val = (val);			\
 	if (len == 0) break;			\
         switch (_count % 4) {			\
@@ -306,7 +306,7 @@
 		"movsb\n"						  \
 		"2:"							  \
 		: "=&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" );						  \
 } while(0)
 #endif
@@ -331,7 +331,7 @@
 		"cld\n\t"					\
 		"rep ; movsl"					\
 		: "=&c" (ecx), "=&D" (edi), "=&S" (esi)		\
-		: "0" ((unsigned)(len)), "1" (dst), "2" (src)	\
+		: "0" (SDL_static_cast(unsigned, len)), "1" (dst), "2" (src)	\
 		: "memory" );					\
 } while(0)
 #endif
@@ -343,8 +343,8 @@
 #define SDL_revcpy(dst, src, len)			\
 do {							\
 	int u0, u1, u2;					\
-	char *dstp = (char *)(dst);			\
-	char *srcp = (char *)(src);			\
+	char *dstp = SDL_static_cast(char *, dst);	\
+	char *srcp = SDL_static_cast(char *, src);	\
 	int n = (len);					\
 	if ( n >= 4 ) {					\
 	__asm__ __volatile__ (				\