static bool
dc_parse_stream (FILE *fp, char const *filename)
{
- size_t line_number = 0;
+ idx_t line_number = 0;
char const *next_G_line = G_line;
char *input_line = nullptr;
size_t input_line_size = 0;
if (arg == nullptr)
{
- error (0, 0, _("%s:%lu: invalid line; missing second token"),
- quotef (filename), (unsigned long int) line_number);
+ error (0, 0, _("%s:%td: invalid line; missing second token"),
+ quotef (filename), line_number);
ok = false;
free (keywd);
continue;
if (unrecognized && (state == ST_TERMSURE || state == ST_TERMYES))
{
- error (0, 0, _("%s:%lu: unrecognized keyword %s"),
+ error (0, 0, _("%s:%td: unrecognized keyword %s"),
(filename ? quotef (filename) : _("<internal>")),
- (unsigned long int) line_number, keywd);
+ line_number, keywd);
ok = false;
}
/* Show the total for each directory (and file if --all) that is at
most MAX_DEPTH levels down from the root of the hierarchy. The root
is at level 0, so 'du --max-depth=0' is equivalent to 'du -s'. */
-static size_t max_depth = SIZE_MAX;
+static idx_t max_depth = IDX_MAX;
/* Only output entries with at least this SIZE if positive,
or at most if negative. See --threshold option. */
case 'd': /* --max-depth=N */
{
- uintmax_t tmp;
- if (xstrtoumax (optarg, nullptr, 0, &tmp, "") == LONGINT_OK
- && tmp <= SIZE_MAX)
+ intmax_t tmp;
+ if (xstrtoimax (optarg, nullptr, 0, &tmp, "") == LONGINT_OK
+ && tmp <= IDX_MAX)
{
max_depth_specified = true;
max_depth = tmp;
if (opt_summarize_only && max_depth_specified && max_depth != 0)
{
- unsigned long int d = max_depth;
- error (0, 0, _("warning: summarizing conflicts with --max-depth=%lu"), d);
+ error (0, 0, _("warning: summarizing conflicts with --max-depth=%td"),
+ max_depth);
usage (EXIT_FAILURE);
}
/* Using the standard 'filename:line-number:' prefix here is
not totally appropriate, since NUL is the separator, not NL,
but it might be better than nothing. */
- unsigned long int file_number = argv_iter_n_args (ai);
- error (0, 0, "%s:%lu: %s", quotef (files_from),
+ idx_t file_number = argv_iter_n_args (ai);
+ error (0, 0, "%s:%td: %s", quotef (files_from),
file_number, _("invalid zero-length file name"));
}
skip_file = true;
/* The above handles --help and --version.
Since there is no other invocation of getopt, handle '--' here. */
- unsigned int u_argc = argc;
- if (1 < u_argc && STREQ (argv[1], "--"))
+ if (1 < argc && STREQ (argv[1], "--"))
{
- --u_argc;
+ --argc;
++argv;
}
- if (u_argc <= 1)
+ if (argc <= 1)
{
error (0, 0, _("missing operand"));
usage (EXPR_INVALID);