clang-tidy modernize-use-nullptr

This commit is contained in:
Daniel Agar
2017-01-28 20:21:58 -05:00
parent ec2467d4a5
commit e927f3e040
48 changed files with 155 additions and 153 deletions
+6 -6
View File
@@ -268,12 +268,12 @@ void Logger::run_trampoline(int argc, char *argv[])
int myoptind = 1;
int ch;
const char *myoptarg = NULL;
const char *myoptarg = nullptr;
while ((ch = px4_getopt(argc, argv, "r:b:etfm:q:", &myoptind, &myoptarg)) != EOF) {
switch (ch) {
case 'r': {
unsigned long r = strtoul(myoptarg, NULL, 10);
unsigned long r = strtoul(myoptarg, nullptr, 10);
if (r <= 0) {
r = 1e6;
@@ -288,7 +288,7 @@ void Logger::run_trampoline(int argc, char *argv[])
break;
case 'b': {
unsigned long s = strtoul(myoptarg, NULL, 10);
unsigned long s = strtoul(myoptarg, nullptr, 10);
if (s < 1) {
s = 1;
@@ -325,7 +325,7 @@ void Logger::run_trampoline(int argc, char *argv[])
break;
case 'q':
queue_size = strtoul(myoptarg, NULL, 10);
queue_size = strtoul(myoptarg, nullptr, 10);
if (queue_size == 0) {
queue_size = 1;
@@ -586,7 +586,7 @@ int Logger::add_topics_from_file(const char *fname)
/* open the topic list file */
fp = fopen(fname, "r");
if (fp == NULL) {
if (fp == nullptr) {
return -1;
}
@@ -596,7 +596,7 @@ int Logger::add_topics_from_file(const char *fname)
/* get a line, bail on error/EOF */
line[0] = '\0';
if (fgets(line, sizeof(line), fp) == NULL) {
if (fgets(line, sizeof(line), fp) == nullptr) {
break;
}