From 3b0e200e4fd10e0d70273261b8ea66ba8679079a Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Thu, 25 Apr 2013 14:16:27 +1000 Subject: [PATCH] add some casts so gcc can pick an overloaded abs/max/min func --- codemp/client/FxScheduler.cpp | 2 +- codemp/client/cl_cin.cpp | 2 +- codemp/client/cl_input.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/codemp/client/FxScheduler.cpp b/codemp/client/FxScheduler.cpp index 1bb9589..b89af91 100644 --- a/codemp/client/FxScheduler.cpp +++ b/codemp/client/FxScheduler.cpp @@ -904,7 +904,7 @@ void CFxScheduler::PlayEffect( int id, vec3_t origin, vec3_t axis[3], const int if ( prim->mSpawnFlags & FX_EVEN_DISTRIBUTION ) { - factor = abs(prim->mSpawnDelay.GetMax() - prim->mSpawnDelay.GetMin()) / (float)count; + factor = abs((long)(prim->mSpawnDelay.GetMax() - prim->mSpawnDelay.GetMin())) / (float)count; } // Schedule the random number of bits diff --git a/codemp/client/cl_cin.cpp b/codemp/client/cl_cin.cpp index 2777166..fe951d8 100644 --- a/codemp/client/cl_cin.cpp +++ b/codemp/client/cl_cin.cpp @@ -1194,7 +1194,7 @@ e_status CIN_RunCinematic (int handle) } thisTime = Sys_Milliseconds()*com_timescale->value; - if (cinTable[currentHandle].shader && (abs(thisTime - cinTable[currentHandle].lastTime))>100) { + if (cinTable[currentHandle].shader && (abs((long)(thisTime - cinTable[currentHandle].lastTime)))>100) { cinTable[currentHandle].startTime += thisTime - cinTable[currentHandle].lastTime; } cinTable[currentHandle].tfps = ((((Sys_Milliseconds()*com_timescale->value) - cinTable[currentHandle].startTime)*cinTable[currentHandle].roqFPS)/1000); diff --git a/codemp/client/cl_input.cpp b/codemp/client/cl_input.cpp index 6fc32b2..e420efb 100644 --- a/codemp/client/cl_input.cpp +++ b/codemp/client/cl_input.cpp @@ -1471,10 +1471,10 @@ usercmd_t CL_CreateCmd( void ) { // draw debug graphs of turning for mouse testing if ( cl_debugMove->integer ) { if ( cl_debugMove->integer == 1 ) { - SCR_DebugGraph( abs(cl.viewangles[YAW] - oldAngles[YAW]), 0 ); + SCR_DebugGraph( abs((long)(cl.viewangles[YAW] - oldAngles[YAW])), 0 ); } if ( cl_debugMove->integer == 2 ) { - SCR_DebugGraph( abs(cl.viewangles[PITCH] - oldAngles[PITCH]), 0 ); + SCR_DebugGraph( abs((long)(cl.viewangles[PITCH] - oldAngles[PITCH])), 0 ); } }