Skip to content

Commit

Permalink
build.cc: Add 'override' directives to virtual method overrides.
Browse files Browse the repository at this point in the history
Technically, these are not required since Ninja is built with -std=c++11,
but using these directives is good practice to clarify the code and
avoid simple human errors.
  • Loading branch information
digit-google committed Aug 28, 2024
1 parent 0f05540 commit 50ae55a
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ namespace {

/// A CommandRunner that doesn't actually run the commands.
struct DryRunCommandRunner : public CommandRunner {
virtual ~DryRunCommandRunner() {}

// Overridden from CommandRunner:
virtual size_t CanRunMore() const;
virtual bool StartCommand(Edge* edge);
virtual bool WaitForCommand(Result* result);
size_t CanRunMore() const override;
bool StartCommand(Edge* edge) override;
bool WaitForCommand(Result* result) override;

private:
queue<Edge*> finished_;
Expand Down Expand Up @@ -595,12 +593,11 @@ void Plan::Dump() const {

struct RealCommandRunner : public CommandRunner {
explicit RealCommandRunner(const BuildConfig& config) : config_(config) {}
virtual ~RealCommandRunner() {}
virtual size_t CanRunMore() const;
virtual bool StartCommand(Edge* edge);
virtual bool WaitForCommand(Result* result);
virtual vector<Edge*> GetActiveEdges();
virtual void Abort();
size_t CanRunMore() const override;
bool StartCommand(Edge* edge) override;
bool WaitForCommand(Result* result) override;
vector<Edge*> GetActiveEdges() override;
void Abort() override;

const BuildConfig& config_;
SubprocessSet subprocs_;
Expand Down

0 comments on commit 50ae55a

Please sign in to comment.