add some casts so gcc can pick an overloaded abs/max/min func

This commit is contained in:
Jonathan Gray 2013-04-22 19:43:09 +10:00
parent f0407a8d59
commit e915f8920d
6 changed files with 12 additions and 12 deletions

View file

@ -745,7 +745,7 @@ void CFxScheduler::PlayEffect( const char *file, int clientID )
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
@ -1035,7 +1035,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

View file

@ -586,7 +586,7 @@ qboolean CG_Credits_Draw( void )
int iYpos = SCREEN_HEIGHT + (CreditLine.iLine * iFontHeight);
iYpos-= (int) (fPixelsPerSecond * fSecondsElapsed);
int iTextLinesThisItem = max(CreditLine.vstrText.size(),1);
int iTextLinesThisItem = max((int)CreditLine.vstrText.size(),1);
if (iYpos + (iTextLinesThisItem * iFontHeight) < 0)
{
// scrolled off top of screen, so erase it...

View file

@ -1319,7 +1319,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);

View file

@ -559,10 +559,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 );
}
}

View file

@ -287,8 +287,8 @@ void Text_PaintWithCursor(float x, float y, float scale, vec4_t color, const cha
// now print the cursor as well...
//
char sTemp[1024];
int iCopyCount = min(strlen(text), cursorPos);
iCopyCount = min(iCopyCount,sizeof(sTemp));
int iCopyCount = min((int)strlen(text), cursorPos);
iCopyCount = min(iCopyCount,(int)sizeof(sTemp));
// copy text into temp buffer for pixel measure...
//

View file

@ -1587,10 +1587,10 @@ void Menu_TransitionItemByName(menuDef_t *menu, const char *p, rectDef_t rectFro
item->window.offsetTime = time;
memcpy(&item->window.rectClient, &rectFrom, sizeof(rectDef_t));
memcpy(&item->window.rectEffects, &rectTo, sizeof(rectDef_t));
item->window.rectEffects2.x = abs(rectTo.x - rectFrom.x) / amt;
item->window.rectEffects2.y = abs(rectTo.y - rectFrom.y) / amt;
item->window.rectEffects2.w = abs(rectTo.w - rectFrom.w) / amt;
item->window.rectEffects2.h = abs(rectTo.h - rectFrom.h) / amt;
item->window.rectEffects2.x = abs((int)(rectTo.x - rectFrom.x)) / amt;
item->window.rectEffects2.y = abs((int)(rectTo.y - rectFrom.y)) / amt;
item->window.rectEffects2.w = abs((int)(rectTo.w - rectFrom.w)) / amt;
item->window.rectEffects2.h = abs((int)(rectTo.h - rectFrom.h)) / amt;
Item_UpdatePosition(item);
}
}