Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I84effbdfa1b9b39328a909b7f70fe17e7ee316c8
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index 589cab4..d9b2523 100755
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -926,7 +926,7 @@
pthread_rwlock_t lock;
public:
- RwlockKindTestHelper(int kind_type) {
+ explicit RwlockKindTestHelper(int kind_type) {
InitRwlock(kind_type);
}
@@ -1539,7 +1539,7 @@
struct PthreadMutex {
pthread_mutex_t lock;
- PthreadMutex(int mutex_type) {
+ explicit PthreadMutex(int mutex_type) {
init(mutex_type);
}
@@ -1640,7 +1640,7 @@
}
public:
- MutexWakeupHelper(int mutex_type) : m(mutex_type) {
+ explicit MutexWakeupHelper(int mutex_type) : m(mutex_type) {
}
void test() {
diff --git a/tests/search_test.cpp b/tests/search_test.cpp
index 3900c89..d368f9f 100644
--- a/tests/search_test.cpp
+++ b/tests/search_test.cpp
@@ -49,7 +49,7 @@
}
struct node {
- node(const char* s) : s(strdup(s)) {}
+ explicit node(const char* s) : s(strdup(s)) {}
char* s;
};
@@ -115,7 +115,7 @@
}
struct pod_node {
- pod_node(int i) : i(i) {}
+ explicit pod_node(int i) : i(i) {}
int i;
};
@@ -136,7 +136,7 @@
}
struct q_node {
- q_node(int i) : i(i) {}
+ explicit q_node(int i) : i(i) {}
q_node* next;
q_node* prev;
diff --git a/tests/string_test.cpp b/tests/string_test.cpp
index 4b2cca2..2a9da10 100644
--- a/tests/string_test.cpp
+++ b/tests/string_test.cpp
@@ -163,7 +163,7 @@
template<class Character>
class StringTestState {
public:
- StringTestState(size_t MAX_LEN) : MAX_LEN(MAX_LEN), align1_index_(0), align2_index_(0) {
+ explicit StringTestState(size_t MAX_LEN) : MAX_LEN(MAX_LEN), align1_index_(0), align2_index_(0) {
int max_alignment = 64;
// TODO: fix the tests to not sometimes use twice their specified "MAX_LEN".
diff --git a/tests/sys_ptrace_test.cpp b/tests/sys_ptrace_test.cpp
index bd84d30..9071acf 100644
--- a/tests/sys_ptrace_test.cpp
+++ b/tests/sys_ptrace_test.cpp
@@ -59,7 +59,7 @@
class ChildGuard {
public:
- ChildGuard(pid_t pid) : pid(pid) {}
+ explicit ChildGuard(pid_t pid) : pid(pid) {}
~ChildGuard() {
kill(pid, SIGKILL);
diff --git a/tests/time_test.cpp b/tests/time_test.cpp
index b1f6364..10399c5 100644
--- a/tests/time_test.cpp
+++ b/tests/time_test.cpp
@@ -273,7 +273,7 @@
}
public:
- Counter(void (*fn)(sigval_t)) : value(0), timer_valid(false) {
+ explicit Counter(void (*fn)(sigval_t)) : value(0), timer_valid(false) {
memset(&se, 0, sizeof(se));
se.sigev_notify = SIGEV_THREAD;
se.sigev_notify_function = fn;