Merge "Fix google-explicit-constructor warnings in utils." am: 5b7e3b9a2a am: 4d031d6358 am: e1fff2572c

am: d8ced2029b

Change-Id: Ie0092027487b3089b6602c53fd73f6e95b881a85
This commit is contained in:
Chih-Hung Hsieh 2016-08-04 21:55:59 +00:00 committed by android-build-merger
commit 94aa3aaee0
8 changed files with 21 additions and 21 deletions

View File

@ -54,7 +54,7 @@ public:
};
Condition();
Condition(int type);
explicit Condition(int type);
~Condition();
// Wait on the condition variable. Lock the mutex before calling.
status_t wait(Mutex& mutex);

View File

@ -52,8 +52,8 @@ public:
};
Mutex();
Mutex(const char* name);
Mutex(int type, const char* name = NULL);
explicit Mutex(const char* name);
explicit Mutex(int type, const char* name = NULL);
~Mutex();
// lock or unlock the mutex
@ -77,8 +77,8 @@ public:
// constructed and released when Autolock goes out of scope.
class Autolock {
public:
inline Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); }
inline Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); }
inline explicit Autolock(Mutex& mutex) : mLock(mutex) { mLock.lock(); }
inline explicit Autolock(Mutex* mutex) : mLock(*mutex) { mLock.lock(); }
inline ~Autolock() { mLock.unlock(); }
private:
Mutex& mLock;

View File

@ -47,8 +47,8 @@ public:
};
RWLock();
RWLock(const char* name);
RWLock(int type, const char* name = NULL);
explicit RWLock(const char* name);
explicit RWLock(int type, const char* name = NULL);
~RWLock();
status_t readLock();
@ -59,7 +59,7 @@ public:
class AutoRLock {
public:
inline AutoRLock(RWLock& rwlock) : mLock(rwlock) { mLock.readLock(); }
inline explicit AutoRLock(RWLock& rwlock) : mLock(rwlock) { mLock.readLock(); }
inline ~AutoRLock() { mLock.unlock(); }
private:
RWLock& mLock;
@ -67,7 +67,7 @@ public:
class AutoWLock {
public:
inline AutoWLock(RWLock& rwlock) : mLock(rwlock) { mLock.writeLock(); }
inline explicit AutoWLock(RWLock& rwlock) : mLock(rwlock) { mLock.writeLock(); }
inline ~AutoWLock() { mLock.unlock(); }
private:
RWLock& mLock;

View File

@ -222,12 +222,12 @@ public:
inline wp() : m_ptr(0) { }
wp(T* other);
wp(T* other); // NOLINT(implicit)
wp(const wp<T>& other);
wp(const sp<T>& other);
template<typename U> wp(U* other);
template<typename U> wp(const sp<U>& other);
template<typename U> wp(const wp<U>& other);
explicit wp(const sp<T>& other);
template<typename U> wp(U* other); // NOLINT(implicit)
template<typename U> wp(const sp<U>& other); // NOLINT(implicit)
template<typename U> wp(const wp<U>& other); // NOLINT(implicit)
~wp();

View File

@ -60,12 +60,12 @@ class sp {
public:
inline sp() : m_ptr(0) { }
sp(T* other);
sp(T* other); // NOLINT(implicit)
sp(const sp<T>& other);
sp(sp<T>&& other);
template<typename U> sp(U* other);
template<typename U> sp(const sp<U>& other);
template<typename U> sp(sp<U>&& other);
template<typename U> sp(U* other); // NOLINT(implicit)
template<typename U> sp(const sp<U>& other); // NOLINT(implicit)
template<typename U> sp(sp<U>&& other); // NOLINT(implicit)
~sp();

View File

@ -41,7 +41,7 @@ class Thread : virtual public RefBase
public:
// Create a Thread object, but doesn't create or start the associated
// thread. See the run() method.
Thread(bool canCallJava = true);
explicit Thread(bool canCallJava = true);
virtual ~Thread();
// Start the thread in threadLoop() which needs to be implemented.

View File

@ -240,7 +240,7 @@ struct key_value_pair_t {
key_value_pair_t() { }
key_value_pair_t(const key_value_pair_t& o) : key(o.key), value(o.value) { }
key_value_pair_t(const KEY& k, const VALUE& v) : key(k), value(v) { }
key_value_pair_t(const KEY& k) : key(k) { }
explicit key_value_pair_t(const KEY& k) : key(k) { }
inline bool operator < (const key_value_pair_t& o) const {
return strictly_order_type(key, o.key);
}

View File

@ -132,7 +132,7 @@ class SortedVectorImpl : public VectorImpl
{
public:
SortedVectorImpl(size_t itemSize, uint32_t flags);
SortedVectorImpl(const VectorImpl& rhs);
explicit SortedVectorImpl(const VectorImpl& rhs);
virtual ~SortedVectorImpl();
SortedVectorImpl& operator = (const SortedVectorImpl& rhs);