diff options
author | Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> | 2013-03-27 14:54:11 +0100 |
---|---|---|
committer | Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> | 2013-03-27 14:54:11 +0100 |
commit | 12d33bd4b7b276b821c3ca301dec99a0a17d06e8 (patch) | |
tree | 4a9857fa0c1bddccb075f08c43c7c817b5272ce1 | |
parent | d6da0b3e4c4dc9a66ff53ccc43739bf584c37efb (diff) | |
download | quake-12d33bd4b7b276b821c3ca301dec99a0a17d06e8.tar.gz |
quake: Fix build with gcc 4.8
The code makes some assumptions about memory layout that aren't
necessarily valid -- code that comes down to
int vecs[3][4];
vecs[0][5]=something; // assume this is the same as vecs[1][1]
Fix that code, and don't error out on unused-parameter warnings.
Change-Id: Ibcba6139261b8aa4ffc449a72d8918496d79e268
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
-rw-r--r-- | Android.mk | 2 | ||||
-rw-r--r-- | quake/src/WinQuake/gl_model.cpp | 2 | ||||
-rw-r--r-- | quake/src/WinQuake/r_part.cpp | 2 |
3 files changed, 3 insertions, 3 deletions
@@ -31,7 +31,7 @@ include $(CLEAR_VARS) # Optional tag would mean it doesn't get installed by default LOCAL_MODULE_TAGS := optional -LOCAL_CFLAGS := -Werror +LOCAL_CFLAGS := -Werror -Wno-error=unused-parameter LOCAL_SRC_FILES:= \ cd_null.cpp \ diff --git a/quake/src/WinQuake/gl_model.cpp b/quake/src/WinQuake/gl_model.cpp index 72649bb..227b9f1 100644 --- a/quake/src/WinQuake/gl_model.cpp +++ b/quake/src/WinQuake/gl_model.cpp @@ -654,7 +654,7 @@ void Mod_LoadTexinfo (lump_t *l) for ( i=0 ; i<count ; i++, in++, out++) { for (j=0 ; j<8 ; j++) - out->vecs[0][j] = LittleFloat (in->vecs[0][j]); + out->vecs[j/4][j%4] = LittleFloat (in->vecs[j/4][j%4]); len1 = Length (out->vecs[0]); len2 = Length (out->vecs[1]); len1 = (len1 + len2)/2; diff --git a/quake/src/WinQuake/r_part.cpp b/quake/src/WinQuake/r_part.cpp index b6fcdca..8551b2e 100644 --- a/quake/src/WinQuake/r_part.cpp +++ b/quake/src/WinQuake/r_part.cpp @@ -137,7 +137,7 @@ void R_EntityParticles (entity_t *ent) if (!avelocities[0][0]) { for (i=0 ; i<NUMVERTEXNORMALS*3 ; i++) -avelocities[0][i] = (rand()&255) * 0.01; +avelocities[i/3][i%3] = (rand()&255) * 0.01; } |