Fix google-explicit-constructor warnings in system/netd.
Declare explicit conversion constructors.
Bug: 28341362
Change-Id: Iff77bfbd86c032fb335dd62203a3b387f9576f3a
Test: build with clang-tidy
diff --git a/server/DnsProxyListener.h b/server/DnsProxyListener.h
index bd7251d..b67ad5c 100644
--- a/server/DnsProxyListener.h
+++ b/server/DnsProxyListener.h
@@ -33,7 +33,7 @@
const NetworkController *mNetCtrl;
class GetAddrInfoCmd : public NetdCommand {
public:
- GetAddrInfoCmd(const DnsProxyListener* dnsProxyListener);
+ explicit GetAddrInfoCmd(const DnsProxyListener* dnsProxyListener);
virtual ~GetAddrInfoCmd() {}
int runCommand(SocketClient *c, int argc, char** argv);
private:
@@ -65,7 +65,7 @@
/* ------ gethostbyname ------*/
class GetHostByNameCmd : public NetdCommand {
public:
- GetHostByNameCmd(const DnsProxyListener* dnsProxyListener);
+ explicit GetHostByNameCmd(const DnsProxyListener* dnsProxyListener);
virtual ~GetHostByNameCmd() {}
int runCommand(SocketClient *c, int argc, char** argv);
private:
@@ -94,7 +94,7 @@
/* ------ gethostbyaddr ------*/
class GetHostByAddrCmd : public NetdCommand {
public:
- GetHostByAddrCmd(const DnsProxyListener* dnsProxyListener);
+ explicit GetHostByAddrCmd(const DnsProxyListener* dnsProxyListener);
virtual ~GetHostByAddrCmd() {}
int runCommand(SocketClient *c, int argc, char** argv);
private:
diff --git a/server/NetdCommand.h b/server/NetdCommand.h
index 4f731bb..8e3e54b 100644
--- a/server/NetdCommand.h
+++ b/server/NetdCommand.h
@@ -21,7 +21,7 @@
class NetdCommand : public FrameworkCommand {
public:
- NetdCommand(const char *cmd);
+ explicit NetdCommand(const char *cmd);
virtual ~NetdCommand() {}
};