From 804402e6096d5243cf8cc02957a1122df4048728 Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Wed, 4 Sep 2024 22:45:09 +0800 Subject: [PATCH 1/2] Use print format constant for int64_t values Signed-off-by: Rodrigo Tobar --- src/BuildEvents.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BuildEvents.cpp b/src/BuildEvents.cpp index ccab2a6..68ca241 100755 --- a/src/BuildEvents.cpp +++ b/src/BuildEvents.cpp @@ -15,6 +15,7 @@ #include "external/simdjson/simdjson.h" #include "external/xxHash/xxhash.h" #include +#include #include #include @@ -57,7 +58,7 @@ static void DebugPrintEvents(const BuildEvents& events, const BuildNames& names) { const BuildEvent& event = events[EventIndex(int(i))]; const std::string_view namesSubstr = names[event.detailIndex].substr(0, 130); - printf("%4zi: t=%i t1=%7lld t2=%7lld par=%4i ch=%4zi det=%.*s\n", i, (int) event.type, event.ts, event.ts+event.dur, event.parent.idx, event.children.size(), (int)namesSubstr.size(), namesSubstr.data()); + printf("%4zi: t=%i t1=%7" PRId64 " t2=%7" PRId64 " par=%4i ch=%4zi det=%.*s\n", i, (int) event.type, event.ts, event.ts+event.dur, event.parent.idx, event.children.size(), (int)namesSubstr.size(), namesSubstr.data()); } } From 888e047faa9a9d0a6316cb38cd0567522d4832ba Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Wed, 4 Sep 2024 22:52:47 +0800 Subject: [PATCH 2/2] Initialise uint32_t with integer literal Signed-off-by: Rodrigo Tobar --- src/BuildEvents.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BuildEvents.cpp b/src/BuildEvents.cpp index 68ca241..7244a5d 100755 --- a/src/BuildEvents.cpp +++ b/src/BuildEvents.cpp @@ -526,7 +526,7 @@ struct BufferedReader size_t bufferSize; }; -const uint32_t kFileMagic = 'CBA0'; +const uint32_t kFileMagic = 0x43424130; // 'CBA0' bool SaveBuildEvents(BuildEventsParser* parser, const std::string& fileName) {