From c4e1f5762e604ef37c0523ceb876a135f1377e2b Mon Sep 17 00:00:00 2001 From: Richard Kettlewell Date: Sat, 7 Nov 2015 15:52:20 +0000 Subject: Adopt use of nullptr Modern C++ practice. --- src/Command.cc | 66 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'src/Command.cc') diff --git a/src/Command.cc b/src/Command.cc index f031d8e..17ecb4d 100644 --- a/src/Command.cc +++ b/src/Command.cc @@ -37,35 +37,35 @@ enum { }; const struct option Command::options[] = { - { "help", no_argument, 0, 'h' }, - { "version", no_argument, 0, 'V' }, - { "backup", no_argument, 0, 'b' }, - { "html", required_argument, 0, 'H' }, - { "text", required_argument, 0, 'T' }, - { "email", required_argument, 0, 'e' }, - { "prune", no_argument, 0, 'p' }, - { "prune-incomplete", no_argument, 0, 'P' }, - { "store", required_argument, 0, 's' }, - { "retire-device", no_argument, 0, RETIRE_DEVICE }, - { "retire", no_argument, 0, RETIRE }, - { "config", required_argument, 0, 'c' }, - { "wait", no_argument, 0, 'w' }, - { "force", no_argument, 0, 'f' }, - { "dry-run", no_argument, 0, 'n' }, - { "verbose", no_argument, 0, 'v' }, - { "warn-unknown", no_argument, 0, WARN_UNKNOWN }, - { "warn-store", no_argument, 0, WARN_STORE }, - { "warn-unreachable", no_argument, 0, WARN_UNREACHABLE }, - { "warn-partial", no_argument, 0, WARN_PARTIAL }, - { "no-warn-partial", no_argument, 0, NO_WARN_PARTIAL }, - { "errors", no_argument, 0, REPEAT_ERRORS }, - { "no-errors", no_argument, 0, NO_REPEAT_ERRORS }, - { "warn-all", no_argument, 0, 'W' }, - { "debug", no_argument, 0, 'd' }, - { "logs", required_argument, 0, LOG_VERBOSITY }, - { "dump-config", no_argument, 0, DUMP_CONFIG }, - { "database", required_argument, 0, 'D' }, - { 0, 0, 0, 0 } + { "help", no_argument, nullptr, 'h' }, + { "version", no_argument, nullptr, 'V' }, + { "backup", no_argument, nullptr, 'b' }, + { "html", required_argument, nullptr, 'H' }, + { "text", required_argument, nullptr, 'T' }, + { "email", required_argument, nullptr, 'e' }, + { "prune", no_argument, nullptr, 'p' }, + { "prune-incomplete", no_argument, nullptr, 'P' }, + { "store", required_argument, nullptr, 's' }, + { "retire-device", no_argument, nullptr, RETIRE_DEVICE }, + { "retire", no_argument, nullptr, RETIRE }, + { "config", required_argument, nullptr, 'c' }, + { "wait", no_argument, nullptr, 'w' }, + { "force", no_argument, nullptr, 'f' }, + { "dry-run", no_argument, nullptr, 'n' }, + { "verbose", no_argument, nullptr, 'v' }, + { "warn-unknown", no_argument, nullptr, WARN_UNKNOWN }, + { "warn-store", no_argument, nullptr, WARN_STORE }, + { "warn-unreachable", no_argument, nullptr, WARN_UNREACHABLE }, + { "warn-partial", no_argument, nullptr, WARN_PARTIAL }, + { "no-warn-partial", no_argument, nullptr, NO_WARN_PARTIAL }, + { "errors", no_argument, nullptr, REPEAT_ERRORS }, + { "no-errors", no_argument, nullptr, NO_REPEAT_ERRORS }, + { "warn-all", no_argument, nullptr, 'W' }, + { "debug", no_argument, nullptr, 'd' }, + { "logs", required_argument, nullptr, LOG_VERBOSITY }, + { "dump-config", no_argument, nullptr, DUMP_CONFIG }, + { "database", required_argument, nullptr, 'D' }, + { nullptr, 0, nullptr, 0 } }; Command::Command(): backup(false), @@ -74,9 +74,9 @@ Command::Command(): backup(false), retire(false), retireDevice(false), dumpConfig(false), - html(NULL), - text(NULL), - email(NULL), + html(nullptr), + text(nullptr), + email(nullptr), configPath(DEFAULT_CONFIG), wait(false), act(true), @@ -156,7 +156,7 @@ void Command::parse(int argc, const char *const *argv) { // Parse options optind = 1; while((n = getopt_long(argc, (char *const *)argv, - "+hVbH:T:e:pPs:c:wnfvdWD:", options, 0)) >= 0) { + "+hVbH:T:e:pPs:c:wnfvdWD:", options, nullptr)) >= 0) { switch(n) { case 'h': help(); case 'V': version(); -- cgit v1.2.3