Split error macro into two versions (format vs non-formating) to allow format checking at compile-time

This commit is contained in:
SirLynix
2023-11-02 15:18:03 +01:00
parent 8fb53f467b
commit 4b8a475bbd
133 changed files with 570 additions and 557 deletions

View File

@@ -16,7 +16,7 @@ namespace Nz
File file(sourcePath);
if (!file.Open(OpenMode::ReadOnly | OpenMode::Text))
{
NazaraError("Failed to open \"{0}\"", sourcePath);
NazaraErrorFmt("failed to open \"{0}\"", sourcePath);
return {};
}
@@ -25,7 +25,7 @@ namespace Nz
std::vector<Nz::UInt8> source(length);
if (file.Read(&source[0], length) != length)
{
NazaraError("Failed to read program file");
NazaraError("failed to read program file");
return {};
}

View File

@@ -189,7 +189,7 @@ namespace Nz
#endif
if (!impl || !impl->Prepare(config))
{
NazaraError("Failed to create renderer implementation");
NazaraError("failed to create renderer implementation");
continue;
}
@@ -235,7 +235,7 @@ namespace Nz
if (auto it = renderAPIStr.find(value); it != renderAPIStr.end())
preferredAPI = it->second;
else
NazaraError("unknown render API \"{0}\"", value);
NazaraErrorFmt("unknown render API \"{0}\"", value);
}
if (parameters.GetParameter("render-api-validation", &value))
@@ -251,7 +251,7 @@ namespace Nz
if (auto it = validationStr.find(value); it != validationStr.end())
validationLevel = it->second;
else
NazaraError("unknown validation level \"{0}\"", value);
NazaraErrorFmt("unknown validation level \"{0}\"", value);
}
}
}