diff --git a/src/build_log.cc b/src/build_log.cc index 073d2fe81e..4d6ee2823a 100644 --- a/src/build_log.cc +++ b/src/build_log.cc @@ -72,8 +72,7 @@ BuildLog::LogEntry::LogEntry(const string& output, uint64_t command_hash, start_time(start_time), end_time(end_time), mtime(mtime) {} -BuildLog::BuildLog() - : log_file_(NULL), needs_recompaction_(false) {} +BuildLog::BuildLog() = default; BuildLog::~BuildLog() { Close(); diff --git a/src/build_log.h b/src/build_log.h index 1223c2a16a..36f3846d3c 100644 --- a/src/build_log.h +++ b/src/build_log.h @@ -57,10 +57,10 @@ struct BuildLog { struct LogEntry { std::string output; - uint64_t command_hash; - int start_time; - int end_time; - TimeStamp mtime; + uint64_t command_hash = 0; + int start_time = 0; + int end_time = 0; + TimeStamp mtime = 0; static uint64_t HashCommand(StringPiece command); @@ -99,9 +99,9 @@ struct BuildLog { bool OpenForWriteIfNeeded(); Entries entries_; - FILE* log_file_; + FILE* log_file_ = nullptr; std::string log_file_path_; - bool needs_recompaction_; + bool needs_recompaction_ = false; }; #endif // NINJA_BUILD_LOG_H_