Fix/suppress google-explicit-constructor warnings
* Add explicit to conversion constructors/operators
Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: I815a5282f1fc0d308835988f40efb666fe06d118
diff --git a/cmds/dumpstate/DumpstateUtil.h b/cmds/dumpstate/DumpstateUtil.h
index d69ffbf..d75b08c 100644
--- a/cmds/dumpstate/DumpstateUtil.h
+++ b/cmds/dumpstate/DumpstateUtil.h
@@ -76,7 +76,7 @@
private:
class CommandOptionsValues {
private:
- CommandOptionsValues(int64_t timeout_ms);
+ explicit CommandOptionsValues(int64_t timeout_ms);
int64_t timeout_ms_;
bool always_;
@@ -88,7 +88,7 @@
friend class CommandOptionsBuilder;
};
- CommandOptions(const CommandOptionsValues& values);
+ explicit CommandOptions(const CommandOptionsValues& values);
const CommandOptionsValues values;
@@ -119,7 +119,7 @@
CommandOptions Build();
private:
- CommandOptionsBuilder(int64_t timeout_ms);
+ explicit CommandOptionsBuilder(int64_t timeout_ms);
CommandOptionsValues values;
friend class CommandOptions;
};
diff --git a/cmds/dumpstate/dumpstate.h b/cmds/dumpstate/dumpstate.h
index ee952d9..7ac25e4 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -72,7 +72,7 @@
*/
class DurationReporter {
public:
- DurationReporter(const std::string& title, bool log_only = false);
+ explicit DurationReporter(const std::string& title, bool log_only = false);
~DurationReporter();
@@ -111,7 +111,7 @@
*/
static const int kDefaultMax;
- Progress(const std::string& path = "");
+ explicit Progress(const std::string& path = "");
// Gets the current progress.
int32_t Get() const;
@@ -447,7 +447,7 @@
private:
// Used by GetInstance() only.
- Dumpstate(const std::string& version = VERSION_CURRENT);
+ explicit Dumpstate(const std::string& version = VERSION_CURRENT);
DISALLOW_COPY_AND_ASSIGN(Dumpstate);
};