summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2016-04-29 15:44:04 -0700
committerChih-Hung Hsieh <chh@google.com>2016-04-29 15:44:04 -0700
commit1c563d96f000876d77b2d33fbfb03c241bc503e1 (patch)
tree2b4938eda86ade588cc77bbee202075d3f659bb4
parent3abd03232efd53bb3a73d1e76f6f72754457e18d (diff)
downloadsystem_core-1c563d96f000876d77b2d33fbfb03c241bc503e1.tar.gz
system_core-1c563d96f000876d77b2d33fbfb03c241bc503e1.tar.bz2
system_core-1c563d96f000876d77b2d33fbfb03c241bc503e1.zip
Fix google-explicit-constructor warnings.
Bug: 28341362 Change-Id: I4504e98a8db31e0edcbe63c23f9af43eb13e9d86
-rw-r--r--adb/fdevent.cpp2
-rw-r--r--fastboot/socket.cpp2
-rw-r--r--fastboot/tcp.cpp2
-rw-r--r--fastboot/udp.cpp2
-rw-r--r--fastboot/usb_linux.cpp2
-rw-r--r--fingerprintd/IFingerprintDaemonCallback.cpp2
-rw-r--r--gatekeeperd/IUserManager.cpp2
-rw-r--r--init/action.cpp4
-rw-r--r--libbacktrace/BacktraceOffline.cpp2
-rw-r--r--libmemunreachable/PtracerThread.cpp2
-rw-r--r--libutils/RefBase.cpp2
11 files changed, 12 insertions, 12 deletions
diff --git a/adb/fdevent.cpp b/adb/fdevent.cpp
index 902548ec5..04cd8651c 100644
--- a/adb/fdevent.cpp
+++ b/adb/fdevent.cpp
@@ -55,7 +55,7 @@ struct PollNode {
fdevent* fde;
adb_pollfd pollfd;
- PollNode(fdevent* fde) : fde(fde) {
+ explicit PollNode(fdevent* fde) : fde(fde) {
memset(&pollfd, 0, sizeof(pollfd));
pollfd.fd = fde->fd;
diff --git a/fastboot/socket.cpp b/fastboot/socket.cpp
index 14ecd937a..e56ffcf4b 100644
--- a/fastboot/socket.cpp
+++ b/fastboot/socket.cpp
@@ -167,7 +167,7 @@ ssize_t UdpSocket::Receive(void* data, size_t length, int timeout_ms) {
// Implements the Socket interface for TCP.
class TcpSocket : public Socket {
public:
- TcpSocket(cutils_socket_t sock) : Socket(sock) {}
+ explicit TcpSocket(cutils_socket_t sock) : Socket(sock) {}
bool Send(const void* data, size_t length) override;
bool Send(std::vector<cutils_socket_buffer_t> buffers) override;
diff --git a/fastboot/tcp.cpp b/fastboot/tcp.cpp
index e42c4e1af..dd6fbf828 100644
--- a/fastboot/tcp.cpp
+++ b/fastboot/tcp.cpp
@@ -66,7 +66,7 @@ class TcpTransport : public Transport {
int Close() override;
private:
- TcpTransport(std::unique_ptr<Socket> sock) : socket_(std::move(sock)) {}
+ explicit TcpTransport(std::unique_ptr<Socket> sock) : socket_(std::move(sock)) {}
// Connects to the device and performs the initial handshake. Returns false and fills |error|
// on failure.
diff --git a/fastboot/udp.cpp b/fastboot/udp.cpp
index b36bd605c..53fb3472f 100644
--- a/fastboot/udp.cpp
+++ b/fastboot/udp.cpp
@@ -111,7 +111,7 @@ class UdpTransport : public Transport {
int Close() override;
private:
- UdpTransport(std::unique_ptr<Socket> socket) : socket_(std::move(socket)) {}
+ explicit UdpTransport(std::unique_ptr<Socket> socket) : socket_(std::move(socket)) {}
// Performs the UDP initialization procedure. Returns true on success.
bool InitializeProtocol(std::string* error);
diff --git a/fastboot/usb_linux.cpp b/fastboot/usb_linux.cpp
index d4824fb2a..6db1e2727 100644
--- a/fastboot/usb_linux.cpp
+++ b/fastboot/usb_linux.cpp
@@ -89,7 +89,7 @@ struct usb_handle
class LinuxUsbTransport : public Transport {
public:
- LinuxUsbTransport(std::unique_ptr<usb_handle> handle) : handle_(std::move(handle)) {}
+ explicit LinuxUsbTransport(std::unique_ptr<usb_handle> handle) : handle_(std::move(handle)) {}
~LinuxUsbTransport() override = default;
ssize_t Read(void* data, size_t len) override;
diff --git a/fingerprintd/IFingerprintDaemonCallback.cpp b/fingerprintd/IFingerprintDaemonCallback.cpp
index 44d8020ae..dfd2abcdf 100644
--- a/fingerprintd/IFingerprintDaemonCallback.cpp
+++ b/fingerprintd/IFingerprintDaemonCallback.cpp
@@ -27,7 +27,7 @@ namespace android {
class BpFingerprintDaemonCallback : public BpInterface<IFingerprintDaemonCallback>
{
public:
- BpFingerprintDaemonCallback(const sp<IBinder>& impl) :
+ explicit BpFingerprintDaemonCallback(const sp<IBinder>& impl) :
BpInterface<IFingerprintDaemonCallback>(impl) {
}
virtual status_t onEnrollResult(int64_t devId, int32_t fpId, int32_t gpId, int32_t rem) {
diff --git a/gatekeeperd/IUserManager.cpp b/gatekeeperd/IUserManager.cpp
index 8645fc2c9..8167d1919 100644
--- a/gatekeeperd/IUserManager.cpp
+++ b/gatekeeperd/IUserManager.cpp
@@ -27,7 +27,7 @@ namespace android {
class BpUserManager : public BpInterface<IUserManager>
{
public:
- BpUserManager(const sp<IBinder>& impl) :
+ explicit BpUserManager(const sp<IBinder>& impl) :
BpInterface<IUserManager>(impl) {
}
virtual int32_t getCredentialOwnerProfile(int32_t user_id) {
diff --git a/init/action.cpp b/init/action.cpp
index 510ea897f..b7e431c34 100644
--- a/init/action.cpp
+++ b/init/action.cpp
@@ -264,7 +264,7 @@ void Action::DumpState() const {
class EventTrigger : public Trigger {
public:
- EventTrigger(const std::string& trigger) : trigger_(trigger) {
+ explicit EventTrigger(const std::string& trigger) : trigger_(trigger) {
}
bool CheckTriggers(const Action& action) const override {
return action.CheckEventTrigger(trigger_);
@@ -288,7 +288,7 @@ private:
class BuiltinTrigger : public Trigger {
public:
- BuiltinTrigger(Action* action) : action_(action) {
+ explicit BuiltinTrigger(Action* action) : action_(action) {
}
bool CheckTriggers(const Action& action) const override {
return action_ == &action;
diff --git a/libbacktrace/BacktraceOffline.cpp b/libbacktrace/BacktraceOffline.cpp
index 9a4f62224..c2b68bc84 100644
--- a/libbacktrace/BacktraceOffline.cpp
+++ b/libbacktrace/BacktraceOffline.cpp
@@ -665,7 +665,7 @@ static bool IsValidApkPath(const std::string& apk_path) {
class ScopedZiparchiveHandle {
public:
- ScopedZiparchiveHandle(ZipArchiveHandle handle) : handle_(handle) {
+ explicit ScopedZiparchiveHandle(ZipArchiveHandle handle) : handle_(handle) {
}
~ScopedZiparchiveHandle() {
diff --git a/libmemunreachable/PtracerThread.cpp b/libmemunreachable/PtracerThread.cpp
index aa5b344a3..4e3c41e54 100644
--- a/libmemunreachable/PtracerThread.cpp
+++ b/libmemunreachable/PtracerThread.cpp
@@ -37,7 +37,7 @@
class Stack {
public:
- Stack(size_t size) : size_(size) {
+ explicit Stack(size_t size) : size_(size) {
int prot = PROT_READ | PROT_WRITE;
int flags = MAP_PRIVATE | MAP_ANONYMOUS;
page_size_ = sysconf(_SC_PAGE_SIZE);
diff --git a/libutils/RefBase.cpp b/libutils/RefBase.cpp
index ea1e4db84..22162fac7 100644
--- a/libutils/RefBase.cpp
+++ b/libutils/RefBase.cpp
@@ -71,7 +71,7 @@ public:
#if !DEBUG_REFS
- weakref_impl(RefBase* base)
+ explicit weakref_impl(RefBase* base)
: mStrong(INITIAL_STRONG_VALUE)
, mWeak(0)
, mBase(base)