summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2012-06-19 17:31:14 (GMT)
committerEvan Martin <martine@danga.com>2012-06-19 17:31:14 (GMT)
commitb3d63db1facc7ee9d14e211cc738f34b702de833 (patch)
tree1f5201433c02a407823722b80161ae1a131a44dd /src
parent350f0fc34d222ba6a45dbbf1e858a51924bf1967 (diff)
downloadNinja-b3d63db1facc7ee9d14e211cc738f34b702de833.zip
Ninja-b3d63db1facc7ee9d14e211cc738f34b702de833.tar.gz
Ninja-b3d63db1facc7ee9d14e211cc738f34b702de833.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/build_log.cc4
-rw-r--r--src/win32port.h1
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_