From a35bd3677f3848939e821505158a7dde8f2a7407 Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Mon, 8 Oct 2012 23:48:11 -0300 Subject: Add missing 'virtual' annotation to ReadFile() override. Signed-off-by: Thiago Farina --- src/metrics.h | 7 ++----- src/ninja.cc | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/metrics.h b/src/metrics.h index a4ef9f7..044011d 100644 --- a/src/metrics.h +++ b/src/metrics.h @@ -62,12 +62,10 @@ private: /// Epoch varies between platforms; only useful for measuring elapsed time. int64_t GetTimeMillis(); - /// A simple stopwatch which returns the time /// in seconds since Restart() was called. -class Stopwatch -{ -public: +class Stopwatch { + public: Stopwatch() : started_(0) {} /// Seconds since Restart() call. @@ -80,7 +78,6 @@ private: uint64_t Now() const; }; - /// The primary interface to metrics. Use METRIC_RECORD("foobar") at the top /// of a function to get timing stats recorded for each call of the function. #define METRIC_RECORD(name) \ diff --git a/src/ninja.cc b/src/ninja.cc index 76b2764..e408ce1 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -140,7 +140,7 @@ int GuessParallelism() { /// An implementation of ManifestParser::FileReader that actually reads /// the file. struct RealFileReader : public ManifestParser::FileReader { - bool ReadFile(const string& path, string* content, string* err) { + virtual bool ReadFile(const string& path, string* content, string* err) { return ::ReadFile(path, content, err) == 0; } }; -- cgit v0.12