From 7d41c2f521e27a3c2891e6f1c8da42f0f6f3c266 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Sat, 29 Dec 2012 11:57:14 -0800 Subject: fix all "class" -> "struct" --- src/build.cc | 3 +-- src/build_log.cc | 3 +-- src/clean.h | 3 +-- src/disk_interface_test.cc | 3 +-- src/metrics.h | 8 +++++--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/build.cc b/src/build.cc index e5429cf..dcb4f45 100644 --- a/src/build.cc +++ b/src/build.cc @@ -41,8 +41,7 @@ namespace { /// A CommandRunner that doesn't actually run the commands. -class DryRunCommandRunner : public CommandRunner { - public: +struct DryRunCommandRunner : public CommandRunner { virtual ~DryRunCommandRunner() {} // Overridden from CommandRunner: diff --git a/src/build_log.cc b/src/build_log.cc index f53ccdc..6b73002 100644 --- a/src/build_log.cc +++ b/src/build_log.cc @@ -167,8 +167,7 @@ void BuildLog::Close() { log_file_ = NULL; } -class LineReader { - public: +struct LineReader { explicit LineReader(FILE* file) : file_(file), buf_end_(buf_), line_start_(buf_), line_end_(NULL) { memset(buf_, 0, sizeof(buf_)); diff --git a/src/clean.h b/src/clean.h index 5a23283..19432ab 100644 --- a/src/clean.h +++ b/src/clean.h @@ -27,8 +27,7 @@ struct Node; struct Rule; struct DiskInterface; -class Cleaner { - public: +struct Cleaner { /// Build a cleaner object with a real disk interface. Cleaner(State* state, const BuildConfig& config); diff --git a/src/disk_interface_test.cc b/src/disk_interface_test.cc index 32fe9cb..c2315c7 100644 --- a/src/disk_interface_test.cc +++ b/src/disk_interface_test.cc @@ -25,8 +25,7 @@ namespace { -class DiskInterfaceTest : public testing::Test { - public: +struct DiskInterfaceTest : public testing::Test { virtual void SetUp() { // These tests do real disk accesses, so create a temp dir. temp_dir_.CreateAndEnter("Ninja-DiskInterfaceTest"); diff --git a/src/metrics.h b/src/metrics.h index 044011d..b6da859 100644 --- a/src/metrics.h +++ b/src/metrics.h @@ -64,16 +64,18 @@ int64_t GetTimeMillis(); /// A simple stopwatch which returns the time /// in seconds since Restart() was called. -class Stopwatch { +struct Stopwatch { public: Stopwatch() : started_(0) {} /// Seconds since Restart() call. - double Elapsed() const { return 1e-6 * static_cast(Now() - started_); } + double Elapsed() const { + return 1e-6 * static_cast(Now() - started_); + } void Restart() { started_ = Now(); } -private: + private: uint64_t started_; uint64_t Now() const; }; -- cgit v0.12