Skip to content

Commit

Permalink
build_log.*: Use member default initialization.
Browse files Browse the repository at this point in the history
  • Loading branch information
digit-google committed Nov 26, 2024
1 parent 335e66d commit 4ed980b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/build_log.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
12 changes: 6 additions & 6 deletions src/build_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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_

0 comments on commit 4ed980b

Please sign in to comment.