summaryrefslogtreecommitdiffstats
path: root/src/build_log.cc
diff options
context:
space:
mode:
authorThiago Farina <tfarina@chromium.org>2011-12-20 21:53:31 (GMT)
committerThiago Farina <tfarina@chromium.org>2011-12-20 21:53:31 (GMT)
commitc33b19887e6b690ed18c42070bf2f0498b47f915 (patch)
tree9fd3342ce9c41ef3c5761528f01facc66e9ebaec /src/build_log.cc
parent2f2ea98a267c75eec0179cbd34ce227a2f2f2db6 (diff)
downloadNinja-c33b19887e6b690ed18c42070bf2f0498b47f915.zip
Ninja-c33b19887e6b690ed18c42070bf2f0498b47f915.tar.gz
Ninja-c33b19887e6b690ed18c42070bf2f0498b47f915.tar.bz2
Protect BuildLog data member variables by making them private.
They are not accessed outside of BuildLog and there is even a SetConfig function to set the |config_| variable. So better to make them private to BuildLog now while nobody is using it outside. Signed-off-by: Thiago Farina <tfarina@chromium.org>
Diffstat (limited to 'src/build_log.cc')
-rw-r--r--src/build_log.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/build_log.cc b/src/build_log.cc
index 852a9d0..e3e96e5 100644
--- a/src/build_log.cc
+++ b/src/build_log.cc
@@ -35,11 +35,15 @@ namespace {
const char kFileSignature[] = "# ninja log v%d\n";
const int kCurrentVersion = 3;
-}
+} // namespace
BuildLog::BuildLog()
: log_file_(NULL), config_(NULL), needs_recompaction_(false) {}
+BuildLog::~BuildLog() {
+ Close();
+}
+
bool BuildLog::OpenForWrite(const string& path, string* err) {
if (config_ && config_->dry_run)
return true; // Do nothing, report success.
@@ -144,7 +148,7 @@ bool BuildLog::Load(const string& path, string* err) {
end_time = atoi(start);
start = end + 1;
}
-
+
if (log_version >= 3) {
// In v3 we log the restat mtime.
char* end = strchr(start, ' ');