diff options
author | Alfredo Tupone <tupone@gentoo.org> | 2006-12-22 21:58:46 +0000 |
---|---|---|
committer | Alfredo Tupone <tupone@gentoo.org> | 2006-12-22 21:58:46 +0000 |
commit | e669d6f8486148309a13bacc1a76ff95c602f622 (patch) | |
tree | 9988ac795c81b7cb798c5f8f04d5d5b96bd52207 | |
parent | Stable on amd64. Bug #158821 (diff) | |
download | gentoo-2-e669d6f8486148309a13bacc1a76ff95c602f622.tar.gz gentoo-2-e669d6f8486148309a13bacc1a76ff95c602f622.tar.bz2 gentoo-2-e669d6f8486148309a13bacc1a76ff95c602f622.zip |
Fix "shots not seen" with -fstrict-aliasing. Bug #140918
(Portage version: 2.1.1-r2)
-rw-r--r-- | games-action/bzflag/ChangeLog | 6 | ||||
-rw-r--r-- | games-action/bzflag/bzflag-2.0.8.ebuild | 3 | ||||
-rw-r--r-- | games-action/bzflag/files/bzflag-2.0.8-gcc4.patch | 94 | ||||
-rw-r--r-- | games-action/bzflag/files/digest-bzflag-1.10.8.20041007 | 2 |
4 files changed, 103 insertions, 2 deletions
diff --git a/games-action/bzflag/ChangeLog b/games-action/bzflag/ChangeLog index d2924be2d8fd..0ce276181358 100644 --- a/games-action/bzflag/ChangeLog +++ b/games-action/bzflag/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for games-action/bzflag # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/games-action/bzflag/ChangeLog,v 1.28 2006/12/01 20:08:50 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-action/bzflag/ChangeLog,v 1.29 2006/12/22 21:58:46 tupone Exp $ + + 22 Dec 2006; <tupone@gentoo.org> +files/bzflag-2.0.8-gcc4.patch, + bzflag-2.0.8.ebuild: + Fix "shots not seen" with -fstrict-aliasing. Bug #140918 by Andreas Eriksson 01 Dec 2006; Chris Gianelloni <wolf31o2@gentoo.org> bzflag-1.10.8.20041007.ebuild, bzflag-2.0.8.ebuild: diff --git a/games-action/bzflag/bzflag-2.0.8.ebuild b/games-action/bzflag/bzflag-2.0.8.ebuild index c3c80a46ddd6..110b43b917a7 100644 --- a/games-action/bzflag/bzflag-2.0.8.ebuild +++ b/games-action/bzflag/bzflag-2.0.8.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/games-action/bzflag/bzflag-2.0.8.ebuild,v 1.4 2006/12/13 02:37:19 mr_bones_ Exp $ +# $Header: /var/cvsroot/gentoo-x86/games-action/bzflag/bzflag-2.0.8.ebuild,v 1.5 2006/12/22 21:58:46 tupone Exp $ inherit eutils flag-o-matic games @@ -44,6 +44,7 @@ src_unpack() { unpack ${A} cd "${S}" + epatch "${FILESDIR}/${P}"-gcc4.patch sed -i configure \ -e 's:^CFLAGS=.*::' \ -e 's:^CXXFLAGS=.*::' \ diff --git a/games-action/bzflag/files/bzflag-2.0.8-gcc4.patch b/games-action/bzflag/files/bzflag-2.0.8-gcc4.patch new file mode 100644 index 000000000000..99bffc7070d1 --- /dev/null +++ b/games-action/bzflag/files/bzflag-2.0.8-gcc4.patch @@ -0,0 +1,94 @@ +--- 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)); + } + diff --git a/games-action/bzflag/files/digest-bzflag-1.10.8.20041007 b/games-action/bzflag/files/digest-bzflag-1.10.8.20041007 index 25a751c9091b..7f5b694b3620 100644 --- a/games-action/bzflag/files/digest-bzflag-1.10.8.20041007 +++ b/games-action/bzflag/files/digest-bzflag-1.10.8.20041007 @@ -1 +1,3 @@ MD5 59d88fc8f8fe78bc6495e4c19c383323 bzflag-1.10.8.20041007.tar.bz2 3963041 +RMD160 af90510b6331ee4df78a7f9d45b5976e838a7e00 bzflag-1.10.8.20041007.tar.bz2 3963041 +SHA256 be1d47c94c0e0c145221058e5f331c514138481d0d711e6b41bee04a2cf7b82b bzflag-1.10.8.20041007.tar.bz2 3963041 |