Fix/suppress bionic 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: Id1ad0327c1b8c6f094bcbb3ae599bc1f716b3f2f
diff --git a/benchmarks/pthread_benchmark.cpp b/benchmarks/pthread_benchmark.cpp
index 09654c8..9a68a12 100644
--- a/benchmarks/pthread_benchmark.cpp
+++ b/benchmarks/pthread_benchmark.cpp
@@ -100,7 +100,7 @@
 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 2b7a99a..c058384 100644
--- a/libc/bionic/pthread_internal.cpp
+++ b/libc/bionic/pthread_internal.cpp
@@ -43,7 +43,7 @@
 
 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 b05a763..6955c9a 100644
--- a/libc/malloc_debug/PointerData.h
+++ b/libc/malloc_debug/PointerData.h
@@ -112,7 +112,7 @@
 
 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 dc22309..9a20c09 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 dd5823f..7031752 100644
--- a/libc/private/ScopedSignalHandler.h
+++ b/libc/private/ScopedSignalHandler.h
@@ -33,7 +33,7 @@
     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 eebfeff..410e637 100644
--- a/libc/private/bionic_lock.h
+++ b/libc/private/bionic_lock.h
@@ -78,7 +78,7 @@
 
 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 2cbad62..66866fb 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 cefff7a..90fd418 100644
--- a/tests/libs/thread_local_dtor.cpp
+++ b/tests/libs/thread_local_dtor.cpp
@@ -30,7 +30,7 @@
 
 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 9b2b164..177c91b 100644
--- a/tests/libs/thread_local_dtor2.cpp
+++ b/tests/libs/thread_local_dtor2.cpp
@@ -30,7 +30,7 @@
 
 class TestClass {
  public:
-  TestClass(bool* flag) : flag_(flag) {}
+  explicit TestClass(bool* flag) : flag_(flag) {}
   ~TestClass() {
     *flag_ = true;
   }