From befb8be391543f4fadcc4f49aa48d219368e25a9 Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 2 Oct 2021 16:19:10 +0200 Subject: Replaced min max macros with std ones --- Stars45/ComboList.cpp | 6 +++++- Stars45/Drive.cpp | 6 +++++- Stars45/ExceptionHandler.cpp | 5 ++++- 3 files changed, 14 insertions(+), 3 deletions(-) (limited to 'Stars45') diff --git a/Stars45/ComboList.cpp b/Stars45/ComboList.cpp index 4bf35cc..d070b9f 100644 --- a/Stars45/ComboList.cpp +++ b/Stars45/ComboList.cpp @@ -36,6 +36,10 @@ Drop-down list of Buttons class */ +#define NOMINMAX + +#include + #include "MemDebug.h" #include "ComboList.h" #include "ComboBox.h" @@ -168,7 +172,7 @@ ComboList::Draw() // opening: if (scrolling > 0) { - int limit = min(items.size(), max_entries); + int limit = std::min(items.size(), max_entries); if (scroll < limit) { if (limit > 6) diff --git a/Stars45/Drive.cpp b/Stars45/Drive.cpp index 8cf6dd0..570721d 100644 --- a/Stars45/Drive.cpp +++ b/Stars45/Drive.cpp @@ -36,6 +36,10 @@ Weapon class */ +#define NOMINMAX + +#include + #include "MemDebug.h" #include "Drive.h" #include "Power.h" @@ -355,7 +359,7 @@ Drive::GetRequest(double seconds) const { if (!power_on) return 0; - double t_factor = max(throttle + 0.5 * augmenter_throttle, 0.3); + double t_factor = std::max(throttle + 0.5 * augmenter_throttle, 0.3); return t_factor * power_level * sink_rate * seconds; } diff --git a/Stars45/ExceptionHandler.cpp b/Stars45/ExceptionHandler.cpp index 17519be..6233b7a 100644 --- a/Stars45/ExceptionHandler.cpp +++ b/Stars45/ExceptionHandler.cpp @@ -32,6 +32,9 @@ */ +#define NOMINMAX + +#include #include #include @@ -265,7 +268,7 @@ ExceptionHandler::GetLogicalAddress(void* addr, char* mod_name, int len, DWORD& for (unsigned i = 0; i < pNtHdr->FileHeader.NumberOfSections; i++, pSection++ ) { DWORD sectionStart = pSection->VirtualAddress; DWORD sectionEnd = sectionStart - + max(pSection->SizeOfRawData, pSection->Misc.VirtualSize); + + std::max(pSection->SizeOfRawData, pSection->Misc.VirtualSize); // Is the address in this section??? if ((rva >= sectionStart) && (rva <= sectionEnd)) { -- cgit v1.1