summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Kong2018-07-16 20:11:34 -0500
committerYi Kong2018-07-16 20:11:34 -0500
commite1731a4f2e05f1abb4a45602067708851eaf1e14 (patch)
tree339c0ce3d3de7d6f5e0fb9bdada9b6210d1d470f /libutils/Printer.cpp
parent895acebe946e34d2626716c5c4d7d7f2cc28c39d (diff)
downloadplatform-system-core-e1731a4f2e05f1abb4a45602067708851eaf1e14.tar.gz
platform-system-core-e1731a4f2e05f1abb4a45602067708851eaf1e14.tar.xz
platform-system-core-e1731a4f2e05f1abb4a45602067708851eaf1e14.zip
[libutils] Modernize codebase by replacing NULL with nullptr
Fixes -Wzero-as-null-pointer-constant warning. Test: m Bug: 68236239 Change-Id: I5e89ec8c42151875439d2656475a8739ab9cb7dc
Diffstat (limited to 'libutils/Printer.cpp')
-rw-r--r--libutils/Printer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libutils/Printer.cpp b/libutils/Printer.cpp
index cbf042eb5..c9ae210ba 100644
--- a/libutils/Printer.cpp
+++ b/libutils/Printer.cpp
@@ -73,7 +73,7 @@ LogPrinter::LogPrinter(const char* logtag,
73} 73}
74 74
75void LogPrinter::printLine(const char* string) { 75void LogPrinter::printLine(const char* string) {
76 if (string == NULL) { 76 if (string == nullptr) {
77 ALOGW("%s: NULL string passed in", __FUNCTION__); 77 ALOGW("%s: NULL string passed in", __FUNCTION__);
78 return; 78 return;
79 } 79 }
@@ -107,7 +107,7 @@ FdPrinter::FdPrinter(int fd, unsigned int indent, const char* prefix) :
107} 107}
108 108
109void FdPrinter::printLine(const char* string) { 109void FdPrinter::printLine(const char* string) {
110 if (string == NULL) { 110 if (string == nullptr) {
111 ALOGW("%s: NULL string passed in", __FUNCTION__); 111 ALOGW("%s: NULL string passed in", __FUNCTION__);
112 return; 112 return;
113 } else if (mFd < 0) { 113 } else if (mFd < 0) {
@@ -127,16 +127,16 @@ String8Printer::String8Printer(String8* target, const char* prefix) :
127 mTarget(target), 127 mTarget(target),
128 mPrefix(prefix ?: "") { 128 mPrefix(prefix ?: "") {
129 129
130 if (target == NULL) { 130 if (target == nullptr) {
131 ALOGW("%s: Target string was NULL", __FUNCTION__); 131 ALOGW("%s: Target string was NULL", __FUNCTION__);
132 } 132 }
133} 133}
134 134
135void String8Printer::printLine(const char* string) { 135void String8Printer::printLine(const char* string) {
136 if (string == NULL) { 136 if (string == nullptr) {
137 ALOGW("%s: NULL string passed in", __FUNCTION__); 137 ALOGW("%s: NULL string passed in", __FUNCTION__);
138 return; 138 return;
139 } else if (mTarget == NULL) { 139 } else if (mTarget == nullptr) {
140 ALOGW("%s: Target string was NULL", __FUNCTION__); 140 ALOGW("%s: Target string was NULL", __FUNCTION__);
141 return; 141 return;
142 } 142 }