mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Don't use print formatting for hardcoded strings
If the string is hardcoded, then use compile-time string literal concatenation instead. I don't know if compilers are smart enough to recognize when you're passing in hardcoded strings and to concatenate them into the string literal at compile time instead. I also don't know that if compilers are smart enough to recognize that, that further they recognize all the logging functions are just wrappers around printf, and so they can perform the same optimization at those function call sites, too. So it's better to just do the string concatenation explicitly instead.
This commit is contained in:
@@ -88,7 +88,7 @@ int32_t STEAM_init(void)
|
||||
libHandle = SDL_LoadObject(STEAM_LIBRARY);
|
||||
if (!libHandle)
|
||||
{
|
||||
vlog_info("%s not found!", STEAM_LIBRARY);
|
||||
vlog_info(STEAM_LIBRARY " not found!");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ int32_t STEAM_init(void)
|
||||
name = (rettype (*) params) SDL_LoadFunction(libHandle, #name); \
|
||||
if (!name) \
|
||||
{ \
|
||||
vlog_error("%s symbol %s not found!", STEAM_LIBRARY, #name); \
|
||||
vlog_error(STEAM_LIBRARY " symbol " #name " not found!"); \
|
||||
ClearPointers(); \
|
||||
return 0; \
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user