- replaced MIN/MAX in all non-common code.

This commit is contained in:
Christoph Oelckers 2021-10-30 10:16:52 +02:00
commit 1d0aed219e
43 changed files with 147 additions and 146 deletions

View file

@ -2454,7 +2454,7 @@ bool FBehavior::Init(FLevelLocals *Level, int lumpnum, FileReader * fr, int len,
// Use unsigned iterator here to avoid issue with GCC 4.9/5.x
// optimizer. Might be some undefined behavior in this code,
// but I don't know what it is.
unsigned int initsize = MIN<unsigned int> (ArrayStore[arraynum].ArraySize, (LittleLong(chunk[1])-4)/4);
unsigned int initsize = min<unsigned int> (ArrayStore[arraynum].ArraySize, (LittleLong(chunk[1])-4)/4);
int32_t *elems = ArrayStore[arraynum].Elements;
for (unsigned int j = 0; j < initsize; ++j)
{
@ -2532,7 +2532,7 @@ bool FBehavior::Init(FLevelLocals *Level, int lumpnum, FileReader * fr, int len,
{
int32_t *elems = ArrayStore[arraynum].Elements;
// Ending zeros may be left out.
for (int j = MIN(LittleLong(chunk[1])-5, ArrayStore[arraynum].ArraySize); j > 0; --j, ++elems, ++chunkData)
for (int j = min(LittleLong(chunk[1])-5, ArrayStore[arraynum].ArraySize); j > 0; --j, ++elems, ++chunkData)
{
// For ATAG, a value of 0 = Integer, 1 = String, 2 = FunctionPtr
// Our implementation uses the same tags for both String and FunctionPtr
@ -10309,7 +10309,7 @@ DLevelScript::DLevelScript (FLevelLocals *l, AActor *who, line_t *where, int num
assert(code->VarCount >= code->ArgCount);
Localvars.Resize(code->VarCount);
memset(&Localvars[0], 0, code->VarCount * sizeof(int32_t));
for (int i = 0; i < MIN<int>(argcount, code->ArgCount); ++i)
for (int i = 0; i < min<int>(argcount, code->ArgCount); ++i)
{
Localvars[i] = args[i];
}