From 7f024debfd1260bcb62ad9486a229de768989310 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 19 Aug 2023 15:46:10 +0200 Subject: [PATCH] - clean up includes in 3 files. --- src/common/filesystem/file_whres.cpp | 13 +------------ src/common/filesystem/files.cpp | 2 -- src/common/filesystem/resourcefile.cpp | 8 ++++---- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/common/filesystem/file_whres.cpp b/src/common/filesystem/file_whres.cpp index e11ce1b73..d7149f116 100644 --- a/src/common/filesystem/file_whres.cpp +++ b/src/common/filesystem/file_whres.cpp @@ -39,18 +39,9 @@ using namespace fs_private; -#include "fs_swap.h" - -using namespace fs_private; //========================================================================== // -// -// -//========================================================================== - -//========================================================================== -// -// Wad file +// WH resource file // //========================================================================== @@ -65,9 +56,7 @@ public: //========================================================================== // -// FWadFile::FWadFile // -// Initializes a WAD file // //========================================================================== diff --git a/src/common/filesystem/files.cpp b/src/common/filesystem/files.cpp index cd81580e6..89983d87c 100644 --- a/src/common/filesystem/files.cpp +++ b/src/common/filesystem/files.cpp @@ -38,8 +38,6 @@ using namespace fs_private; -using namespace fs_private; - #ifdef _WIN32 std::wstring toWide(const char* str); #endif diff --git a/src/common/filesystem/resourcefile.cpp b/src/common/filesystem/resourcefile.cpp index d3fa686b7..a900c275c 100644 --- a/src/common/filesystem/resourcefile.cpp +++ b/src/common/filesystem/resourcefile.cpp @@ -36,9 +36,8 @@ #include #include "resourcefile.h" -#include "cmdlib.h" -#include "md5.h" +#include "md5.h" std::string ExtractBaseName(const char* path, bool include_extension) { @@ -290,9 +289,10 @@ static int nulPrintf(FSMessageLevel msg, const char* fmt, ...) FResourceFile *FResourceFile::DoOpenResourceFile(const char *filename, FileReader &file, bool containeronly, LumpFilterInfo* filter, FileSystemMessageFunc Printf) { if (Printf == nullptr) Printf = nulPrintf; - for(size_t i = 0; i < countof(funcs) - containeronly; i++) + for(auto func : funcs) { - FResourceFile *resfile = funcs[i](filename, file, filter, Printf); + if (containeronly && func == CheckLump) break; + FResourceFile *resfile = func(filename, file, filter, Printf); if (resfile != NULL) return resfile; } return NULL;