static struct option const long_options[] =
{
- {"decode", no_argument, 0, 'd'},
- {"wrap", required_argument, 0, 'w'},
- {"ignore-garbage", no_argument, 0, 'i'},
+ {"decode", no_argument, NULL, 'd'},
+ {"wrap", required_argument, NULL, 'w'},
+ {"ignore-garbage", no_argument, NULL, 'i'},
#if BASE_TYPE == 42
- {"base64", no_argument, 0, BASE64_OPTION},
- {"base64url", no_argument, 0, BASE64URL_OPTION},
- {"base58", no_argument, 0, BASE58_OPTION},
- {"base32", no_argument, 0, BASE32_OPTION},
- {"base32hex", no_argument, 0, BASE32HEX_OPTION},
- {"base16", no_argument, 0, BASE16_OPTION},
- {"base2msbf", no_argument, 0, BASE2MSBF_OPTION},
- {"base2lsbf", no_argument, 0, BASE2LSBF_OPTION},
- {"z85", no_argument, 0, Z85_OPTION},
+ {"base64", no_argument, NULL, BASE64_OPTION},
+ {"base64url", no_argument, NULL, BASE64URL_OPTION},
+ {"base58", no_argument, NULL, BASE58_OPTION},
+ {"base32", no_argument, NULL, BASE32_OPTION},
+ {"base32hex", no_argument, NULL, BASE32HEX_OPTION},
+ {"base16", no_argument, NULL, BASE16_OPTION},
+ {"base2msbf", no_argument, NULL, BASE2MSBF_OPTION},
+ {"base2lsbf", no_argument, NULL, BASE2LSBF_OPTION},
+ {"z85", no_argument, NULL, Z85_OPTION},
#endif
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
change_file_context (int fd, char const *file)
{
char *file_context = nullptr;
- context_t context IF_LINT (= 0);
+ context_t context IF_LINT (= NULL);
char const * context_string;
int errors = 0;
static bool
is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
{
- while (ancestors != 0)
+ while (ancestors)
{
if (PSAME_INODE (ancestors, sb))
return true;
ss.half_alloc = extra_argc + 2;
ss.extra_argc = extra_argc;
ss.sep = true;
- ss.argv[ss.argc] = 0;
+ ss.argv[ss.argc] = NULL;
/* In the following loop,
'break' causes the character 'newc' to be added to *dest,
static bool
nomoreargs (void)
{
- return *args == 0;
+ return !*args;
}
/* Report missing operand.
static struct mp_factors
mp_no_factors (void)
{
- return (struct mp_factors) {0,};
+ return (struct mp_factors) {NULL,};
}
/* Free storage allocated for FACTORS, making it uninitialized. */
{"color", optional_argument, nullptr, COLOR_OPTION},
{"hyperlink", optional_argument, nullptr, HYPERLINK_OPTION},
{"block-size", required_argument, nullptr, BLOCK_SIZE_OPTION},
- {"context", no_argument, 0, 'Z'},
+ {"context", no_argument, NULL, 'Z'},
{"author", no_argument, nullptr, AUTHOR_OPTION},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
if (pending_dirs)
dired_outbyte ('\n');
}
- else if (n_files <= 1 && pending_dirs && pending_dirs->next == 0)
+ else if (n_files <= 1 && pending_dirs && !pending_dirs->next)
print_dir_name = false;
while (pending_dirs)
int rc = -1;
char *scon_raw = nullptr;
char *tcon_raw = nullptr;
- context_t scontext = 0, tcontext = 0;
+ context_t scontext = NULL, tcontext = NULL;
char const *contype;
char const *constr;
char *newpath = nullptr;
struct stat sb;
char *scon_raw = nullptr;
char *tcon_raw = nullptr;
- context_t scontext = 0, tcontext = 0;
+ context_t scontext = NULL, tcontext = NULL;
char const *contype;
char const *constr;
int fd;
}
else
{
- passname (0, pass_string);
+ passname (NULL, pass_string);
}
/* Set position if first status update */
{"zero-terminated", no_argument, nullptr, 'z'},
{GETOPT_HELP_OPTION_DECL},
{GETOPT_VERSION_OPTION_DECL},
- {0, 0, 0, 0},
+ {NULL, 0, NULL, 0},
};
static void
size_t bytes_to_add = past_end - start;
size_t bytes_available = WRITESIZE - bytes_in_buffer;
- if (start == 0)
+ if (!start)
{
fwrite (buffer, 1, bytes_in_buffer, stdout);
bytes_in_buffer = 0;
}
value = posixtest (nargs);
- if (argv[pos] == 0)
+ if (!argv[pos])
test_syntax_error (_("%s expected"), quote (")"));
else
if (argv[pos][0] != ')' || argv[pos][1])
bool first_group_printed = false;
while (!feof (stdin)
- && readlinebuffer_delim (thisline, stdin, delimiter) != 0)
+ && readlinebuffer_delim (thisline, stdin, delimiter))
{
idx_t thislen;
char *thisfield = find_field (thisline, &thislen);
}
else
{
- if (readlinebuffer_delim (prevline, stdin, delimiter) == 0)
+ if (!readlinebuffer_delim (prevline, stdin, delimiter))
goto closefiles;
idx_t prevlen;
while (!feof (stdin))
{
- if (readlinebuffer_delim (thisline, stdin, delimiter) == 0)
+ if (!readlinebuffer_delim (thisline, stdin, delimiter))
{
if (ferror (stdin))
goto closefiles;