From b3d63db1facc7ee9d14e211cc738f34b702de833 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Tue, 19 Jun 2012 10:31:14 -0700 Subject: switch build log to print hashes as hex Nico convinced me that it's safe to do this without revving the build log format: the old decimal values will still parse as hex (just as different numbers) and cause a superfluous rebuild. --- src/build_log.cc | 4 ++-- src/win32port.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/build_log.cc b/src/build_log.cc index 86b660f..02a9fb5 100644 --- a/src/build_log.cc +++ b/src/build_log.cc @@ -296,7 +296,7 @@ bool BuildLog::Load(const string& path, string* err) { entry->restat_mtime = restat_mtime; if (log_version >= 5) { char c = *end; *end = '\0'; - entry->command_hash = (uint64_t)strtoull(start, NULL, 10); + entry->command_hash = (uint64_t)strtoull(start, NULL, 16); *end = c; } else { entry->command_hash = LogEntry::HashCommand(StringPiece(start, @@ -332,7 +332,7 @@ BuildLog::LogEntry* BuildLog::LookupByOutput(const string& path) { } void BuildLog::WriteEntry(FILE* f, const LogEntry& entry) { - fprintf(f, "%d\t%d\t%d\t%s\t%" PRIu64 "\n", + fprintf(f, "%d\t%d\t%d\t%s\t%" PRIx64 "\n", entry.start_time, entry.end_time, entry.restat_mtime, entry.output.c_str(), entry.command_hash); } diff --git a/src/win32port.h b/src/win32port.h index 1cc8d12..8b42b38 100644 --- a/src/win32port.h +++ b/src/win32port.h @@ -23,6 +23,7 @@ typedef unsigned long long uint64_t; // printf format specifier for uint64_t, from C99. #ifndef PRIu64 #define PRIu64 "I64u" +#define PRIx64 "I64x" #endif #endif // NINJA_WIN32PORT_H_ -- cgit v0.12