- replaced MIN/MAX in common code.

This commit is contained in:
Christoph Oelckers 2021-10-30 10:46:17 +02:00
commit eb69bbcae0
63 changed files with 200 additions and 236 deletions

View file

@ -644,7 +644,7 @@ void ProcessMouseButtonEvent(NSEvent* theEvent)
break;
}
event.data1 = MIN(KEY_MOUSE1 + [theEvent buttonNumber], NSInteger(KEY_MOUSE8));
event.data1 = min(KEY_MOUSE1 + [theEvent buttonNumber], NSInteger(KEY_MOUSE8));
D_PostEvent(&event);
}

View file

@ -969,7 +969,7 @@ bool I_GetVulkanPlatformExtensions(unsigned int *count, const char **names)
else
{
const bool result = *count >= extensionCount;
*count = std::min(*count, extensionCount);
*count = min(*count, extensionCount);
for (unsigned int i = 0; i < *count; ++i)
{

View file

@ -510,7 +510,7 @@ void FConsoleWindow::NetProgress(const int count)
if (m_netMaxPos > 1)
{
[m_netCountText setStringValue:[NSString stringWithFormat:@"%d / %d", m_netCurPos, m_netMaxPos]];
[m_netProgressBar setDoubleValue:MIN(m_netCurPos, m_netMaxPos)];
[m_netProgressBar setDoubleValue:min(m_netCurPos, m_netMaxPos)];
}
}

View file

@ -66,7 +66,7 @@ static inline char *strlwr(char *str)
}
inline int I_GetNumaNodeCount() { return 1; }
inline int I_GetNumaNodeThreadCount(int numaNode) { return std::max<int>(std::thread::hardware_concurrency(), 1); }
inline int I_GetNumaNodeThreadCount(int numaNode) { return max<int>(std::thread::hardware_concurrency(), 1); }
inline void I_SetThreadNumaNode(std::thread &thread, int numaNode) { }
#endif

View file

@ -778,7 +778,7 @@ static HCURSOR CreateAlphaCursor(FBitmap &source, int leftofs, int topofs)
// Find closest integer scale factor for the monitor DPI
HDC screenDC = GetDC(0);
int dpi = GetDeviceCaps(screenDC, LOGPIXELSX);
int scale = std::max((dpi + 96 / 2 - 1) / 96, 1);
int scale = max((dpi + 96 / 2 - 1) / 96, 1);
ReleaseDC(0, screenDC);
memset(&bi, 0, sizeof(bi));

View file

@ -351,7 +351,7 @@ void FBasicStartupScreen :: NetProgress(int count)
mysnprintf (buf, countof(buf), "%d/%d", NetCurPos, NetMaxPos);
SetDlgItemTextA (NetStartPane, IDC_NETSTARTCOUNT, buf);
SendDlgItemMessage (NetStartPane, IDC_NETSTARTPROGRESS, PBM_SETPOS, std::min(NetCurPos, NetMaxPos), 0);
SendDlgItemMessage (NetStartPane, IDC_NETSTARTPROGRESS, PBM_SETPOS, min(NetCurPos, NetMaxPos), 0);
}
}

View file

@ -831,7 +831,7 @@ void FStrifeStartupScreen::DrawStuff(int old_laser, int new_laser)
ST_LASERSPACE_X + new_laser, ST_LASERSPACE_Y, ST_LASER_WIDTH, ST_LASER_HEIGHT);
// The bot jumps up and down like crazy.
y = std::max(0, (new_laser >> 1) % 5 - 2);
y = max(0, (new_laser >> 1) % 5 - 2);
if (y > 0)
{
ST_Util_ClearBlock(bitmap_info, 0xF0, ST_BOT_X, ST_BOT_Y, ST_BOT_WIDTH, y);