mirror of https://github.com/OpenTTD/OpenTTD
Codechange: replace puts with fmt::print
parent
275ebf4509
commit
411379f587
|
@ -138,8 +138,7 @@ void DebugPrint(const char *level, const std::string &message)
|
||||||
fflush(f);
|
fflush(f);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
std::string msg = fmt::format("{}dbg: [{}] {}\n", GetLogPrefix(), level, message);
|
fmt::print(stderr, "{}dbg: [{}] {}\n", GetLogPrefix(), level, message);
|
||||||
fputs(msg.c_str(), stderr);
|
|
||||||
|
|
||||||
if (_debug_remote_console.load()) {
|
if (_debug_remote_console.load()) {
|
||||||
/* Only add to the queue when there is at least one consumer of the data. */
|
/* Only add to the queue when there is at least one consumer of the data. */
|
||||||
|
|
|
@ -109,9 +109,9 @@ uint32 NewGRFProfiler::Finish()
|
||||||
|
|
||||||
uint32 total_microseconds = 0;
|
uint32 total_microseconds = 0;
|
||||||
|
|
||||||
fputs("Tick,Sprite,Feature,Item,CallbackID,Microseconds,Depth,Result\n", f);
|
fmt::print(f, "Tick,Sprite,Feature,Item,CallbackID,Microseconds,Depth,Result\n");
|
||||||
for (const Call &c : this->calls) {
|
for (const Call &c : this->calls) {
|
||||||
fputs(fmt::format("{},{},{:#X},{},{:#X},{},{},{}\n", c.tick, c.root_sprite, c.feat, c.item, (uint)c.cb, c.time, c.subs, c.result).c_str(), f);
|
fmt::print(f, "{},{},{:#X},{},{:#X},{},{},{}\n", c.tick, c.root_sprite, c.feat, c.item, (uint)c.cb, c.time, c.subs, c.result);
|
||||||
total_microseconds += c.time;
|
total_microseconds += c.time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -456,11 +456,11 @@ int CDECL main(int argc, char *argv[])
|
||||||
|
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 'v':
|
case 'v':
|
||||||
puts("$Revision$");
|
fmt::print("$Revision$\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
puts("settingsgen - $Revision$\n"
|
fmt::print("settingsgen - $Revision$\n"
|
||||||
"Usage: settingsgen [options] ini-file...\n"
|
"Usage: settingsgen [options] ini-file...\n"
|
||||||
"with options:\n"
|
"with options:\n"
|
||||||
" -v, --version Print version information and exit\n"
|
" -v, --version Print version information and exit\n"
|
||||||
|
|
|
@ -423,7 +423,7 @@ int CDECL main(int argc, char *argv[])
|
||||||
|
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case 'v':
|
case 'v':
|
||||||
puts("$Revision$");
|
fmt::print("$Revision$\n");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case 'C':
|
case 'C':
|
||||||
|
@ -467,7 +467,7 @@ int CDECL main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'h':
|
case 'h':
|
||||||
puts(
|
fmt::print(
|
||||||
"strgen - $Revision$\n"
|
"strgen - $Revision$\n"
|
||||||
" -v | --version print version information and exit\n"
|
" -v | --version print version information and exit\n"
|
||||||
" -t | --todo replace any untranslated strings with '<TODO>'\n"
|
" -t | --todo replace any untranslated strings with '<TODO>'\n"
|
||||||
|
@ -480,7 +480,7 @@ int CDECL main(int argc, char *argv[])
|
||||||
" -export-pragmas export all pragmas and exit\n"
|
" -export-pragmas export all pragmas and exit\n"
|
||||||
" Run without parameters and strgen will search for english.txt and parse it,\n"
|
" Run without parameters and strgen will search for english.txt and parse it,\n"
|
||||||
" creating strings.h. Passing an argument, strgen will translate that language\n"
|
" creating strings.h. Passing an argument, strgen will translate that language\n"
|
||||||
" file using english.txt as a reference and output <language>.lng."
|
" file using english.txt as a reference and output <language>.lng.\n"
|
||||||
);
|
);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue