diff options
author | Henning Baldersheim <balder@oath.com> | 2018-09-27 14:35:11 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@oath.com> | 2018-09-27 14:35:11 +0200 |
commit | 7fcdb9d9d7de7c3d562839443badcf043380c04e (patch) | |
tree | 81e9ca38faeb27eb353f7af0716311e48b657572 /logd | |
parent | 7b2c641855512aa2823d8c578b941745a4a5aca1 (diff) |
NULL -> nullptr
Diffstat (limited to 'logd')
-rw-r--r-- | logd/src/logd/cmdbuf.cpp | 4 | ||||
-rw-r--r-- | logd/src/logd/perform.cpp | 20 |
2 files changed, 12 insertions, 12 deletions
diff --git a/logd/src/logd/cmdbuf.cpp b/logd/src/logd/cmdbuf.cpp index 37915446f2d..dfe5c5ee3ce 100644 --- a/logd/src/logd/cmdbuf.cpp +++ b/logd/src/logd/cmdbuf.cpp @@ -77,7 +77,7 @@ CmdBuf::extend() _size *= 2; int pos = _bp - _buf; char *nbuf = (char *)realloc(_buf, _size); - if (nbuf == NULL) { + if (nbuf == nullptr) { free(_buf); LOG(error, "could not allocate %d bytes", _size); throw SomethingBad("realloc failed"); @@ -102,7 +102,7 @@ CmdBuf::maybeRead(int fd) FD_ZERO(&fdset); FD_SET(fd, &fdset); - while (select(fd + 1, &fdset, NULL, NULL, ¬ime) > 0) { + while (select(fd + 1, &fdset, nullptr, nullptr, ¬ime) > 0) { // usually loops just once int oflags = fcntl(fd, F_GETFL); int nbflags = oflags | O_NONBLOCK; diff --git a/logd/src/logd/perform.cpp b/logd/src/logd/perform.cpp index fdda358a365..d7d086a26b9 100644 --- a/logd/src/logd/perform.cpp +++ b/logd/src/logd/perform.cpp @@ -103,7 +103,7 @@ ExternalPerformer::doCmd(char *line) if (isPrefix("list states ", line)) { char *servstr = line+5+7; char *compstr = strchr(servstr, ' '); - if (compstr == NULL) { + if (compstr == nullptr) { Service *svc = _services.getService(servstr); CompIter it = svc->_components.iterator(); while (it.valid()) { @@ -118,7 +118,7 @@ ExternalPerformer::doCmd(char *line) } if (isPrefix("setallstates", line)) { char *levmods = strchr(line, ' '); - if (levmods == NULL) { + if (levmods == nullptr) { LOG(error, "bad command: %s", line); } else { char *orig = strdup(line); @@ -131,13 +131,13 @@ ExternalPerformer::doCmd(char *line) if (isPrefix("setstate ", line)) { char *servstr = line + 9; char *compstr = strchr(servstr, ' '); - if (compstr == NULL) { + if (compstr == nullptr) { LOG(error, "bad command: %s", line); return; } *compstr++ = '\0'; char *levmods = strchr(compstr, ' '); - if (levmods == NULL) { + if (levmods == nullptr) { LOG(error, "bad command: %s %s", line, compstr); return; } @@ -145,7 +145,7 @@ ExternalPerformer::doCmd(char *line) Service *svc = _services.getService(servstr); Component *cmp = svc->getComponent(compstr); - if (doSetState(levmods, cmp, line) == NULL) return; + if (doSetState(levmods, cmp, line) == nullptr) return; // maybe ??? listStates(servstr, compstr); @@ -237,7 +237,7 @@ ExternalPerformer::doSetState(char *levmods, Component *cmp, char * line) { if (!newval) { LOG(error, "bad command %s : expected level=value, got %s", line, levmods); - return NULL; + return nullptr; } *newval++ = '\0'; @@ -258,7 +258,7 @@ ExternalPerformer::doSetState(char *levmods, Component *cmp, char * line) { } else { LOG(error, "bad command %s %s=%s: want forward/store/off", line, levmods, newval); - return NULL; + return nullptr; } levmods = nextlev; } @@ -271,20 +271,20 @@ InternalPerformer::doCmd(char *line) if (isPrefix("setstate ", line)){ char *servstr = line + 9; char *compstr = strchr(servstr, ' '); - if (compstr == NULL) { + if (compstr == nullptr) { LOG(error, "bad internal command: %s", line); return; } *compstr++ = '\0'; char *levmods = strchr(compstr, ' '); - if (levmods == NULL) { + if (levmods == nullptr) { LOG(error, "bad internal command: %s %s", line, compstr); return; } *levmods++ = '\0'; // ignore services with slash in the name, invalid - if (strchr(servstr, '/') != NULL) + if (strchr(servstr, '/') != nullptr) return; Service *svc = _services.getService(servstr); |