From 8c0925dd5dcc456f3e5d6b7686ccbbc3e8ba544e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Mar 2018 22:05:28 +0100 Subject: [PATCH] - fixed some compile errors which were only reported on GCC/Clang. --- src/resourcefiles/resourcefile.cpp | 18 ++++++++++++------ src/resourcefiles/resourcefile.h | 7 +++---- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/resourcefiles/resourcefile.cpp b/src/resourcefiles/resourcefile.cpp index 0a3b89916..17c7e8739 100644 --- a/src/resourcefiles/resourcefile.cpp +++ b/src/resourcefiles/resourcefile.cpp @@ -323,13 +323,17 @@ FResourceFile *FResourceFile::OpenDirectory(const char *filename, bool quiet) // //========================================================================== -FResourceFile::FResourceFile(const char *filename, FileReader &r) +FResourceFile::FResourceFile(const char *filename) { if (filename != NULL) Filename = copystring(filename); else Filename = NULL; - Reader = std::move(r); } +FResourceFile::FResourceFile(const char *filename, FileReader &r) + : FResourceFile(filename) +{ + Reader = std::move(r); +} FResourceFile::~FResourceFile() { @@ -642,11 +646,13 @@ int FUncompressedLump::FillCache() // //========================================================================== +FUncompressedFile::FUncompressedFile(const char *filename) +: FResourceFile(filename) +{} + FUncompressedFile::FUncompressedFile(const char *filename, FileReader &r) -: FResourceFile(filename, r) -{ - Lumps = NULL; -} + : FResourceFile(filename, r) +{} FUncompressedFile::~FUncompressedFile() { diff --git a/src/resourcefiles/resourcefile.h b/src/resourcefiles/resourcefile.h index 50dfaefec..3d8d8fe45 100644 --- a/src/resourcefiles/resourcefile.h +++ b/src/resourcefiles/resourcefile.h @@ -86,6 +86,7 @@ public: protected: uint32_t NumLumps; + FResourceFile(const char *filename); FResourceFile(const char *filename, FileReader &r); // for archives that can contain directories @@ -131,14 +132,12 @@ struct FUncompressedLump : public FResourceLump class FUncompressedFile : public FResourceFile { protected: - FUncompressedLump * Lumps; - + FUncompressedLump * Lumps = nullptr; + FUncompressedFile(const char *filename); FUncompressedFile(const char *filename, FileReader &r); virtual ~FUncompressedFile(); virtual FResourceLump *GetLump(int no) { return ((unsigned)no < NumLumps)? &Lumps[no] : NULL; } - -public: };