structs not classes.
authorThiago Farina <tfarina@chromium.org>
Sun, 19 May 2013 16:02:48 +0000 (13:02 -0300)
committerThiago Farina <tfarina@chromium.org>
Sun, 19 May 2013 16:02:48 +0000 (13:02 -0300)
For some reason that I do not, ninja prefers:

struct Foo {
  Foo();

 private:
  void Blah();
};

Rather than

class Foo {
 public:
  Foo();

 private:
  void Blah();
};

This catches the last two usages of "class" in the code base.

Signed-off-by: Thiago Farina <tfarina@chromium.org>
src/line_printer.h
src/ninja_test.cc

index c292464..aea2817 100644 (file)
@@ -20,8 +20,7 @@ using namespace std;
 
 /// Prints lines of text, possibly overprinting previously printed lines
 /// if the terminal supports it.
-class LinePrinter {
- public:
+struct LinePrinter {
   LinePrinter();
 
   bool is_smart_terminal() const { return smart_terminal_; }
index 31754f2..989ea5c 100644 (file)
@@ -31,8 +31,7 @@ string StringPrintf(const char* format, ...) {
 }
 
 /// A test result printer that's less wordy than gtest's default.
-class LaconicPrinter : public testing::EmptyTestEventListener {
- public:
+struct LaconicPrinter : public testing::EmptyTestEventListener {
   LaconicPrinter() : tests_started_(0), test_count_(0), iteration_(0) {}
   virtual void OnTestProgramStart(const testing::UnitTest& unit_test) {
     test_count_ = unit_test.test_to_run_count();