From 5036c3190df4a80a441bede5517626ce1296f5e2 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Sun, 13 Jan 2013 20:36:54 +0100 Subject: [PATCH] make MUL_VF and MUL_FV friendlier for compilers --- prvm_exec.c | 1 + prvm_execprogram.h | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/prvm_exec.c b/prvm_exec.c index f2ad83ed..42eee2ec 100644 --- a/prvm_exec.c +++ b/prvm_exec.c @@ -672,6 +672,7 @@ void MVM_ExecuteProgram (prvm_prog_t *prog, func_t fnum, const char *errormessag int restorevm_tempstringsbuf_cursize; double calltime; double tm, starttm; + double tempfloat; calltime = Sys_DirtyTime(); diff --git a/prvm_execprogram.h b/prvm_execprogram.h index c787e6fe..39f2cacb 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -47,14 +47,16 @@ OPC->_float = OPA->vector[0]*OPB->vector[0] + OPA->vector[1]*OPB->vector[1] + OPA->vector[2]*OPB->vector[2]; break; case OP_MUL_FV: - OPC->vector[0] = OPA->_float * OPB->vector[0]; - OPC->vector[1] = OPA->_float * OPB->vector[1]; - OPC->vector[2] = OPA->_float * OPB->vector[2]; + tempfloat = OPA->_float; + OPC->vector[0] = tempfloat * OPB->vector[0]; + OPC->vector[1] = tempfloat * OPB->vector[1]; + OPC->vector[2] = tempfloat * OPB->vector[2]; break; case OP_MUL_VF: - OPC->vector[0] = OPB->_float * OPA->vector[0]; - OPC->vector[1] = OPB->_float * OPA->vector[1]; - OPC->vector[2] = OPB->_float * OPA->vector[2]; + tempfloat = OPB->_float; + OPC->vector[0] = tempfloat * OPA->vector[0]; + OPC->vector[1] = tempfloat * OPA->vector[1]; + OPC->vector[2] = tempfloat * OPA->vector[2]; break; case OP_DIV_F: if( OPB->_float != 0.0f ) -- 2.39.2