Codechange: Use fmt for SlErrorCorruptFmt

This commit is contained in:
Charles Pigott
2023-04-10 14:32:37 +01:00
parent 246ba6f00a
commit 8aea13a85b
4 changed files with 50 additions and 30 deletions

View File

@@ -14,7 +14,7 @@
#include "mem_func.hpp"
#include "pool_type.hpp"
extern void NORETURN SlErrorCorruptFmt(const char *format, ...) WARN_FORMAT(1, 2);
#include "../saveload/saveload_error.hpp" // SlErrorCorruptFmt
/**
* Helper for defining the method's signature.
@@ -157,13 +157,13 @@ DEFINE_POOL_METHOD(void *)::GetNew(size_t size)
DEFINE_POOL_METHOD(void *)::GetNew(size_t size, size_t index)
{
if (index >= Tmax_size) {
SlErrorCorruptFmt("%s index " PRINTF_SIZE " out of range (" PRINTF_SIZE ")", this->name, index, Tmax_size);
SlErrorCorruptFmt("{} index {} out of range ({})", this->name, index, Tmax_size);
}
if (index >= this->size) this->ResizeFor(index);
if (this->data[index] != nullptr) {
SlErrorCorruptFmt("%s index " PRINTF_SIZE " already in use", this->name, index);
SlErrorCorruptFmt("{} index {} already in use", this->name, index);
}
return this->AllocateItem(size, index);