Changeset - r27406:daa0925e7b86
[Not reviewed]
master
0 4 0
Rubidium - 13 months ago 2023-05-21 06:21:40
rubidium@openttd.org
Codechange: replace puts with fmt::print
4 files changed with 8 insertions and 9 deletions:
0 comments (0 inline, 0 general)
src/debug.cpp
Show inline comments
 
@@ -138,8 +138,7 @@ void DebugPrint(const char *level, const
 
		fflush(f);
 
#endif
 
	} else {
 
		std::string msg = fmt::format("{}dbg: [{}] {}\n", GetLogPrefix(), level, message);
 
		fputs(msg.c_str(), stderr);
 
		fmt::print(stderr, "{}dbg: [{}] {}\n", GetLogPrefix(), level, message);
 

	
 
		if (_debug_remote_console.load()) {
 
			/* Only add to the queue when there is at least one consumer of the data. */
src/newgrf_profiling.cpp
Show inline comments
 
@@ -109,9 +109,9 @@ uint32 NewGRFProfiler::Finish()
 

	
 
	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) {
 
		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;
 
	}
 

	
src/settingsgen/settingsgen.cpp
Show inline comments
 
@@ -456,11 +456,11 @@ int CDECL main(int argc, char *argv[])
 

	
 
		switch (i) {
 
			case 'v':
 
				puts("$Revision$");
 
				fmt::print("$Revision$\n");
 
				return 0;
 

	
 
			case 'h':
 
				puts("settingsgen - $Revision$\n"
 
				fmt::print("settingsgen - $Revision$\n"
 
						"Usage: settingsgen [options] ini-file...\n"
 
						"with options:\n"
 
						"   -v, --version           Print version information and exit\n"
src/strgen/strgen.cpp
Show inline comments
 
@@ -423,7 +423,7 @@ int CDECL main(int argc, char *argv[])
 

	
 
		switch (i) {
 
			case 'v':
 
				puts("$Revision$");
 
				fmt::print("$Revision$\n");
 
				return 0;
 

	
 
			case 'C':
 
@@ -467,7 +467,7 @@ int CDECL main(int argc, char *argv[])
 
				break;
 

	
 
			case 'h':
 
				puts(
 
				fmt::print(
 
					"strgen - $Revision$\n"
 
					" -v | --version    print version information and exit\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"
 
					" 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"
 
					" 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;
 

	
0 comments (0 inline, 0 general)