- replaced MIN/MAX in all non-common code.
This commit is contained in:
parent
226666ce7f
commit
1d0aed219e
43 changed files with 147 additions and 146 deletions
|
|
@ -222,7 +222,7 @@ static struct TicSpecial
|
|||
{
|
||||
int i;
|
||||
|
||||
specialsize = MAX(specialsize * 2, needed + 30);
|
||||
specialsize = max(specialsize * 2, needed + 30);
|
||||
|
||||
DPrintf (DMSG_NOTIFY, "Expanding special size to %zu\n", specialsize);
|
||||
|
||||
|
|
@ -1151,7 +1151,7 @@ void NetUpdate (void)
|
|||
netbuffer[k++] = lowtic;
|
||||
}
|
||||
|
||||
numtics = MAX(0, lowtic - realstart);
|
||||
numtics = max(0, lowtic - realstart);
|
||||
if (numtics > BACKUPTICS)
|
||||
I_Error ("NetUpdate: Node %d missed too many tics", i);
|
||||
|
||||
|
|
@ -1160,7 +1160,7 @@ void NetUpdate (void)
|
|||
case 0:
|
||||
default:
|
||||
resendto[i] = lowtic; break;
|
||||
case 1: resendto[i] = MAX(0, lowtic - 1); break;
|
||||
case 1: resendto[i] = max(0, lowtic - 1); break;
|
||||
case 2: resendto[i] = nettics[i]; break;
|
||||
}
|
||||
|
||||
|
|
@ -1836,7 +1836,7 @@ static void TicStabilityEnd()
|
|||
{
|
||||
using namespace std::chrono;
|
||||
uint64_t stabilityendtime = duration_cast<microseconds>(steady_clock::now().time_since_epoch()).count();
|
||||
stabilityticduration = std::min(stabilityendtime - stabilitystarttime, (uint64_t)1'000'000);
|
||||
stabilityticduration = min(stabilityendtime - stabilitystarttime, (uint64_t)1'000'000);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
@ -2750,7 +2750,7 @@ static void RunScript(uint8_t **stream, AActor *pawn, int snum, int argn, int al
|
|||
arg[i] = argval;
|
||||
}
|
||||
}
|
||||
P_StartScript(pawn->Level, pawn, NULL, snum, primaryLevel->MapName, arg, MIN<int>(countof(arg), argn), ACS_NET | always);
|
||||
P_StartScript(pawn->Level, pawn, NULL, snum, primaryLevel->MapName, arg, min<int>(countof(arg), argn), ACS_NET | always);
|
||||
}
|
||||
|
||||
void Net_SkipCommand (int type, uint8_t **stream)
|
||||
|
|
@ -2913,15 +2913,15 @@ int Net_GetLatency(int *ld, int *ad)
|
|||
localdelay = ((localdelay / BACKUPTICS) * ticdup) * (1000 / TICRATE);
|
||||
int severity = 0;
|
||||
|
||||
if (MAX(localdelay, arbitratordelay) > 200)
|
||||
if (max(localdelay, arbitratordelay) > 200)
|
||||
{
|
||||
severity = 1;
|
||||
}
|
||||
if (MAX(localdelay, arbitratordelay) > 400)
|
||||
if (max(localdelay, arbitratordelay) > 400)
|
||||
{
|
||||
severity = 2;
|
||||
}
|
||||
if (MAX(localdelay, arbitratordelay) >= ((BACKUPTICS / 2 - 1) * ticdup) * (1000 / TICRATE))
|
||||
if (max(localdelay, arbitratordelay) >= ((BACKUPTICS / 2 - 1) * ticdup) * (1000 / TICRATE))
|
||||
{
|
||||
severity = 3;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue