diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2013-07-25 09:19:52 +0530 |
---|---|---|
committer | Amit Pundir <amit.pundir@linaro.org> | 2013-07-25 09:19:52 +0530 |
commit | 51132a25302f3ab53ea26cee6350cfe07b71d855 (patch) | |
tree | b620153e97c027d26af8db384944ceb35b62876c | |
parent | a3c8582020d66ad6a82cd56ea03f2e9dc983cefa (diff) | |
download | quake-linaro_android_4.3.1.tar.gz |
Fix build with -Werrorlinaro_android_4.3.1linaro_android_4.3
The original code causes a compiler warning about dereferencing
a type-punned pointer on gcc 4.7, causing the build with -Werror
to fail.
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r-- | quake/src/WinQuake/gl_draw.cpp | 2 | ||||
-rw-r--r-- | quake/src/WinQuake/pr_exec.cpp | 13 |
2 files changed, 9 insertions, 6 deletions
diff --git a/quake/src/WinQuake/gl_draw.cpp b/quake/src/WinQuake/gl_draw.cpp index aa9c9a8..2d1cbd0 100644 --- a/quake/src/WinQuake/gl_draw.cpp +++ b/quake/src/WinQuake/gl_draw.cpp @@ -529,7 +529,7 @@ qpic_t *Draw_PicFromWad (const char *name) // load little ones into the scrap if (p->width < 64 && p->height < 64) { - int x, y; + int x, y = 0; int i, j, k; int texnum; diff --git a/quake/src/WinQuake/pr_exec.cpp b/quake/src/WinQuake/pr_exec.cpp index 39ce86c..21750a5 100644 --- a/quake/src/WinQuake/pr_exec.cpp +++ b/quake/src/WinQuake/pr_exec.cpp @@ -572,25 +572,28 @@ while (1) case OP_LOAD_FLD: case OP_LOAD_ENT: case OP_LOAD_S: - case OP_LOAD_FNC: + case OP_LOAD_FNC: { ed = PROG_TO_EDICT(a->edict); #ifdef PARANOID NUM_FOR_EDICT(ed); // make sure it's in range #endif - a = (eval_t *)((void *)(ed->u.i + b->_int)); + int *i = ed->u.i + b->_int; + a = (eval_t *)i; c->_int = a->_int; break; - - case OP_LOAD_V: + } + case OP_LOAD_V: { ed = PROG_TO_EDICT(a->edict); #ifdef PARANOID NUM_FOR_EDICT(ed); // make sure it's in range #endif - a = (eval_t *)((void *)(ed->u.i + b->_int)); + int *i = ed->u.i + b->_int; + a = (eval_t*)i; c->vector[0] = a->vector[0]; c->vector[1] = a->vector[1]; c->vector[2] = a->vector[2]; break; + } //================== |