summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authorCharles Pigott <charlespigott@googlemail.com>2021-01-08 10:16:18 +0000
committerGitHub <noreply@github.com>2021-01-08 11:16:18 +0100
commit9b800a96ed32720ff60b74e498a0e0a6351004f9 (patch)
tree3f287d339e15c4902ee415556475fd9b2918d33c /src/fileio.cpp
parentc1fddb9a6ae5c3af6865461a7295788a341011a2 (diff)
downloadopenttd-9b800a96ed32720ff60b74e498a0e0a6351004f9.tar.xz
Codechange: Remove min/max functions in favour of STL variants (#8502)
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r--src/fileio.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index e49cee58d..d6dee0a3f 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -24,7 +24,6 @@
#include <pwd.h>
#endif
#include <sys/stat.h>
-#include <algorithm>
#include <array>
#include <sstream>
@@ -125,7 +124,7 @@ byte FioReadByte()
void FioSkipBytes(int n)
{
for (;;) {
- int m = min(_fio.buffer_end - _fio.buffer, n);
+ int m = std::min<int>(_fio.buffer_end - _fio.buffer, n);
_fio.buffer += m;
n -= m;
if (n == 0) break;
@@ -892,7 +891,7 @@ bool ExtractTar(const std::string &tar_filename, Subdirectory subdir)
char buffer[4096];
size_t read;
for (; to_copy != 0; to_copy -= read) {
- read = fread(buffer, 1, min(to_copy, lengthof(buffer)), in.get());
+ read = fread(buffer, 1, std::min(to_copy, lengthof(buffer)), in.get());
if (read <= 0 || fwrite(buffer, 1, read, out.get()) != read) break;
}