Age | Commit message (Collapse) | Author |
|
(main): Remove unnecessary cast.
|
|
fmt's arbitrary limits.
(TRUE, FALSE): Remove; all uses changed to (true, false).
(main): Use bool for booleans.
Limit maximum width to MAXCHARS / 2. Use xstrtoul, not xstrtol,
to parse width.
(copy_rest): Remove unnecessary cast.
(get_prefix): Rewrite to avoid cast.
(check_punctuation): Use char *, not unsigned char *; C89 requires
this. Avoid off-by-one buffer read overrun when line is empty.
(flush_paragraph): Don't assume wptr-parabuf is <= INT_MAX.
Remove unnecessary casts.
|
|
next_file, expand, main):
Use bool for booleans.
(tab_size, tab_list, add_tabstop, parse_tabstops, validate_tabstops,
expand, main):
Use uintmax_t for column counts.
(add_tabstop): Don't reserve -1 (now UINTMAX_MAX) as a special value.
All callers changed.
(parse_tabstops): Don't pass a negative char to isblank.
Avoid memory leak with large tab stops.
(validate_tabstops, expand): Don't assume number of tab stops is
<= INT_MAX.
(next_file, main): Use EXIT_SUCCESS/EXIT_FAILURE rather than 0/1 when
storing values into exit_status.
(expand): Use same pattern as unexpand for reading chars.
Report an error when input line is too long, instead of silently
screwing up. Do not mishandle tab stops when backspacing left
over start of line.
|
|
dc_parse_stream, dc_parse_file, main): Use bool for booleans.
(dc_parse_stream): Use enum for state, rather than int.
Use ssize_t to store getline result.
|
|
apply_translations, char_is_saved, swab_buffer, skip_via_lseek):
Use bool for booleans.
(translate_buffer): Use to_uchar rather than a cast.
(swab_buffer, copy_simple, copy_with_unblock):
Use size_t for sizes.
|
|
forever, from_start, print_headers, have_read_stdin, valid_file_spec,
write_header, file_lines, pipe_lines, pipe_bytes, recheck,
tail_forever, tail_bytes, tail_lines, tail, tail_file,
parse_obsolescent_option, parse_options, main):
Use bool for booleans.
(struct File_spec, max_n_unchanged_stats_between_opens,
parse_options): Use uintmax_t, not unsigned int or unsigned long int,
for state counters.
(tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to
make it a bit clearer.
|
|
|
|
|
|
(xgethostname): Remove decl; xgethostname.h has it.
(sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO)
&& defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use
prototypes rather than K&R form. Assume any negative value from
sysinfo denotes failure, not just -1.
(main): Simplify use of sethostname.
|
|
include_heading, include_mesg, include_exit, need_boottime,
need_deadprocs, need_login, need_initspawn, need_clockchange,
need_runlevel, need_users, my_line_only, main): Use bool for booleans.
(print_runlevel): Use unsigned char for bytes.
(list_entries_who, scan_entries, who): Use size_t for sizes.
(main): No need to pass a non-NULL last arg to getopt_long.
|
|
(list_entries_users): Use char for bytes.
(main): No need to pass a non-NULL last arg to getopt_long.
|
|
(print_uptime): Remove unused local variable.
(main): No need to pass a non-NULL last arg to getopt_long.
|
|
include_project, include_plan, include_home_and_shell, do_short_format,
include_where, main): Use bool for booleans.
(count_ampersands, create_fullname, scan_entries, short_pinky):
Use size_t for sizes.
(create_fullname): Check for overflow in size calculations.
(idle_string): Don't assume that the number of idle days
is less than 10**8 and/or INT_MAX/(24*60*60).
(main): No need to pass a non-NULL last arg to getopt_long.
|
|
(install_file_to_path): Rely on make_path to fail if the destination
is not a directory, by passing preserve_existing==true to it.
Hence we no longer need to call isdir.
Free dest_dir immediately when it's no longer needed, rather than
waiting until the end of the function.
(copy_file): Don't bother calling isdir, as copy will do the
right thing if the destination is a directory.
|
|
print_grand_total, opt_separate_dirs, hash_ins, process_file, main):
Use bool for booleans.
(max_depth): Now size_t, not int, to avoid an arbitrary limit
of INT_MAX on depth.
(G_fail): Remove: no longer needed, now that the relevant
functions return bool.
(process_file): Use return value to signal success rather than
setting a global. Remove first_call static var; not needed, since
we can look at n_alloc. Use size_t for depths. Remove FIXME
about size_t casts, as it's now fixed. Use xnrealloc rather
than the obsolescent XREALLOC. Don't bother to check whether
reallocation is needed unless level > prev_level.
(du_files): Invert sense of result, for consistency with
other coreutils code. All callers changed.
(main): Allow --max-depth values up to SIZE_MAX.
|
|
show_listed_fs, posix_format, require_sync, print_type,
selected_fstype, excluded_fstype, show_dev, show_point, main):
Use bool for booleans.
(df_readable, show_dev): Use UINTMAX_MAX instead of -1.
(show_dev, show_point, main):
Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
Don't assume disk name lengths are <= INT_MAX.
Rewrite pct calculation to avoid cast.
(show_point): Don't assume resolved length is <= SSIZE_MAX.
|
|
|
|
good as uintptr_t in checking for alignments, and has fewer
configuration hassles.
|
|
(word32): Remove. All uses changed to uint32_t.
(isaac_seed_data): Remove unnecessary cast.
|
|
|
|
undoes part of the 2004-07-27 patch.
|
|
|
|
(is_char_class_member): Use bool when appropriate.
|
|
no longer needed now we assume C89 or better.
Include <inttypes.h> before <stdint.h>, as it's the Autoconf-recommended pattern.
(to_uchar): New inline function, moved here from tr.c.
Use full names for int types, e.g. "long int" rather than "long".
|
|
(IS_THOUSANDS_SEP): Use bool when appropriate.
(numcompare, main): Use char, not int, when the value is always a char.
(numcompare): Remove "register"; compilers are smart enough these days.
|
|
(main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
|
|
|
|
AD_push, prompt, remove_dir): Use bool when appropriate.
(top_dir, pop_dir, full_filename_):
Use size_t for sizes.
|
|
(main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
|
|
cp_option_init, do_move, movefile, main): Likewise.
* src/remove.c (right_justify), full_filename_, AD_pop_and_chdir,
AD_push, prompt, remove_dir): Likewise.
|
|
copy_file, install_file_to_path, install_file_in_dir,
install_file_in_file, strip_files, dir_arg, cp_option_init, main,
change_attributes, change_timestamps): Likewise.
|
|
re_protect, make_path_private, target_directory_operand, do_copy,
cp_option_init, decode_preserve_arg, main): Use bool when appropriate.
(target_directory_operand): Do not clear *NEW_DST if stat
succeeds. It's not necessary in that case, as *NEW_DST is always
false already.
(do_copy): Rewrite slightly to avoid need for "unreachable" comment.
(main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
|
|
|
|
|
|
same_file_ok, seen_file, copy_internal, valid_options, copy):
Use bool when appropriate.
|
|
|
|
Use bool when appropriate.
|
|
|
|
when appropriate.
|
|
bsd_split_3, split_3, hex_digits, digest_file, digest_check, main):
Use bool when appropriate.
(digest_check): Increase limit of number of input lines to
UINTMAX_MAX from INT_MAX. Diagnose any overflows of this counter.
Use ngettext instead of hard-to-i18nize hardcoded stuff for plurals.
|
|
|
|
(ALG_UNSPECIFIED): Remove.
(ALG_MDT): Don't make it equal to CHAR_MAX + 1; this isn't necessary.
|
|
'ok' flag around.
(simple_cat, cat): Return true if successful. All callers changed.
(simple_cat, cat, main): Use bool for booleans.
(simple_cat): Use size_t for sizes.
(cat, main): Use the same names for parameters that we use for
long options, to avoid confusion. This inverts the sense of the
show_tabs (formerly output_tabs) and number_nonblank
(formerly numbers_at_empty_lines) variables.
(main): Don't mess up (due to integer overflow) if we are given
INT_MAX - INT_MIN + 1 options.
[O_BINARY]: Don't invoke isatty unless the other options require it.
(main): When deciding whether to use simple_cat, don't worry
about binary option; it's irrelevant.
|
|
lines from the output strings, to save space.
Use a narrower type like 'unsigned char' for line lengths, if
that will do.
Make the output variables static, not extern.
|
|
|
|
(UINT_MAX_DECIMAL_DIGITS, uint_to_string): Remove.
(gid_to_name, uid_to_name): Use imaxtostr/umaxtostr
instead of uint_to_string).
(describe_change): Instead of an int flag, use a char *
auxiliary; this avoids the need for casts.
Assume free (NULL) works.
(change_file_owner): Return true/false, not 0/-1, since
we don't set errno. All callers changed.
Use bool when appropriate.
(chown_files): Likewise.
|
|
|
|
(main): int -> bool when appropriate.
|
|
|
|
|