diff --git a/src/common/filesystem/file_zip.cpp b/src/common/filesystem/file_zip.cpp index 83427161e..492a24276 100644 --- a/src/common/filesystem/file_zip.cpp +++ b/src/common/filesystem/file_zip.cpp @@ -36,10 +36,7 @@ #include #include #include "file_zip.h" -#include "cmdlib.h" - #include "w_zip.h" - #include "ancientzip.h" #include "fs_findfile.h" #include "fs_swap.h" diff --git a/src/common/filesystem/files.cpp b/src/common/filesystem/files.cpp index 88a66a59e..10ddd3832 100644 --- a/src/common/filesystem/files.cpp +++ b/src/common/filesystem/files.cpp @@ -329,26 +329,26 @@ char *MemoryReader::Gets(char *strbuf, int len) class MemoryArrayReader : public MemoryReader { - TArray buf; + std::vector buf; public: MemoryArrayReader(const char *buffer, long length) { if (length > 0) { - buf.Resize(length); + buf.resize(length); memcpy(&buf[0], buffer, length); } UpdateBuffer(); } - TArray &GetArray() { return buf; } + std::vector &GetArray() { return buf; } void UpdateBuffer() { - bufptr = (const char*)&buf[0]; + bufptr = (const char*)buf.data(); FilePos = 0; - Length = buf.Size(); + Length = (long)buf.size(); } }; @@ -397,7 +397,7 @@ bool FileReader::OpenMemoryArray(const void *mem, FileReader::Size length) return true; } -bool FileReader::OpenMemoryArray(std::function&)> getter) +bool FileReader::OpenMemoryArray(std::function&)> getter) { auto reader = new MemoryArrayReader(nullptr, 0); if (getter(reader->GetArray())) diff --git a/src/common/filesystem/files.h b/src/common/filesystem/files.h index eb4b202ac..f8b9f458e 100644 --- a/src/common/filesystem/files.h +++ b/src/common/filesystem/files.h @@ -41,8 +41,8 @@ #include #include #include -#include "basics.h" #include "fs_swap.h" + #include "tarray.h" class FileSystemException : public std::exception @@ -196,7 +196,7 @@ public: bool OpenFilePart(FileReader &parent, Size start, Size length); bool OpenMemory(const void *mem, Size length); // read directly from the buffer bool OpenMemoryArray(const void *mem, Size length); // read from a copy of the buffer. - bool OpenMemoryArray(std::function&)> getter); // read contents to a buffer and return a reader to it + bool OpenMemoryArray(std::function&)> getter); // read contents to a buffer and return a reader to it bool OpenDecompressor(FileReader &parent, Size length, int method, bool seekable, bool exceptions = false); // creates a decompressor stream. 'seekable' uses a buffered version so that the Seek and Tell methods can be used. Size Tell() const diff --git a/src/common/menu/savegamemanager.cpp b/src/common/menu/savegamemanager.cpp index 5dc22ec76..7e948267d 100644 --- a/src/common/menu/savegamemanager.cpp +++ b/src/common/menu/savegamemanager.cpp @@ -320,10 +320,10 @@ unsigned FSavegameManagerBase::ExtractSaveData(int index) { FileReader picreader; - picreader.OpenMemoryArray([=](TArray &array) + picreader.OpenMemoryArray([=](std::vector &array) { auto cache = pic->Lock(); - array.Resize(pic->LumpSize); + array.resize(pic->LumpSize); memcpy(&array[0], cache, pic->LumpSize); pic->Unlock(); return true; diff --git a/src/common/rendering/i_modelvertexbuffer.h b/src/common/rendering/i_modelvertexbuffer.h index f68d4e117..927fcfbf3 100644 --- a/src/common/rendering/i_modelvertexbuffer.h +++ b/src/common/rendering/i_modelvertexbuffer.h @@ -1,5 +1,6 @@ #pragma once +#include "basics.h" struct FModelVertex diff --git a/src/common/utility/cmdlib.cpp b/src/common/utility/cmdlib.cpp index f37bb6717..1e906e69c 100644 --- a/src/common/utility/cmdlib.cpp +++ b/src/common/utility/cmdlib.cpp @@ -983,7 +983,7 @@ void md5Update(FileReader& file, MD5Context& md5, unsigned len) while (len > 0) { - t = min(len, sizeof(readbuf)); + t = std::min(len, sizeof(readbuf)); len -= t; t = (long)file.Read(readbuf, t); md5.Update(readbuf, t);