From: divverent Date: Wed, 8 Jan 2014 16:01:58 +0000 (+0000) Subject: Use PreError() for warnings too. Simpler code! X-Git-Tag: xonotic-v0.8.0~90 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ec13c09e8a30ebcf47c9bedccd07feed3fbabb53;p=xonotic%2Fdarkplaces.git Use PreError() for warnings too. Simpler code! git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12045 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=a98016316992f6daad635aba23295bee1ebeb3fb --- diff --git a/prvm_execprogram.h b/prvm_execprogram.h index 5e94073d..3e3ceef0 100644 --- a/prvm_execprogram.h +++ b/prvm_execprogram.h @@ -3,11 +3,14 @@ prog->xstatement = st - cached_statements; \ tm = Sys_DirtyTime(); \ prog->xfunction->profile += (st - startst); \ - prog->xfunction->tprofile += (tm - starttm >= 0 && tm - starttm < 1800) ? (tm - starttm) : 0; + prog->xfunction->tprofile += (tm - starttm >= 0 && tm - starttm < 1800) ? (tm - starttm) : 0; \ + startst = st; \ + starttm = tm #else #define PreError() \ prog->xstatement = st - cached_statements; \ - prog->xfunction->profile += (st - startst); + prog->xfunction->profile += (st - startst); \ + startst = st #endif // This code isn't #ifdef/#define protectable, don't try. @@ -188,9 +191,7 @@ { if (developer.integer) { - prog->xfunction->profile += (st - startst); - startst = st; - prog->xstatement = st - cached_statements; + PreError(); VM_Warning(prog, "Attempted division by zero in %s\n", prog->name ); } OPC->_float = 0.0f; @@ -295,7 +296,7 @@ } if ((prvm_uint_t)OPB->_int < cached_entityfields && !cached_allowworldwrites) { - prog->xstatement = st - cached_statements; + PreError(); VM_Warning(prog, "assignment to world.%s (field %i) in %s\n", PRVM_GetString(prog, PRVM_ED_FieldAtOfs(prog, OPB->_int)->s_name), (int)OPB->_int, prog->name); } } @@ -313,7 +314,7 @@ } if ((prvm_uint_t)OPB->_int < cached_entityfields && !cached_allowworldwrites) { - prog->xstatement = st - cached_statements; + PreError(); VM_Warning(prog, "assignment to world.%s (field %i) in %s\n", PRVM_GetString(prog, PRVM_ED_FieldAtOfs(prog, OPB->_int)->s_name), (int)OPB->_int, prog->name); } }