diff --git a/Sources/Core/Debug.h b/Sources/Core/Debug.h index d1fb0f7e..6c06e437 100644 --- a/Sources/Core/Debug.h +++ b/Sources/Core/Debug.h @@ -81,7 +81,12 @@ namespace spades { std::string BacktraceRecordToString(const BacktraceRecord &); } void StartLog(); - void LogMessage(const char *file, int line, const char *format, ...); + + void LogMessage(const char *file, int line, const char *format, ...) +#ifdef __GNUC__ + __attribute__((format(printf, 3, 4))) +#endif + ; } #ifdef _MSC_VER diff --git a/Sources/Core/Strings.cpp b/Sources/Core/Strings.cpp index 922813f3..cedd3b76 100644 --- a/Sources/Core/Strings.cpp +++ b/Sources/Core/Strings.cpp @@ -1186,7 +1186,7 @@ namespace spades { if (cat == nullptr) { if (!currentLocaleRegion.empty()) { SPLog("Catalog file for the locale '%s' was not found. (domain='%s')", - domainName.c_str()); + currentLocaleRegion.c_str(), domainName.c_str()); } SPLog("Using the default locale. (domain='%s')", domainName.c_str()); } diff --git a/Sources/Draw/GLAmbientShadowRenderer.cpp b/Sources/Draw/GLAmbientShadowRenderer.cpp index 09c8a0d1..a910abb1 100644 --- a/Sources/Draw/GLAmbientShadowRenderer.cpp +++ b/Sources/Draw/GLAmbientShadowRenderer.cpp @@ -89,7 +89,7 @@ namespace spades { c.cz = z; } - SPLog("Chunk buffer allocated (%d bytes)", sizeof(Chunk) * chunkW * chunkH * chunkD); + SPLog("Chunk buffer allocated (%d bytes)", (int) sizeof(Chunk) * chunkW * chunkH * chunkD); // make texture texture = device->GenTexture(); diff --git a/Sources/Draw/GLRadiosityRenderer.cpp b/Sources/Draw/GLRadiosityRenderer.cpp index e7184513..63ea3f8b 100644 --- a/Sources/Draw/GLRadiosityRenderer.cpp +++ b/Sources/Draw/GLRadiosityRenderer.cpp @@ -109,7 +109,7 @@ namespace spades { c.cz = z; } - SPLog("Chunk buffer allocated (%d bytes)", sizeof(Chunk) * chunkW * chunkH * chunkD); + SPLog("Chunk buffer allocated (%d bytes)", (int) sizeof(Chunk) * chunkW * chunkH * chunkD); // make texture textureFlat = device->GenTexture();