Fix google-explicit-constructor warnings.
Bug: 28341362
Change-Id: I84effbdfa1b9b39328a909b7f70fe17e7ee316c8
diff --git a/libc/bionic/ifaddrs.cpp b/libc/bionic/ifaddrs.cpp
index 408949c..f5b080c 100644
--- a/libc/bionic/ifaddrs.cpp
+++ b/libc/bionic/ifaddrs.cpp
@@ -59,7 +59,7 @@
sockaddr_storage ifa_ifu;
char name[IFNAMSIZ + 1];
- ifaddrs_storage(ifaddrs** list) {
+ explicit ifaddrs_storage(ifaddrs** list) {
memset(this, 0, sizeof(*this));
// push_front onto `list`.
diff --git a/libc/bionic/libc_logging.cpp b/libc/bionic/libc_logging.cpp
index 6802944..517d047 100644
--- a/libc/bionic/libc_logging.cpp
+++ b/libc/bionic/libc_logging.cpp
@@ -107,7 +107,7 @@
struct FdOutputStream {
public:
- FdOutputStream(int fd) : total(0), fd_(fd) {
+ explicit FdOutputStream(int fd) : total(0), fd_(fd) {
}
void Send(const char* data, int len) {
diff --git a/libc/bionic/locale.cpp b/libc/bionic/locale.cpp
index b42b440..f26a5f2 100644
--- a/libc/bionic/locale.cpp
+++ b/libc/bionic/locale.cpp
@@ -44,10 +44,10 @@
struct __locale_t {
size_t mb_cur_max;
- __locale_t(size_t mb_cur_max) : mb_cur_max(mb_cur_max) {
+ explicit __locale_t(size_t mb_cur_max) : mb_cur_max(mb_cur_max) {
}
- __locale_t(const __locale_t* other) {
+ explicit __locale_t(const __locale_t* other) {
if (other == LC_GLOBAL_LOCALE) {
mb_cur_max = __bionic_current_locale_is_utf8 ? 4 : 1;
} else {
diff --git a/libc/bionic/net_if.cpp b/libc/bionic/net_if.cpp
index f8d73bd..db9c9ea2 100644
--- a/libc/bionic/net_if.cpp
+++ b/libc/bionic/net_if.cpp
@@ -77,7 +77,7 @@
if_list* next;
struct if_nameindex data;
- if_list(if_list** list) {
+ explicit if_list(if_list** list) {
// push_front onto `list`.
next = *list;
*list = this;
diff --git a/libc/bionic/system_properties.cpp b/libc/bionic/system_properties.cpp
index 9c992da..0f68431 100644
--- a/libc/bionic/system_properties.cpp
+++ b/libc/bionic/system_properties.cpp
@@ -192,7 +192,7 @@
const uint32_t n;
const prop_info *pi;
- find_nth_cookie(uint32_t n) : count(0), n(n), pi(NULL) {
+ explicit find_nth_cookie(uint32_t n) : count(0), n(n), pi(NULL) {
}
};
diff --git a/libc/malloc_debug/Config.cpp b/libc/malloc_debug/Config.cpp
index cc60086..6220a23 100644
--- a/libc/malloc_debug/Config.cpp
+++ b/libc/malloc_debug/Config.cpp
@@ -84,7 +84,7 @@
class PropertyParser {
public:
- PropertyParser(const char* property) : cur_(property) {}
+ explicit PropertyParser(const char* property) : cur_(property) {}
bool Get(std::string* property, size_t* value, bool* value_set);
diff --git a/libc/stdio/stdio.cpp b/libc/stdio/stdio.cpp
index 1c31a27..5df1bb9 100644
--- a/libc/stdio/stdio.cpp
+++ b/libc/stdio/stdio.cpp
@@ -90,7 +90,7 @@
class ScopedFileLock {
public:
- ScopedFileLock(FILE* fp) : fp_(fp) {
+ explicit ScopedFileLock(FILE* fp) : fp_(fp) {
FLOCKFILE(fp_);
}
~ScopedFileLock() {