From 6bbda7cba2c3c6476db39b73c7e901d9eee3b1e6 Mon Sep 17 00:00:00 2001 From: Thiago Farina Date: Sun, 6 May 2012 19:31:16 -0300 Subject: views: Mark single-argument constructors as explicit. This was reported by cpplint as: python ~/depot_tools/cpplint.py 2>&1 | grep -v "Done processing" | grep explicit Signed-off-by: Thiago Farina --- src/build.cc | 2 +- src/build.h | 2 +- src/graph.cc | 2 +- src/graph.h | 10 +++++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/build.cc b/src/build.cc index 03a9d0d..157442d 100644 --- a/src/build.cc +++ b/src/build.cc @@ -448,7 +448,7 @@ void Plan::Dump() { } struct RealCommandRunner : public CommandRunner { - RealCommandRunner(const BuildConfig& config) : config_(config) {} + explicit RealCommandRunner(const BuildConfig& config) : config_(config) {} virtual ~RealCommandRunner() {} virtual bool CanRunMore(); virtual bool StartCommand(Edge* edge); diff --git a/src/build.h b/src/build.h index ddd9db8..5dcdb5b 100644 --- a/src/build.h +++ b/src/build.h @@ -155,7 +155,7 @@ private: /// Tracks the status of a build: completion fraction, printing updates. struct BuildStatus { - BuildStatus(const BuildConfig& config); + explicit BuildStatus(const BuildConfig& config); void PlanHasTotalEdges(int total); void BuildEdgeStarted(Edge* edge); void BuildEdgeFinished(Edge* edge, bool success, const string& output, diff --git a/src/graph.cc b/src/graph.cc index 1d6d8c7..3531e86 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -177,7 +177,7 @@ bool Edge::AllInputsReady() const { /// An Env for an Edge, providing $in and $out. struct EdgeEnv : public Env { - EdgeEnv(Edge* edge) : edge_(edge) {} + explicit EdgeEnv(Edge* edge) : edge_(edge) {} virtual string LookupVariable(const string& var); /// Given a span of Nodes, construct a list of paths suitable for a command diff --git a/src/graph.h b/src/graph.h index afe4daf..32a859d 100644 --- a/src/graph.h +++ b/src/graph.h @@ -28,8 +28,11 @@ struct Edge; /// Information about a node in the dependency graph: the file, whether /// it's dirty, mtime, etc. struct Node { - Node(const string& path) : path_(path), mtime_(-1), dirty_(false), - in_edge_(NULL) {} + explicit Node(const string& path) + : path_(path), + mtime_(-1), + dirty_(false), + in_edge_(NULL) {} /// Return true if the file exists (mtime_ got a value). bool Stat(DiskInterface* disk_interface); @@ -97,7 +100,8 @@ private: /// An invokable build command and associated metadata (description, etc.). struct Rule { - Rule(const string& name) : name_(name), generator_(false), restat_(false) { } + explicit Rule(const string& name) + : name_(name), generator_(false), restat_(false) {} const string& name() const { return name_; } -- cgit v0.12