summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--liblog/include/log/log_read.h2
-rw-r--r--libutils/include/utils/AndroidThreads.h2
-rw-r--r--libutils/include/utils/CallStack.h6
-rw-r--r--libutils/include/utils/Looper.h4
-rw-r--r--libutils/include/utils/Mutex.h8
-rw-r--r--libutils/include/utils/RWLock.h8
-rw-r--r--libutils/include/utils/RefBase.h6
-rw-r--r--libutils/include/utils/Singleton.h6
-rw-r--r--libutils/include/utils/String8.h2
-rw-r--r--libutils/include/utils/StrongPointer.h4
-rw-r--r--libutils/include/utils/VectorImpl.h2
11 files changed, 25 insertions, 25 deletions
diff --git a/liblog/include/log/log_read.h b/liblog/include/log/log_read.h
index d118563be..93b9d4e93 100644
--- a/liblog/include/log/log_read.h
+++ b/liblog/include/log/log_read.h
@@ -184,7 +184,7 @@ struct log_msg {
184 hdr_size = sizeof(entry_v1); 184 hdr_size = sizeof(entry_v1);
185 } 185 }
186 if ((hdr_size < sizeof(entry_v1)) || (hdr_size > sizeof(entry))) { 186 if ((hdr_size < sizeof(entry_v1)) || (hdr_size > sizeof(entry))) {
187 return NULL; 187 return nullptr;
188 } 188 }
189 return reinterpret_cast<char*>(buf) + hdr_size; 189 return reinterpret_cast<char*>(buf) + hdr_size;
190 } 190 }
diff --git a/libutils/include/utils/AndroidThreads.h b/libutils/include/utils/AndroidThreads.h
index dab888d5a..a8d785175 100644
--- a/libutils/include/utils/AndroidThreads.h
+++ b/libutils/include/utils/AndroidThreads.h
@@ -106,7 +106,7 @@ inline bool createThreadEtc(thread_func_t entryFunction,
106 const char* threadName = "android:unnamed_thread", 106 const char* threadName = "android:unnamed_thread",
107 int32_t threadPriority = PRIORITY_DEFAULT, 107 int32_t threadPriority = PRIORITY_DEFAULT,
108 size_t threadStackSize = 0, 108 size_t threadStackSize = 0,
109 thread_id_t *threadId = 0) 109 thread_id_t *threadId = nullptr)
110{ 110{
111 return androidCreateThreadEtc(entryFunction, userData, threadName, 111 return androidCreateThreadEtc(entryFunction, userData, threadName,
112 threadPriority, threadStackSize, threadId) ? true : false; 112 threadPriority, threadStackSize, threadId) ? true : false;
diff --git a/libutils/include/utils/CallStack.h b/libutils/include/utils/CallStack.h
index 96221425e..0c1b87522 100644
--- a/libutils/include/utils/CallStack.h
+++ b/libutils/include/utils/CallStack.h
@@ -49,13 +49,13 @@ public:
49 // Dump a stack trace to the log using the supplied logtag. 49 // Dump a stack trace to the log using the supplied logtag.
50 void log(const char* logtag, 50 void log(const char* logtag,
51 android_LogPriority priority = ANDROID_LOG_DEBUG, 51 android_LogPriority priority = ANDROID_LOG_DEBUG,
52 const char* prefix = 0) const; 52 const char* prefix = nullptr) const;
53 53
54 // Dump a stack trace to the specified file descriptor. 54 // Dump a stack trace to the specified file descriptor.
55 void dump(int fd, int indent = 0, const char* prefix = 0) const; 55 void dump(int fd, int indent = 0, const char* prefix = nullptr) const;
56 56
57 // Return a string (possibly very long) containing the complete stack trace. 57 // Return a string (possibly very long) containing the complete stack trace.
58 String8 toString(const char* prefix = 0) const; 58 String8 toString(const char* prefix = nullptr) const;
59 59
60 // Dump a serialized representation of the stack trace to the specified printer. 60 // Dump a serialized representation of the stack trace to the specified printer.
61 void print(Printer& printer) const; 61 void print(Printer& printer) const;
diff --git a/libutils/include/utils/Looper.h b/libutils/include/utils/Looper.h
index a62e67f5f..4509d75ff 100644
--- a/libutils/include/utils/Looper.h
+++ b/libutils/include/utils/Looper.h
@@ -262,7 +262,7 @@ public:
262 */ 262 */
263 int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData); 263 int pollOnce(int timeoutMillis, int* outFd, int* outEvents, void** outData);
264 inline int pollOnce(int timeoutMillis) { 264 inline int pollOnce(int timeoutMillis) {
265 return pollOnce(timeoutMillis, NULL, NULL, NULL); 265 return pollOnce(timeoutMillis, nullptr, nullptr, nullptr);
266 } 266 }
267 267
268 /** 268 /**
@@ -272,7 +272,7 @@ public:
272 */ 272 */
273 int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData); 273 int pollAll(int timeoutMillis, int* outFd, int* outEvents, void** outData);
274 inline int pollAll(int timeoutMillis) { 274 inline int pollAll(int timeoutMillis) {
275 return pollAll(timeoutMillis, NULL, NULL, NULL); 275 return pollAll(timeoutMillis, nullptr, nullptr, nullptr);
276 } 276 }
277 277
278 /** 278 /**
diff --git a/libutils/include/utils/Mutex.h b/libutils/include/utils/Mutex.h
index 1228df4cd..29c2e8ce1 100644
--- a/libutils/include/utils/Mutex.h
+++ b/libutils/include/utils/Mutex.h
@@ -100,7 +100,7 @@ class CAPABILITY("mutex") Mutex {
100 100
101 Mutex(); 101 Mutex();
102 explicit Mutex(const char* name); 102 explicit Mutex(const char* name);
103 explicit Mutex(int type, const char* name = NULL); 103 explicit Mutex(int type, const char* name = nullptr);
104 ~Mutex(); 104 ~Mutex();
105 105
106 // lock or unlock the mutex 106 // lock or unlock the mutex
@@ -160,10 +160,10 @@ class CAPABILITY("mutex") Mutex {
160#if !defined(_WIN32) 160#if !defined(_WIN32)
161 161
162inline Mutex::Mutex() { 162inline Mutex::Mutex() {
163 pthread_mutex_init(&mMutex, NULL); 163 pthread_mutex_init(&mMutex, nullptr);
164} 164}
165inline Mutex::Mutex(__attribute__((unused)) const char* name) { 165inline Mutex::Mutex(__attribute__((unused)) const char* name) {
166 pthread_mutex_init(&mMutex, NULL); 166 pthread_mutex_init(&mMutex, nullptr);
167} 167}
168inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) { 168inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) {
169 if (type == SHARED) { 169 if (type == SHARED) {
@@ -173,7 +173,7 @@ inline Mutex::Mutex(int type, __attribute__((unused)) const char* name) {
173 pthread_mutex_init(&mMutex, &attr); 173 pthread_mutex_init(&mMutex, &attr);
174 pthread_mutexattr_destroy(&attr); 174 pthread_mutexattr_destroy(&attr);
175 } else { 175 } else {
176 pthread_mutex_init(&mMutex, NULL); 176 pthread_mutex_init(&mMutex, nullptr);
177 } 177 }
178} 178}
179inline Mutex::~Mutex() { 179inline Mutex::~Mutex() {
diff --git a/libutils/include/utils/RWLock.h b/libutils/include/utils/RWLock.h
index 7d43e69f1..64e370e3e 100644
--- a/libutils/include/utils/RWLock.h
+++ b/libutils/include/utils/RWLock.h
@@ -48,7 +48,7 @@ public:
48 48
49 RWLock(); 49 RWLock();
50 explicit RWLock(const char* name); 50 explicit RWLock(const char* name);
51 explicit RWLock(int type, const char* name = NULL); 51 explicit RWLock(int type, const char* name = nullptr);
52 ~RWLock(); 52 ~RWLock();
53 53
54 status_t readLock(); 54 status_t readLock();
@@ -82,10 +82,10 @@ private:
82}; 82};
83 83
84inline RWLock::RWLock() { 84inline RWLock::RWLock() {
85 pthread_rwlock_init(&mRWLock, NULL); 85 pthread_rwlock_init(&mRWLock, nullptr);
86} 86}
87inline RWLock::RWLock(__attribute__((unused)) const char* name) { 87inline RWLock::RWLock(__attribute__((unused)) const char* name) {
88 pthread_rwlock_init(&mRWLock, NULL); 88 pthread_rwlock_init(&mRWLock, nullptr);
89} 89}
90inline RWLock::RWLock(int type, __attribute__((unused)) const char* name) { 90inline RWLock::RWLock(int type, __attribute__((unused)) const char* name) {
91 if (type == SHARED) { 91 if (type == SHARED) {
@@ -95,7 +95,7 @@ inline RWLock::RWLock(int type, __attribute__((unused)) const char* name) {
95 pthread_rwlock_init(&mRWLock, &attr); 95 pthread_rwlock_init(&mRWLock, &attr);
96 pthread_rwlockattr_destroy(&attr); 96 pthread_rwlockattr_destroy(&attr);
97 } else { 97 } else {
98 pthread_rwlock_init(&mRWLock, NULL); 98 pthread_rwlock_init(&mRWLock, nullptr);
99 } 99 }
100} 100}
101inline RWLock::~RWLock() { 101inline RWLock::~RWLock() {
diff --git a/libutils/include/utils/RefBase.h b/libutils/include/utils/RefBase.h
index e817ee4d6..13b6a2bc9 100644
--- a/libutils/include/utils/RefBase.h
+++ b/libutils/include/utils/RefBase.h
@@ -354,7 +354,7 @@ class wp
354public: 354public:
355 typedef typename RefBase::weakref_type weakref_type; 355 typedef typename RefBase::weakref_type weakref_type;
356 356
357 inline wp() : m_ptr(0) { } 357 inline wp() : m_ptr(nullptr) { }
358 358
359 wp(T* other); // NOLINT(implicit) 359 wp(T* other); // NOLINT(implicit)
360 wp(const wp<T>& other); 360 wp(const wp<T>& other);
@@ -505,7 +505,7 @@ template<typename T>
505wp<T>& wp<T>::operator = (T* other) 505wp<T>& wp<T>::operator = (T* other)
506{ 506{
507 weakref_type* newRefs = 507 weakref_type* newRefs =
508 other ? other->createWeak(this) : 0; 508 other ? other->createWeak(this) : nullptr;
509 if (m_ptr) m_refs->decWeak(this); 509 if (m_ptr) m_refs->decWeak(this);
510 m_ptr = other; 510 m_ptr = other;
511 m_refs = newRefs; 511 m_refs = newRefs;
@@ -528,7 +528,7 @@ template<typename T>
528wp<T>& wp<T>::operator = (const sp<T>& other) 528wp<T>& wp<T>::operator = (const sp<T>& other)
529{ 529{
530 weakref_type* newRefs = 530 weakref_type* newRefs =
531 other != NULL ? other->createWeak(this) : 0; 531 other != nullptr ? other->createWeak(this) : nullptr;
532 T* otherPtr(other.m_ptr); 532 T* otherPtr(other.m_ptr);
533 if (m_ptr) m_refs->decWeak(this); 533 if (m_ptr) m_refs->decWeak(this);
534 m_ptr = otherPtr; 534 m_ptr = otherPtr;
diff --git a/libutils/include/utils/Singleton.h b/libutils/include/utils/Singleton.h
index 2dd5a47e6..44d8ad79c 100644
--- a/libutils/include/utils/Singleton.h
+++ b/libutils/include/utils/Singleton.h
@@ -51,7 +51,7 @@ public:
51 static TYPE& getInstance() { 51 static TYPE& getInstance() {
52 Mutex::Autolock _l(sLock); 52 Mutex::Autolock _l(sLock);
53 TYPE* instance = sInstance; 53 TYPE* instance = sInstance;
54 if (instance == 0) { 54 if (instance == nullptr) {
55 instance = new TYPE(); 55 instance = new TYPE();
56 sInstance = instance; 56 sInstance = instance;
57 } 57 }
@@ -60,7 +60,7 @@ public:
60 60
61 static bool hasInstance() { 61 static bool hasInstance() {
62 Mutex::Autolock _l(sLock); 62 Mutex::Autolock _l(sLock);
63 return sInstance != 0; 63 return sInstance != nullptr;
64 } 64 }
65 65
66protected: 66protected:
@@ -90,7 +90,7 @@ private:
90#define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \ 90#define ANDROID_SINGLETON_STATIC_INSTANCE(TYPE) \
91 template<> ::android::Mutex \ 91 template<> ::android::Mutex \
92 (::android::Singleton< TYPE >::sLock)(::android::Mutex::PRIVATE); \ 92 (::android::Singleton< TYPE >::sLock)(::android::Mutex::PRIVATE); \
93 template<> TYPE* ::android::Singleton< TYPE >::sInstance(0); /* NOLINT */ \ 93 template<> TYPE* ::android::Singleton< TYPE >::sInstance(nullptr); /* NOLINT */ \
94 template class ::android::Singleton< TYPE >; 94 template class ::android::Singleton< TYPE >;
95 95
96 96
diff --git a/libutils/include/utils/String8.h b/libutils/include/utils/String8.h
index 94ac32fbb..c8f584e30 100644
--- a/libutils/include/utils/String8.h
+++ b/libutils/include/utils/String8.h
@@ -187,7 +187,7 @@ public:
187 * "/tmp" --> "tmp" (remain = "") 187 * "/tmp" --> "tmp" (remain = "")
188 * "bar.c" --> "bar.c" (remain = "") 188 * "bar.c" --> "bar.c" (remain = "")
189 */ 189 */
190 String8 walkPath(String8* outRemains = NULL) const; 190 String8 walkPath(String8* outRemains = nullptr) const;
191 191
192 /* 192 /*
193 * Return the filename extension. This is the last '.' and any number 193 * Return the filename extension. This is the last '.' and any number
diff --git a/libutils/include/utils/StrongPointer.h b/libutils/include/utils/StrongPointer.h
index 9cd278f1f..360fce509 100644
--- a/libutils/include/utils/StrongPointer.h
+++ b/libutils/include/utils/StrongPointer.h
@@ -52,7 +52,7 @@ inline bool operator _op_ (const wp<U>& o) const { \
52template<typename T> 52template<typename T>
53class sp { 53class sp {
54public: 54public:
55 inline sp() : m_ptr(0) { } 55 inline sp() : m_ptr(nullptr) { }
56 56
57 sp(T* other); // NOLINT(implicit) 57 sp(T* other); // NOLINT(implicit)
58 sp(const sp<T>& other); 58 sp(const sp<T>& other);
@@ -230,7 +230,7 @@ template<typename T>
230void sp<T>::clear() { 230void sp<T>::clear() {
231 if (m_ptr) { 231 if (m_ptr) {
232 m_ptr->decStrong(this); 232 m_ptr->decStrong(this);
233 m_ptr = 0; 233 m_ptr = nullptr;
234 } 234 }
235} 235}
236 236
diff --git a/libutils/include/utils/VectorImpl.h b/libutils/include/utils/VectorImpl.h
index 55d5d9818..41b9f3310 100644
--- a/libutils/include/utils/VectorImpl.h
+++ b/libutils/include/utils/VectorImpl.h
@@ -157,7 +157,7 @@ protected:
157 virtual int do_compare(const void* lhs, const void* rhs) const = 0; 157 virtual int do_compare(const void* lhs, const void* rhs) const = 0;
158 158
159private: 159private:
160 ssize_t _indexOrderOf(const void* item, size_t* order = 0) const; 160 ssize_t _indexOrderOf(const void* item, size_t* order = nullptr) const;
161 161
162 // these are made private, because they can't be used on a SortedVector 162 // these are made private, because they can't be used on a SortedVector
163 // (they don't have an implementation either) 163 // (they don't have an implementation either)