Merge "toolbox ps: replace strcpy with snprintf."
diff --git a/adb/fdevent.cpp b/adb/fdevent.cpp
index 902548e..04cd865 100644
--- a/adb/fdevent.cpp
+++ b/adb/fdevent.cpp
@@ -55,7 +55,7 @@
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 14ecd93..e56ffcf 100644
--- a/fastboot/socket.cpp
+++ b/fastboot/socket.cpp
@@ -167,7 +167,7 @@
// 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 e42c4e1..dd6fbf8 100644
--- a/fastboot/tcp.cpp
+++ b/fastboot/tcp.cpp
@@ -66,7 +66,7 @@
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 b36bd60..53fb347 100644
--- a/fastboot/udp.cpp
+++ b/fastboot/udp.cpp
@@ -111,7 +111,7 @@
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 d4824fb..6db1e27 100644
--- a/fastboot/usb_linux.cpp
+++ b/fastboot/usb_linux.cpp
@@ -89,7 +89,7 @@
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 44d8020..dfd2abc 100644
--- a/fingerprintd/IFingerprintDaemonCallback.cpp
+++ b/fingerprintd/IFingerprintDaemonCallback.cpp
@@ -27,7 +27,7 @@
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 8645fc2..8167d19 100644
--- a/gatekeeperd/IUserManager.cpp
+++ b/gatekeeperd/IUserManager.cpp
@@ -27,7 +27,7 @@
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 510ea89..b7e431c 100644
--- a/init/action.cpp
+++ b/init/action.cpp
@@ -264,7 +264,7 @@
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 @@
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 9a4f622..c2b68bc 100644
--- a/libbacktrace/BacktraceOffline.cpp
+++ b/libbacktrace/BacktraceOffline.cpp
@@ -665,7 +665,7 @@
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 aa5b344..4e3c41e 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 ea1e4db..22162fa 100644
--- a/libutils/RefBase.cpp
+++ b/libutils/RefBase.cpp
@@ -71,7 +71,7 @@
#if !DEBUG_REFS
- weakref_impl(RefBase* base)
+ explicit weakref_impl(RefBase* base)
: mStrong(INITIAL_STRONG_VALUE)
, mWeak(0)
, mBase(base)