Codechange: Remove min/max functions in favour of STL variants (#8502)

This commit is contained in:
Charles Pigott
2021-01-08 10:16:18 +00:00
committed by GitHub
parent c1fddb9a6a
commit 9b800a96ed
181 changed files with 900 additions and 954 deletions

View File

@@ -26,7 +26,6 @@
#include "../thread.h"
#include "allegro_v.h"
#include <allegro.h>
#include <algorithm>
#include "../safeguards.h"

View File

@@ -26,7 +26,6 @@
#include <SDL.h>
#include <mutex>
#include <condition_variable>
#include <algorithm>
#ifdef __EMSCRIPTEN__
# include <emscripten.h>
# include <emscripten/html5.h>
@@ -635,8 +634,8 @@ int VideoDriver_SDL::PollEvent()
// Force a redraw of the entire screen.
_num_dirty_rects = MAX_DIRTY_RECTS + 1;
} else if (ev.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) {
int w = max(ev.window.data1, 64);
int h = max(ev.window.data2, 64);
int w = std::max(ev.window.data1, 64);
int h = std::max(ev.window.data2, 64);
CreateMainSurface(w, h, w != ev.window.data1 || h != ev.window.data2);
} else if (ev.window.event == SDL_WINDOWEVENT_ENTER) {
// mouse entered the window, enable cursor

View File

@@ -25,7 +25,6 @@
#include <SDL.h>
#include <mutex>
#include <condition_variable>
#include <algorithm>
#include "../safeguards.h"
@@ -583,8 +582,8 @@ int VideoDriver_SDL::PollEvent()
break;
case SDL_VIDEORESIZE: {
int w = max(ev.resize.w, 64);
int h = max(ev.resize.h, 64);
int w = std::max(ev.resize.w, 64);
int h = std::max(ev.resize.h, 64);
CreateMainSurface(w, h);
break;
}

View File

@@ -27,7 +27,6 @@
#include <imm.h>
#include <mutex>
#include <condition_variable>
#include <algorithm>
#include "../safeguards.h"
@@ -903,8 +902,8 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
w = r->right - r->left - (r2.right - r2.left);
h = r->bottom - r->top - (r2.bottom - r2.top);
w = max(w, 64);
h = max(h, 64);
w = std::max(w, 64);
h = std::max(h, 64);
SetRect(&r2, 0, 0, w, h);
AdjustWindowRect(&r2, GetWindowLong(hwnd, GWL_STYLE), FALSE);
@@ -1037,8 +1036,8 @@ static bool AllocateDibSection(int w, int h, bool force)
HDC dc;
uint bpp = BlitterFactory::GetCurrentBlitter()->GetScreenDepth();
w = max(w, 64);
h = max(h, 64);
w = std::max(w, 64);
h = std::max(h, 64);
if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals");