diff options
Diffstat (limited to 'src/uniq.c')
| -rw-r--r-- | src/uniq.c | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/uniq.c b/src/uniq.c index 9044bde87..2b83bccb3 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -93,7 +93,7 @@ enum delimit_method static char const *const delimit_method_string[] = { - "none", "prepend", "separate", NULL + "none", "prepend", "separate", nullptr }; static enum delimit_method const delimit_method_map[] = @@ -124,7 +124,7 @@ enum grouping_method static char const *const grouping_method_string[] = { - "prepend", "append", "separate", "both", NULL + "prepend", "append", "separate", "both", nullptr }; static enum grouping_method const grouping_method_map[] = @@ -141,19 +141,19 @@ enum static struct option const longopts[] = { - {"count", no_argument, NULL, 'c'}, - {"repeated", no_argument, NULL, 'd'}, - {"all-repeated", optional_argument, NULL, 'D'}, - {"group", optional_argument, NULL, GROUP_OPTION}, - {"ignore-case", no_argument, NULL, 'i'}, - {"unique", no_argument, NULL, 'u'}, - {"skip-fields", required_argument, NULL, 'f'}, - {"skip-chars", required_argument, NULL, 's'}, - {"check-chars", required_argument, NULL, 'w'}, - {"zero-terminated", no_argument, NULL, 'z'}, + {"count", no_argument, nullptr, 'c'}, + {"repeated", no_argument, nullptr, 'd'}, + {"all-repeated", optional_argument, nullptr, 'D'}, + {"group", optional_argument, nullptr, GROUP_OPTION}, + {"ignore-case", no_argument, nullptr, 'i'}, + {"unique", no_argument, nullptr, 'u'}, + {"skip-fields", required_argument, nullptr, 'f'}, + {"skip-chars", required_argument, nullptr, 's'}, + {"check-chars", required_argument, nullptr, 'w'}, + {"zero-terminated", no_argument, nullptr, 'z'}, {GETOPT_HELP_OPTION_DECL}, {GETOPT_VERSION_OPTION_DECL}, - {NULL, 0, NULL, 0} + {nullptr, 0, nullptr, 0} }; void @@ -236,7 +236,7 @@ size_opt (char const *opt, char const *msgid) { uintmax_t size; - switch (xstrtoumax (opt, NULL, 10, &size, "")) + switch (xstrtoumax (opt, nullptr, 10, &size, "")) { case LONGINT_OK: case LONGINT_OVERFLOW: @@ -353,7 +353,7 @@ check_file (char const *infile, char const *outfile, char delimiter) */ if (output_unique && output_first_repeated && countmode == count_none) { - char *prevfield = NULL; + char *prevfield = nullptr; size_t prevlen; bool first_group_printed = false; @@ -478,7 +478,7 @@ int main (int argc, char **argv) { int optc = 0; - bool posixly_correct = (getenv ("POSIXLY_CORRECT") != NULL); + bool posixly_correct = (getenv ("POSIXLY_CORRECT") != nullptr); enum Skip_field_option_type skip_field_option_type = SFO_NONE; unsigned int nfiles = 0; char const *file[2]; @@ -511,7 +511,8 @@ main (int argc, char **argv) if (optc == -1 || (posixly_correct && nfiles != 0) || ((optc = getopt_long (argc, argv, - "-0123456789Dcdf:is:uw:z", longopts, NULL)) + "-0123456789Dcdf:is:uw:z", + longopts, nullptr)) == -1)) { if (argc <= optind) @@ -530,7 +531,7 @@ main (int argc, char **argv) uintmax_t size; if (optarg[0] == '+' && ! strict_posix2 () - && xstrtoumax (optarg, NULL, 10, &size, "") == LONGINT_OK + && xstrtoumax (optarg, nullptr, 10, &size, "") == LONGINT_OK && size <= SIZE_MAX) skip_chars = size; else if (nfiles == 2) @@ -577,7 +578,7 @@ main (int argc, char **argv) case 'D': output_unique = false; output_later_repeated = true; - if (optarg == NULL) + if (optarg == nullptr) delimit_groups = DM_NONE; else delimit_groups = XARGMATCH ("--all-repeated", optarg, @@ -587,7 +588,7 @@ main (int argc, char **argv) break; case GROUP_OPTION: - if (optarg == NULL) + if (optarg == nullptr) grouping = GM_SEPARATE; else grouping = XARGMATCH ("--group", optarg, |
