backend update from Raze

* moving large allocations off the stack
* use proper printf formatters for size_t and ptrdiff_t.
* adding some missing 'noexcept'.
This commit is contained in:
Christoph Oelckers 2024-01-06 15:24:10 +01:00
commit 83aa9388ca
29 changed files with 117 additions and 109 deletions

View file

@ -154,20 +154,20 @@ protected:
std::vector<LumpRecord> FileInfo;
std::vector<uint32_t> Hashes; // one allocation for all hash lists.
uint32_t *FirstLumpIndex; // [RH] Hashing stuff moved out of lumpinfo structure
uint32_t *NextLumpIndex;
uint32_t *FirstLumpIndex = nullptr; // [RH] Hashing stuff moved out of lumpinfo structure
uint32_t *NextLumpIndex = nullptr;
uint32_t *FirstLumpIndex_FullName; // The same information for fully qualified paths from .zips
uint32_t *NextLumpIndex_FullName;
uint32_t *FirstLumpIndex_FullName = nullptr; // The same information for fully qualified paths from .zips
uint32_t *NextLumpIndex_FullName = nullptr;
uint32_t *FirstLumpIndex_NoExt; // The same information for fully qualified paths from .zips
uint32_t *NextLumpIndex_NoExt;
uint32_t *FirstLumpIndex_NoExt = nullptr; // The same information for fully qualified paths from .zips
uint32_t *NextLumpIndex_NoExt = nullptr;
uint32_t* FirstLumpIndex_ResId; // The same information for fully qualified paths from .zips
uint32_t* NextLumpIndex_ResId;
uint32_t* FirstLumpIndex_ResId = nullptr; // The same information for fully qualified paths from .zips
uint32_t* NextLumpIndex_ResId = nullptr;
uint32_t NumEntries = 0; // Not necessarily the same as FileInfo.Size()
uint32_t NumWads;
uint32_t NumWads = 0;
int IwadIndex = -1;
int MaxIwadIndex = -1;

View file

@ -177,7 +177,7 @@ public:
int GetEntryNamespace(uint32_t entry)
{
return (entry < NumLumps) ? Entries[entry].Namespace : ns_hidden;
return (entry < NumLumps) ? Entries[entry].Namespace : (int)ns_hidden;
}
int GetEntryResourceID(uint32_t entry)