summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chih-Hung Hsieh <chh@google.com> 2018-12-20 15:43:57 -0800
committer Chih-Hung Hsieh <chh@google.com> 2018-12-20 15:43:57 -0800
commitd0937e64ba3bd91552e7814e7712f50dee3980bc (patch)
tree207f68f509c4efafc753275f92c451f3bb53b6a6
parentbabb02766994351d920fd391b842b091fc1361f9 (diff)
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
-rw-r--r--cmds/dumpstate/DumpstateUtil.h6
-rw-r--r--cmds/dumpstate/dumpstate.h6
-rw-r--r--cmds/dumpsys/dumpsys.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/cmds/dumpstate/DumpstateUtil.h b/cmds/dumpstate/DumpstateUtil.h
index d69ffbfc98..d75b08c046 100644
--- a/cmds/dumpstate/DumpstateUtil.h
+++ b/cmds/dumpstate/DumpstateUtil.h
@@ -76,7 +76,7 @@ class CommandOptions {
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 @@ class CommandOptions {
friend class CommandOptionsBuilder;
};
- CommandOptions(const CommandOptionsValues& values);
+ explicit CommandOptions(const CommandOptionsValues& values);
const CommandOptionsValues values;
@@ -119,7 +119,7 @@ class CommandOptions {
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 ee952d99d5..7ac25e42f0 100644
--- a/cmds/dumpstate/dumpstate.h
+++ b/cmds/dumpstate/dumpstate.h
@@ -72,7 +72,7 @@ extern "C" {
*/
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 @@ class Progress {
*/
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 @@ class Dumpstate {
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);
};
diff --git a/cmds/dumpsys/dumpsys.h b/cmds/dumpsys/dumpsys.h
index 84f3b0236e..c48a1e959b 100644
--- a/cmds/dumpsys/dumpsys.h
+++ b/cmds/dumpsys/dumpsys.h
@@ -26,7 +26,7 @@ namespace android {
class Dumpsys {
public:
- Dumpsys(android::IServiceManager* sm) : sm_(sm) {
+ explicit Dumpsys(android::IServiceManager* sm) : sm_(sm) {
}
/**
* Main entry point into dumpsys.