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 e18c1d17b7
commit 9231cb9283
6 changed files with 20 additions and 20 deletions

View File

@ -980,7 +980,7 @@ void CFxScheduler::PlayEffect( const char *file, int clientID, bool isPortal )
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
@ -1296,7 +1296,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

@ -605,7 +605,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

@ -1323,7 +1323,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

@ -802,10 +802,10 @@ usercmd_t CL_CreateCmd( void ) {
#ifndef _XBOX
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 );
}
}
#endif

View File

@ -583,8 +583,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

@ -1787,10 +1787,10 @@ void Menu_TransitionItemByName(menuDef_t *menu, const char *p, const rectDef_t *
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);
}
}
@ -1837,17 +1837,17 @@ void Menu_Transition3ItemByName(menuDef_t *menu, const char *p, const float minx
// VectorSet(modelptr->g2maxs2, maxx, maxy, maxz);
modelptr->g2maxsEffect[0] = abs(modelptr->g2maxs2[0] - modelptr->g2maxs[0]) / amt;
modelptr->g2maxsEffect[1] = abs(modelptr->g2maxs2[1] - modelptr->g2maxs[1]) / amt;
modelptr->g2maxsEffect[2] = abs(modelptr->g2maxs2[2] - modelptr->g2maxs[2]) / amt;
modelptr->g2maxsEffect[0] = abs((long)(modelptr->g2maxs2[0] - modelptr->g2maxs[0])) / amt;
modelptr->g2maxsEffect[1] = abs((long)(modelptr->g2maxs2[1] - modelptr->g2maxs[1])) / amt;
modelptr->g2maxsEffect[2] = abs((long)(modelptr->g2maxs2[2] - modelptr->g2maxs[2])) / amt;
modelptr->g2minsEffect[0] = abs(modelptr->g2mins2[0] - modelptr->g2mins[0]) / amt;
modelptr->g2minsEffect[1] = abs(modelptr->g2mins2[1] - modelptr->g2mins[1]) / amt;
modelptr->g2minsEffect[2] = abs(modelptr->g2mins2[2] - modelptr->g2mins[2]) / amt;
modelptr->g2minsEffect[0] = abs((long)(modelptr->g2mins2[0] - modelptr->g2mins[0])) / amt;
modelptr->g2minsEffect[1] = abs((long)(modelptr->g2mins2[1] - modelptr->g2mins[1])) / amt;
modelptr->g2minsEffect[2] = abs((long)(modelptr->g2mins2[2] - modelptr->g2mins[2])) / amt;
modelptr->fov_Effectx = abs(modelptr->fov_x2 - modelptr->fov_x) / amt;
modelptr->fov_Effecty = abs(modelptr->fov_y2 - modelptr->fov_y) / amt;
modelptr->fov_Effectx = abs((long)(modelptr->fov_x2 - modelptr->fov_x)) / amt;
modelptr->fov_Effecty = abs((long)(modelptr->fov_y2 - modelptr->fov_y)) / amt;
}
}