[Pkg-sdl-commits] [SCM] Packaging of SDL_net branch, master, updated. debian/1.2.7-5-7-g1bfeb8c
Manuel A. Fernandez Montecelo
manuel.montezelo at gmail.com
Sat Jan 21 00:02:16 UTC 2012
The following commit has been merged in the master branch:
commit b2aa182352f8c7067999d643d73ffd45fabd395c
Author: Manuel A. Fernandez Montecelo <manuel.montezelo at gmail.com>
Date: Fri Jan 20 21:38:58 2012 +0000
Patch modified to fit current code
diff --git a/debian/patches/endian.patch b/debian/patches/endian.patch
index 6a0d3a9..6255c74 100644
--- a/debian/patches/endian.patch
+++ b/debian/patches/endian.patch
@@ -7,15 +7,15 @@ Bug-Debian: http://bugs.debian.org/217221
--- a/SDL_net.h
+++ b/SDL_net.h
-@@ -356,7 +356,6 @@
+@@ -366,7 +366,6 @@
#define SDLNet_Write16(value, areap) \
- (*(Uint16 *)(areap) = SDL_SwapBE16(value))
+ (*SDL_reinterpret_cast(Uint16 *, areap) = SDL_SwapBE16(value))
#else
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#define SDLNet_Write16(value, areap) \
do \
{ \
-@@ -364,15 +363,6 @@
+@@ -374,15 +373,6 @@
area[0] = (value >> 8) & 0xFF; \
area[1] = value & 0xFF; \
} while ( 0 )
@@ -23,7 +23,7 @@ Bug-Debian: http://bugs.debian.org/217221
-#define SDLNet_Write16(value, areap) \
-do \
-{ \
-- Uint8 *area = (Uint8 *)(areap); \
+- Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
- area[1] = (value >> 8) & 0xFF; \
- area[0] = value & 0xFF; \
-} while ( 0 )
@@ -31,15 +31,15 @@ Bug-Debian: http://bugs.debian.org/217221
#endif /* !SDL_DATA_ALIGNED */
/* Write a 32 bit value to network packet buffer */
-@@ -380,7 +370,6 @@
+@@ -390,7 +380,6 @@
#define SDLNet_Write32(value, areap) \
- *(Uint32 *)(areap) = SDL_SwapBE32(value);
+ *SDL_reinterpret_cast(Uint32 *, areap) = SDL_SwapBE32(value);
#else
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#define SDLNet_Write32(value, areap) \
do \
{ \
-@@ -390,17 +379,6 @@
+@@ -400,17 +389,6 @@
area[2] = (value >> 8) & 0xFF; \
area[3] = value & 0xFF; \
} while ( 0 )
@@ -47,7 +47,7 @@ Bug-Debian: http://bugs.debian.org/217221
-#define SDLNet_Write32(value, areap) \
-do \
-{ \
-- Uint8 *area = (Uint8 *)(areap); \
+- Uint8 *area = SDL_reinterpret_cast(Uint8 *, areap); \
- area[3] = (value >> 24) & 0xFF; \
- area[2] = (value >> 16) & 0xFF; \
- area[1] = (value >> 8) & 0xFF; \
@@ -57,33 +57,33 @@ Bug-Debian: http://bugs.debian.org/217221
#endif /* !SDL_DATA_ALIGNED */
/* Read a 16 bit value from network packet buffer */
-@@ -408,13 +386,8 @@
+@@ -418,13 +396,8 @@
#define SDLNet_Read16(areap) \
- (SDL_SwapBE16(*(Uint16 *)(areap)))
+ (SDL_SwapBE16(*SDL_reinterpret_cast(Uint16 *, areap)))
#else
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#define SDLNet_Read16(areap) \
- ((((Uint8 *)areap)[0] << 8) | ((Uint8 *)areap)[1] << 0)
+ (((SDL_reinterpret_cast(Uint8 *, areap))[0] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[1] << 0)
-#else
-#define SDLNet_Read16(areap) \
-- ((((Uint8 *)areap)[1] << 8) | ((Uint8 *)areap)[0] << 0)
+- (((SDL_reinterpret_cast(Uint8 *, areap))[1] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[0] << 0)
-#endif
#endif /* !SDL_DATA_ALIGNED */
/* Read a 32 bit value from network packet buffer */
-@@ -422,15 +395,9 @@
+@@ -432,15 +405,9 @@
#define SDLNet_Read32(areap) \
- (SDL_SwapBE32(*(Uint32 *)(areap)))
+ (SDL_SwapBE32(*SDL_reinterpret_cast(Uint32 *, areap)))
#else
-#if SDL_BYTEORDER == SDL_BIG_ENDIAN
#define SDLNet_Read32(areap) \
- ((((Uint8 *)areap)[0] << 24) | (((Uint8 *)areap)[1] << 16) | \
- (((Uint8 *)areap)[2] << 8) | ((Uint8 *)areap)[3] << 0)
+ (((SDL_reinterpret_cast(Uint8 *, areap))[0] << 24) | ((SDL_reinterpret_cast(Uint8 *, areap))[1] << 16) | \
+ ((SDL_reinterpret_cast(Uint8 *, areap))[2] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[3] << 0)
-#else
-#define SDLNet_Read32(areap) \
-- ((((Uint8 *)areap)[3] << 24) | (((Uint8 *)areap)[2] << 16) | \
-- (((Uint8 *)areap)[1] << 8) | ((Uint8 *)areap)[0] << 0)
+- (((SDL_reinterpret_cast(Uint8 *, areap))[3] << 24) | ((SDL_reinterpret_cast(Uint8 *, areap))[2] << 16) | \
+- ((SDL_reinterpret_cast(Uint8 *, areap))[1] << 8) | (SDL_reinterpret_cast(Uint8 *, areap))[0] << 0)
-#endif
#endif /* !SDL_DATA_ALIGNED */
- #ifdef MACOS_OPENTRANSPORT
+ /* Ends C function definitions when using C++ */
--
Packaging of SDL_net
More information about the pkg-sdl-commits
mailing list