summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--benchmarks/pthread_benchmark.cpp2
-rw-r--r--libc/bionic/pthread_internal.cpp2
-rw-r--r--libc/malloc_debug/PointerData.h2
-rw-r--r--libc/private/ScopedReaddir.h4
-rw-r--r--libc/private/ScopedSignalHandler.h2
-rw-r--r--libc/private/bionic_lock.h2
-rw-r--r--tests/grp_pwd_file_test.cpp2
-rw-r--r--tests/libs/thread_local_dtor.cpp2
-rw-r--r--tests/libs/thread_local_dtor2.cpp2
9 files changed, 10 insertions, 10 deletions
diff --git a/benchmarks/pthread_benchmark.cpp b/benchmarks/pthread_benchmark.cpp
index 09654c825..9a68a12d0 100644
--- a/benchmarks/pthread_benchmark.cpp
+++ b/benchmarks/pthread_benchmark.cpp
@@ -100,7 +100,7 @@ namespace {
struct PIMutex {
pthread_mutex_t mutex;
- PIMutex(int type) {
+ explicit PIMutex(int type) {
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, type);
diff --git a/libc/bionic/pthread_internal.cpp b/libc/bionic/pthread_internal.cpp
index 2b7a99a2d..c058384a2 100644
--- a/libc/bionic/pthread_internal.cpp
+++ b/libc/bionic/pthread_internal.cpp
@@ -43,7 +43,7 @@ static pthread_rwlock_t g_thread_list_lock = PTHREAD_RWLOCK_INITIALIZER;
template <bool write> class ScopedRWLock {
public:
- ScopedRWLock(pthread_rwlock_t* rwlock) : rwlock_(rwlock) {
+ explicit ScopedRWLock(pthread_rwlock_t* rwlock) : rwlock_(rwlock) {
(write ? pthread_rwlock_wrlock : pthread_rwlock_rdlock)(rwlock_);
}
diff --git a/libc/malloc_debug/PointerData.h b/libc/malloc_debug/PointerData.h
index b05a76383..6955c9a03 100644
--- a/libc/malloc_debug/PointerData.h
+++ b/libc/malloc_debug/PointerData.h
@@ -112,7 +112,7 @@ struct ListInfoType {
class PointerData : public OptionData {
public:
- PointerData(DebugData* debug_data);
+ explicit PointerData(DebugData* debug_data);
virtual ~PointerData() = default;
bool Initialize(const Config& config);
diff --git a/libc/private/ScopedReaddir.h b/libc/private/ScopedReaddir.h
index dc22309ce..9a20c0916 100644
--- a/libc/private/ScopedReaddir.h
+++ b/libc/private/ScopedReaddir.h
@@ -22,10 +22,10 @@
class ScopedReaddir {
public:
- ScopedReaddir(const char* path) : ScopedReaddir(opendir(path)) {
+ explicit ScopedReaddir(const char* path) : ScopedReaddir(opendir(path)) {
}
- ScopedReaddir(DIR* dir) {
+ explicit ScopedReaddir(DIR* dir) {
dir_ = dir;
}
diff --git a/libc/private/ScopedSignalHandler.h b/libc/private/ScopedSignalHandler.h
index dd5823f03..703175223 100644
--- a/libc/private/ScopedSignalHandler.h
+++ b/libc/private/ScopedSignalHandler.h
@@ -33,7 +33,7 @@ class ScopedSignalHandler {
sigaction64(signal_number_, &action_, &old_action_);
}
- ScopedSignalHandler(int signal_number) : signal_number_(signal_number) {
+ explicit ScopedSignalHandler(int signal_number) : signal_number_(signal_number) {
sigaction64(signal_number, nullptr, &old_action_);
}
diff --git a/libc/private/bionic_lock.h b/libc/private/bionic_lock.h
index eebfeff54..410e637d7 100644
--- a/libc/private/bionic_lock.h
+++ b/libc/private/bionic_lock.h
@@ -78,7 +78,7 @@ class Lock {
class LockGuard {
public:
- LockGuard(Lock& lock) : lock_(lock) {
+ explicit LockGuard(Lock& lock) : lock_(lock) {
lock_.lock();
}
~LockGuard() {
diff --git a/tests/grp_pwd_file_test.cpp b/tests/grp_pwd_file_test.cpp
index 2cbad62ad..66866fb48 100644
--- a/tests/grp_pwd_file_test.cpp
+++ b/tests/grp_pwd_file_test.cpp
@@ -26,7 +26,7 @@
template <typename T>
class FileUnmapper {
public:
- FileUnmapper(T& file) : file_(file) {
+ explicit FileUnmapper(T& file) : file_(file) {
}
~FileUnmapper() {
file_.Unmap();
diff --git a/tests/libs/thread_local_dtor.cpp b/tests/libs/thread_local_dtor.cpp
index cefff7a37..90fd41843 100644
--- a/tests/libs/thread_local_dtor.cpp
+++ b/tests/libs/thread_local_dtor.cpp
@@ -30,7 +30,7 @@ namespace {
class TestClass {
public:
- TestClass(bool* flag) : flag_(flag) {}
+ explicit TestClass(bool* flag) : flag_(flag) {}
~TestClass() {
*flag_ = true;
}
diff --git a/tests/libs/thread_local_dtor2.cpp b/tests/libs/thread_local_dtor2.cpp
index 9b2b1640a..177c91bcb 100644
--- a/tests/libs/thread_local_dtor2.cpp
+++ b/tests/libs/thread_local_dtor2.cpp
@@ -30,7 +30,7 @@ namespace {
class TestClass {
public:
- TestClass(bool* flag) : flag_(flag) {}
+ explicit TestClass(bool* flag) : flag_(flag) {}
~TestClass() {
*flag_ = true;
}