diff options
author | Michael Sterrett <mr_bones_@gentoo.org> | 2009-01-06 21:45:42 +0000 |
---|---|---|
committer | Michael Sterrett <mr_bones_@gentoo.org> | 2009-01-06 21:45:42 +0000 |
commit | 2d2e040542cabe9fad73b89b77f013a506dcf758 (patch) | |
tree | 2eafcd7cc69046259f8a4a21e1984f609dbb247f /games-action/bzflag/files | |
parent | old (diff) | |
download | gentoo-2-2d2e040542cabe9fad73b89b77f013a506dcf758.tar.gz gentoo-2-2d2e040542cabe9fad73b89b77f013a506dcf758.tar.bz2 gentoo-2-2d2e040542cabe9fad73b89b77f013a506dcf758.zip |
old
(Portage version: 2.1.6.4/cvs/Linux 2.6.27.8 i686)
Diffstat (limited to 'games-action/bzflag/files')
-rw-r--r-- | games-action/bzflag/files/bzflag-2.0.8-gcc4.patch | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/games-action/bzflag/files/bzflag-2.0.8-gcc4.patch b/games-action/bzflag/files/bzflag-2.0.8-gcc4.patch deleted file mode 100644 index 99bffc7070d1..000000000000 --- a/games-action/bzflag/files/bzflag-2.0.8-gcc4.patch +++ /dev/null @@ -1,94 +0,0 @@ ---- src/net/Pack.cxx.old 2006-12-22 21:45:34.000000000 +0100 -+++ src/net/Pack.cxx 2006-12-22 21:45:42.000000000 +0100 -@@ -17,6 +17,15 @@ - - #define ADV(_b, _t) ((void*)(((char*)(_b)) + sizeof(_t))) - -+// -+// Unions -+// -+ -+union floatintuni { -+ float floatval; -+ uint32_t intval; -+}; -+ - - // - // Buffer Overrun Checks -@@ -93,23 +102,27 @@ - void* nboPackFloat(void* b, float v) - { - // hope that float is a 4 byte IEEE 754 standard encoding -- uint32_t x = htonl(*((uint32_t*)&v)); -- ::memcpy(b, &x, sizeof(float)); -- return ADV(b, float); -+ floatintuni u; -+ u.floatval = v; -+ -+ uint32_t x = (uint32_t)htonl(u.intval); -+ ::memcpy(b, &x, sizeof(uint32_t)); -+ return ADV(b, uint32_t); - } - - void* nboPackVector(void* b, const float *v) - { - // hope that float is a 4 byte IEEE 754 standard encoding -- uint32_t data[3]; -- uint32_t *pV = (uint32_t *)v; -- uint32_t *pB = (uint32_t *)data; -- -- *(pB++) = htonl(*(pV++)); -- *(pB++) = htonl(*(pV++)); -- *pB = htonl(*pV); -- ::memcpy( b, data, 3*sizeof(float)); -- return (void*) (((char*)b)+3*sizeof(float)); -+ floatintuni u; -+ uint32_t data[3]; -+ -+ for (int i=0; i<3; i++) { -+ u.floatval = v[i]; -+ data[i] = (uint32_t)htonl(u.intval); -+ } -+ -+ ::memcpy( b, data, 3*sizeof(uint32_t)); -+ return (void*) (((char*)b)+3*sizeof(uint32_t)); - } - - void* nboPackString(void* b, const void* m, int len) -@@ -229,9 +242,10 @@ - // hope that float is a 4 byte IEEE 754 standard encoding - uint32_t x; - ::memcpy(&x, b, sizeof(uint32_t)); -- const uint32_t y = (uint32_t)ntohl(x); -- v = *((float*)&y); -- return ADV(b, float); -+ floatintuni u; -+ u.intval = (uint32_t)ntohl(x); -+ v = u.floatval; -+ return ADV(b, uint32_t); - } - - void* nboUnpackVector(void* b, float *v) -@@ -247,13 +261,14 @@ - } - // hope that float is a 4 byte IEEE 754 standard encoding - uint32_t data[3]; -- ::memcpy( data, b, 3*sizeof(float)); -- uint32_t *pV = (uint32_t *)v; -- uint32_t *pB = (uint32_t *)data; -- -- *(pV++) = (uint32_t)ntohl(*(pB++)); -- *(pV++) = (uint32_t)ntohl(*(pB++)); -- *pV = (uint32_t)ntohl(*pB); -+ floatintuni u; -+ ::memcpy( data, b, 3*sizeof(uint32_t)); -+ -+ for (int i=0; i<3; i++) { -+ u.intval = (uint32_t)ntohl(data[i]); -+ v[i] = u.floatval; -+ } -+ - return (void *) (((char*)b) + 3*sizeof(float)); - } - |