platform/upstream/coreutils.git
19 years ago(main): Use bool for booleans.
Paul Eggert [Tue, 3 Aug 2004 15:29:48 +0000 (15:29 +0000)]
(main): Use bool for booleans.

19 years ago(FMT_BYTES_ALLOCATED): Now an enum, not a decimal
Paul Eggert [Tue, 3 Aug 2004 14:38:53 +0000 (14:38 +0000)]
(FMT_BYTES_ALLOCATED): Now an enum, not a decimal
constant.  Do not assume PRIdMAX etc. are strings of length 3 or
less.
(struct tspec): Use it.  fmt_string is now an array, not
a pointer, as there's little point to the indirection here.
(struct tspec, flag_dump_strings,
traditional, flag_pseudo_start, limit_bytes_to_format,
abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul,
decode_one_format, open_next_file, check_and_close,
decode_format_string, skip, write_block, read_char, read_block,
parse_old_offset, dump, dump_strings, main):
Use bool for booleans.
(struct tspec): Use void *, not char *, for generic pointers.
(bytes_to_oct_digits, bytes_to_signed_dec_digits,
bytes_to_unsigned_dec_digits, bytes_to_hex_digits):
Use char, not unsigned int, since char suffices.
(print_s_char, print_char, print_s_short, print_short,
print_int, print_long, print_long_long, print_float,
print_double, print_long_double): Rewrite to avoid casts.
These now take void * arguments, instead of char *.
Use the same body for all functions, except for the choice
of type.  Assume C89 to simplify handling of signed char.
(dump_hexl_mode_trailer, print_named_ascii, print_ascii):
Rewrite to avoid casts.
(print_named_ascii, print_ascii): Now takes void *, not char *.
(decode_one_format): Use int for printf field widths, not
unsigned int.  Pass void * to subsidiary printers,
not char *.  Simplify handling of floating-point formats
by factoring out common code dealing with precision and field width.
(decode_format_string): Avoid need for temporary copy of
each decoded struct tspec.
(get_lcm): Remove unnecessary cast.
(main): Fix bug where more than INT_MAX failed decodes were ignored.

19 years agoint cleanups for nl, ln, ls, id, factor, setuidgid, fold, head, csplit, cut,
Paul Eggert [Tue, 3 Aug 2004 07:02:23 +0000 (07:02 +0000)]
int cleanups for nl, ln, ls, id, factor, setuidgid, fold, head, csplit, cut,
date, env, expr.

19 years ago(TRUE, FALSE): Remove; all uses changed to true, false.
Paul Eggert [Tue, 3 Aug 2004 06:59:28 +0000 (06:59 +0000)]
(TRUE, FALSE): Remove; all uses changed to true, false.
(enum number_format): Remove.
(FORMAT_RIGHT_NOLZ, FORMAT_RIGHT_LZ, FORMAT_LEFT): Now strings,
not enum values.
(DEFAULT_SECTION_DELIMITERS): Now an array constant, not a macro.
(section_del): Now const.
(print_fmt): Remove.
(starting_line_number, page_incr, blank_join, line_no,
print_lineno, proc_text, main):
Use intmax_t for line numbers.
(reset_numbers, have_read_stdin, build_type_arg, nl_file, main):
Use bool for booleans.
(lineno_format): Now a string, not an enum value.
(build_print_fmt): Remove.  All calls removed.  This work is
now doen within print_lineno.
(build_type_arg): Use size_t for sizes.
(print_lineno): Check for line number overflow.
(proc_text, main): Remove unnecessary cast.

19 years ago(struct fileinfo, file_interesting,
Paul Eggert [Tue, 3 Aug 2004 06:44:08 +0000 (06:44 +0000)]
(struct fileinfo, file_interesting,
extract_dirs_from_files, color_symlink_as_referent,
FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group,
numeric_ids, print_block_size, dired, print_with_color,
check_symlink_color, print_inode, recursive, immediate_dirs,
all_files, really_all_files, qmark_funny_chars,
print_dir_name, format_needs_stat, format_needs_type, visit_dir,
main, decode_switches, parse_ls_color, print_dir, file_interesting,
gobble_file, make_link_path, basename_is_dot_or_dotdot,
extract_dirs_from_files, print_long_format):
Use bool for booleans.
(dir_defaulted): Remove; no longer needed.
(main): Use int to count files, since it suffices for argv.
Rewrite to avoid need for dir_defaulted.
(main, print_dir, gobble_file, get_link_name,
xstrcoll):
Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1.
(decode_switches): Put back check for ws.ws_col <= SIZE_MAX.
Remove unnecessary cast to int.  Use int instead of unsigned
int to count from 0 to 1.
(get_funky_string, print_type_indicator): Use char for bytes, not int.
(make_link_path): Use NULL for null pointers.
(quote_name): Use to_uchar instead of cast.

19 years ago(symbolic_link, interactive, remove_existing_files,
Paul Eggert [Tue, 3 Aug 2004 06:43:43 +0000 (06:43 +0000)]
(symbolic_link, interactive, remove_existing_files,
verbose, hard_dir_link, dereference_dest_dir_symlinks,
do_link, main): Use bool for booleans.

19 years ago(main): Print uids/gids with %lu, not %ld.
Paul Eggert [Tue, 3 Aug 2004 06:27:33 +0000 (06:27 +0000)]
(main): Print uids/gids with %lu, not %ld.

19 years ago(use_name, main, print_user, xgetgroups, print_group_list,
Paul Eggert [Tue, 3 Aug 2004 06:27:09 +0000 (06:27 +0000)]
(use_name, main, print_user, xgetgroups, print_group_list,
print_full_info): Use bool for booleans.
(problems): Remove, replacing with....
(ok): New var (inverted from old sense).
(print_user, print_group, print_full_info):
Print uids/gids with %lu, not %u.
(xgetgroups): Don't run out of memory if getgroups or getugroups
returns -1.

19 years ago(presume_input_pipe, print_headers, have_read_stdin,
Paul Eggert [Tue, 3 Aug 2004 06:16:31 +0000 (06:16 +0000)]
(presume_input_pipe, print_headers, have_read_stdin,
write_header, elide_tail_bytes_pipe, elide_tail_bytes_file,
elide_tail_lines_pipe, elide_tail_lines_seekable,
elide_tail_lines_file, head_bytes, head_lines, head, head_file,
string_to_integer, main):
Use bool for booleans.
(main): Rewrite to avoid cast.

19 years ago(TAB_WIDTH): New macro; use it instead of "8".
Paul Eggert [Tue, 3 Aug 2004 06:16:05 +0000 (06:16 +0000)]
(TAB_WIDTH): New macro; use it instead of "8".
(fold_file, main): Use bool for booleans.
(fold_file, main): Use size_t for sizes.
(main): Allow -w options up to SIZE_MAX - TAB_WIDTH - 1, instead
of prohibiting widths greater than INT_MAX.

19 years ago(wheel_tab): Use unsigned char instead of unsigned
Paul Eggert [Tue, 3 Aug 2004 06:15:49 +0000 (06:15 +0000)]
(wheel_tab): Use unsigned char instead of unsigned
int, since it suffices.
(factor, print_factors): Use size_t for sizes.
(print_factors, do_stdin, main): Use bool for booleans.

19 years ago(nextarg): Use bool for booleans.
Paul Eggert [Tue, 3 Aug 2004 06:00:24 +0000 (06:00 +0000)]
(nextarg): Use bool for booleans.

19 years ago(main): Use bool for booleans.
Paul Eggert [Tue, 3 Aug 2004 06:00:08 +0000 (06:00 +0000)]
(main): Use bool for booleans.

19 years ago(show_date, rfc_format, batch_convert, main): Use bool for booleans.
Paul Eggert [Tue, 3 Aug 2004 05:59:36 +0000 (05:59 +0000)]
(show_date, rfc_format, batch_convert, main): Use bool for booleans.

19 years ago(cut_fields): Use to_uchar rather than a cast.
Paul Eggert [Tue, 3 Aug 2004 05:59:14 +0000 (05:59 +0000)]
(cut_fields): Use to_uchar rather than a cast.
(cut_file, main): Use bool for booleans.

19 years ago(struct line): Use size_t for sizes.
Paul Eggert [Tue, 3 Aug 2004 05:58:49 +0000 (05:58 +0000)]
(struct line): Use size_t for sizes.
(main): Remove unnecessary cast.

19 years agoint fixes for fmt, expand, dircolors, dd, seq, sleep, tail, hostname,
Paul Eggert [Tue, 3 Aug 2004 00:05:23 +0000 (00:05 +0000)]
int fixes for fmt, expand, dircolors, dd, seq, sleep, tail, hostname,
pinky, uptime, users, who, install, du, df.

19 years ago(wide-1, wide-2, bad-suffix): Adjust to today's fmt.c fixes.
Paul Eggert [Tue, 3 Aug 2004 00:03:57 +0000 (00:03 +0000)]
(wide-1, wide-2, bad-suffix): Adjust to today's fmt.c fixes.

19 years ago(COST, MAXWORDS): Add a comment describing some of
Paul Eggert [Tue, 3 Aug 2004 00:00:49 +0000 (00:00 +0000)]
(COST, MAXWORDS): Add a comment describing some of
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.

19 years ago(convert_entire_line, have_read_stdin, parse_tabstops,
Paul Eggert [Mon, 2 Aug 2004 23:49:31 +0000 (23:49 +0000)]
(convert_entire_line, have_read_stdin, parse_tabstops,
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.

19 years ago(have_read_stdin, append_quoted,
Paul Eggert [Mon, 2 Aug 2004 23:36:33 +0000 (23:36 +0000)]
(have_read_stdin, append_quoted,
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.

19 years ago(translation_needed, parse_integer, scanargs,
Paul Eggert [Mon, 2 Aug 2004 23:29:39 +0000 (23:29 +0000)]
(translation_needed, parse_integer, scanargs,
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.

19 years agoInclude limits.h, stdbool.h.
Paul Eggert [Mon, 2 Aug 2004 23:00:15 +0000 (23:00 +0000)]
Include limits.h, stdbool.h.
(CHAR_BIT): Remove.
(timespec_subtract, xnanosleep): Use bool for booleans.

19 years agounsigned -> unsigned int
Paul Eggert [Mon, 2 Aug 2004 22:59:41 +0000 (22:59 +0000)]
unsigned -> unsigned int

19 years agounsigned -> unsigned int
Paul Eggert [Mon, 2 Aug 2004 22:58:22 +0000 (22:58 +0000)]
unsigned -> unsigned int

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 22:57:37 +0000 (22:57 +0000)]
Include <stdbool.h>.
(yesno): Return bool, not int.

19 years agoInclude yesno.h first.
Paul Eggert [Mon, 2 Aug 2004 22:57:13 +0000 (22:57 +0000)]
Include yesno.h first.
(yesno): Return bool, not int.

19 years ago(errno): Remove decl; we now assume C89 or better.
Paul Eggert [Mon, 2 Aug 2004 22:56:56 +0000 (22:56 +0000)]
(errno): Remove decl; we now assume C89 or better.
(__xstrtol): Rewrite to avoid casts.

19 years agoJust include xstrtol.h rather than rolling our own include pattern.
Paul Eggert [Mon, 2 Aug 2004 22:55:59 +0000 (22:55 +0000)]
Just include xstrtol.h rather than rolling our own include pattern.

19 years agoJust include xstrtol.h rather than rolling our own include pattern.
Paul Eggert [Mon, 2 Aug 2004 22:55:32 +0000 (22:55 +0000)]
Just include xstrtol.h rather than rolling our own include pattern.

19 years agoLog today's int-related changes
Paul Eggert [Mon, 2 Aug 2004 22:55:12 +0000 (22:55 +0000)]
Log today's int-related changes

19 years ago(version_etc_va): Use size_t for sizes.
Paul Eggert [Mon, 2 Aug 2004 22:54:36 +0000 (22:54 +0000)]
(version_etc_va): Use size_t for sizes.

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 22:54:15 +0000 (22:54 +0000)]
Include <stdbool.h>.
(same_name): Return bool, not int.

19 years ago(errno): Remove decl; we now assume C89 or better.
Paul Eggert [Mon, 2 Aug 2004 22:53:41 +0000 (22:53 +0000)]
(errno): Remove decl; we now assume C89 or better.
(same_name): Return bool, not int.

19 years agoRewrite to avoid casts.
Paul Eggert [Mon, 2 Aug 2004 22:52:39 +0000 (22:52 +0000)]
Rewrite to avoid casts.

19 years agoInclude stdbool.h.
Paul Eggert [Mon, 2 Aug 2004 22:52:17 +0000 (22:52 +0000)]
Include stdbool.h.
(quotearg_buffer_restyled): Use bool for booleans.

19 years agonanosleep.c (errno): Remove decl; we now assume C89 or better.
Paul Eggert [Mon, 2 Aug 2004 22:51:56 +0000 (22:51 +0000)]
nanosleep.c (errno): Remove decl; we now assume C89 or better.
Include stdbool.h.
(rpl_nanosleep): Usee bool for booleans.

19 years agoUse Autoconf-suggested pattern for inttypes and stdint.
Paul Eggert [Mon, 2 Aug 2004 22:51:09 +0000 (22:51 +0000)]
Use Autoconf-suggested pattern for inttypes and stdint.

19 years agoUpdate copyright.
Paul Eggert [Mon, 2 Aug 2004 22:50:47 +0000 (22:50 +0000)]
Update copyright.

19 years agoUse Autoconf-suggested pattern for inttypes and stdint.
Paul Eggert [Mon, 2 Aug 2004 22:50:29 +0000 (22:50 +0000)]
Use Autoconf-suggested pattern for inttypes and stdint.

19 years agoUse Autoconf-suggested pattern for inttypes and stdint.
Paul Eggert [Mon, 2 Aug 2004 22:49:58 +0000 (22:49 +0000)]
Use Autoconf-suggested pattern for inttypes and stdint.

19 years ago(hash_string): Rewrite to avoid cast.
Paul Eggert [Mon, 2 Aug 2004 22:49:34 +0000 (22:49 +0000)]
(hash_string): Rewrite to avoid cast.

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 22:49:12 +0000 (22:49 +0000)]
Include <stdbool.h>.
(hard_locale): Return bool, not int.

19 years agohard-locale.c (hard_locale): Return bool, not int.
Paul Eggert [Mon, 2 Aug 2004 22:48:49 +0000 (22:48 +0000)]
hard-locale.c (hard_locale): Return bool, not int.

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 22:48:05 +0000 (22:48 +0000)]
Include <stdbool.h>.
(getloadavg_initialized): Use bool for booleans.

19 years ago(lookup_word): Rewrite to avoid cast.
Paul Eggert [Mon, 2 Aug 2004 22:47:44 +0000 (22:47 +0000)]
(lookup_word): Rewrite to avoid cast.

19 years ago(textutils_fileblocks_unused): Make it a typedef
Paul Eggert [Mon, 2 Aug 2004 22:47:25 +0000 (22:47 +0000)]
(textutils_fileblocks_unused): Make it a typedef
instead of an int, to save a few bytes in the object file.

19 years agoUpdate copyright.
Paul Eggert [Mon, 2 Aug 2004 22:47:00 +0000 (22:47 +0000)]
Update copyright.

19 years ago(enum canonicalize_mode_t): Reformat comments to fit in 80 columns.
Paul Eggert [Mon, 2 Aug 2004 22:42:37 +0000 (22:42 +0000)]
(enum canonicalize_mode_t): Reformat comments to fit in 80 columns.

19 years ago(errno): Remove decl; we now assume C89 or better.
Paul Eggert [Mon, 2 Aug 2004 22:41:37 +0000 (22:41 +0000)]
(errno): Remove decl; we now assume C89 or better.

19 years ago(struct File_spec, reopen_inaccessible_files, count_lines,
Paul Eggert [Mon, 2 Aug 2004 22:20:24 +0000 (22:20 +0000)]
(struct File_spec, reopen_inaccessible_files, count_lines,
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.

19 years ago(apply_suffix): Use bool for booleans.
Paul Eggert [Mon, 2 Aug 2004 22:19:27 +0000 (22:19 +0000)]
(apply_suffix):  Use bool for booleans.

19 years ago(equal_width, valid_format, main): Use bool for booleans.
Paul Eggert [Mon, 2 Aug 2004 22:19:01 +0000 (22:19 +0000)]
(equal_width, valid_format, main): Use bool for booleans.

19 years ago(xstrtod): Return bool, not int. Invert the sense of the boolean.
Paul Eggert [Mon, 2 Aug 2004 22:18:32 +0000 (22:18 +0000)]
(xstrtod): Return bool, not int.  Invert the sense of the boolean.
All uses changed.

19 years ago(xstrtod): Return bool, not int. Invert the sense of the boolean.
Paul Eggert [Mon, 2 Aug 2004 22:17:42 +0000 (22:17 +0000)]
(xstrtod): Return bool, not int.  Invert the sense of the boolean.
All uses changed.

19 years agoInclude "xgethostname.h".
Paul Eggert [Mon, 2 Aug 2004 21:52:28 +0000 (21:52 +0000)]
Include "xgethostname.h".
(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.

19 years agoDon't include <sys/types.h> or "exit.h"; no longer needed.
Paul Eggert [Mon, 2 Aug 2004 21:52:07 +0000 (21:52 +0000)]
Don't include <sys/types.h> or "exit.h"; no longer needed.
(errno): Remove decl; we now assume C89 or better.
Include unistd.h if available, for gethostname.
(ENAMETOOLONG): Define to 0, not 9999, to avoid colliding with
existing errno values if any.
(gethostname): Remove decl, since unistd.h declares it (or doesn't,
in which case it's an older system and it should just work).
(xgethostname): Don't assume host name length is less than INT_MAX.
Exit if malloc fails, just as the comment says.

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 21:06:22 +0000 (21:06 +0000)]
Include <stdbool.h>.
(errno): Remove decl; we now assume C89 or better.
(save_cwd): Use bool for booleans.
(save_cwd, restore_cwd): Return -1 on failure, not 1, since we set
errno on failure.

19 years ago(do_lookup, short_list, short_output, include_idle,
Paul Eggert [Mon, 2 Aug 2004 20:56:46 +0000 (20:56 +0000)]
(do_lookup, short_list, short_output, include_idle,
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.

19 years ago(list_entries_users, users): Use size_t for sizes.
Paul Eggert [Mon, 2 Aug 2004 20:56:30 +0000 (20:56 +0000)]
(list_entries_users, users): Use size_t for sizes.
(list_entries_users): Use char for bytes.
(main): No need to pass a non-NULL last arg to getopt_long.

19 years ago(print_uptime, uptime): Use size_t for sizes.
Paul Eggert [Mon, 2 Aug 2004 20:56:10 +0000 (20:56 +0000)]
(print_uptime, uptime): Use size_t for sizes.
(print_uptime): Remove unused local variable.
(main): No need to pass a non-NULL last arg to getopt_long.

19 years ago(include_idle, include_heading, include_fullname,
Paul Eggert [Mon, 2 Aug 2004 20:55:44 +0000 (20:55 +0000)]
(include_idle, include_heading, include_fullname,
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.

19 years ago(read_utmp): Don't assume that the number of users is less than INT_MAX.
Paul Eggert [Mon, 2 Aug 2004 20:55:14 +0000 (20:55 +0000)]
(read_utmp): Don't assume that the number of users is less than INT_MAX.
Check for integer overflow in size calculations.
Return -1 (not 1) on failure, since we set errno in that case.

19 years ago(UT_USER): Parenthesize properly.
Paul Eggert [Mon, 2 Aug 2004 20:54:45 +0000 (20:54 +0000)]
(UT_USER): Parenthesize properly.
(UT_USER_SIZE): New constant.
(read_utmp): Don't assume that the number of users is less than
INT_MAX.

19 years ago(posix_time_parse): Don't assume that the length of
Paul Eggert [Mon, 2 Aug 2004 20:34:27 +0000 (20:34 +0000)]
(posix_time_parse): Don't assume that the length of
the string being parsed is <= UINT_MAX.

19 years ago(read_file_system_list): Accept bool flag, not int.
Paul Eggert [Mon, 2 Aug 2004 20:27:45 +0000 (20:27 +0000)]
(read_file_system_list): Accept bool flag, not int.
(errno): Remove decl; we now assume C89 or better.
(xatoi): Remove; replaced by strtoul.  Hence device numbers can now
go up to ULONG_MAX.

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 20:27:16 +0000 (20:27 +0000)]
Include <stdbool.h>.
(read_file_system_list): Accept bool flag, not int.

19 years agoRegenerate.
Paul Eggert [Mon, 2 Aug 2004 20:17:31 +0000 (20:17 +0000)]
Regenerate.

19 years agoNo longer needed by 'install', so remove it.
Paul Eggert [Mon, 2 Aug 2004 20:15:49 +0000 (20:15 +0000)]
No longer needed by 'install', so remove it.

19 years ago(libfetish_a_SOURCES): Remove isdir.c.
Paul Eggert [Mon, 2 Aug 2004 20:14:53 +0000 (20:14 +0000)]
(libfetish_a_SOURCES): Remove isdir.c.

19 years ago(isdir): Remove decl.
Paul Eggert [Mon, 2 Aug 2004 20:14:39 +0000 (20:14 +0000)]
(isdir): Remove decl.
(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.

19 years ago(fts_debug, opt_all, apparent_size, opt_count_all,
Paul Eggert [Mon, 2 Aug 2004 19:43:38 +0000 (19:43 +0000)]
(fts_debug, opt_all, apparent_size, opt_count_all,
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.

19 years agoAdd an FSF copyright notice, since our changes are becoming nontrivial.
Paul Eggert [Mon, 2 Aug 2004 19:42:01 +0000 (19:42 +0000)]
Add an FSF copyright notice, since our changes are becoming nontrivial.
Include stdint.h if available, as Autoconf suggests.
(ALIGNBYTES, ALIGN): Remove; no longer needed now that fts_statp
is an array.
(fts_alloc, fts_palloc, fts_sort, fts_load, fts_build):
Use size_t for sizes.
(fts_stat, fts_safe_changedir, fts_debug, fts_read, fts_build,
fts_palloc):
Use bool when appropriate.
(SIZE_MAX, TYPE_SIGNED): New macros.
(fts_read): Use u_short for instructions.
(fts_build): Use ptrdiff_t for levels.  Don't assume file name lengths
fit into int.  Don't assume nlink_t is signed.
(find_matching_ancestor): Don't assume dev, ino fit in int.
(fts_stat): Use function prototype; required for bool arg.
(fts_sort): Detect integer overflow in size calculations.
(fts_alloc): Simplify allocation code, now that fts_statp is an array
and not a pointer.

19 years agoAdd an FSF copyright notice, since our changes are becoming nontrivial.
Paul Eggert [Mon, 2 Aug 2004 19:41:35 +0000 (19:41 +0000)]
Add an FSF copyright notice, since our changes are becoming nontrivial.
Include stddef.h, for ptrdiff_t.
(FTS.fts_nitems): Now size_t, not int, for hosts that allow more
than INT_MAX entries in a directory.
(FTS_ROOTPARENTLEVEL): Parenthesize properly.
(FTSENT.fts_level): Now ptrdiff_t, not int, to allow recursing more
than INT_MAX levels deep on 64-bit hosts.
(FTSENT.fts_namelen): Now size_t, not u_short, to support hosts like
the Hurd that don't have arbitrary limits on directory entry lengths.
(FTSENT.fts_statp): Now an array, not a pointer, so that we don't
have to play unportable games with pointer arithmetic.  Keep it array
for the benefit of user code that assumes it is a pointer.

19 years agoUse Autoconf-suggested pattern for inttypes and stdint.
Paul Eggert [Mon, 2 Aug 2004 18:44:11 +0000 (18:44 +0000)]
Use Autoconf-suggested pattern for inttypes and stdint.
Include unistd.h, for lseek.

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 18:43:56 +0000 (18:43 +0000)]
Include <stdbool.h>.
(struct fs_usage): Use uintmax_t for block sizes, so that they're
not limited to INT_MAX.
Use bool for booleans.

19 years ago(inode_format, show_all_fs, show_local_fs,
Paul Eggert [Mon, 2 Aug 2004 18:43:35 +0000 (18:43 +0000)]
(inode_format, show_all_fs, show_local_fs,
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.

19 years ago(EXT): Use size_t for sizes, not ptrdiff_t, so that we don't have
Paul Eggert [Mon, 2 Aug 2004 18:21:05 +0000 (18:21 +0000)]
(EXT): Use size_t for sizes, not ptrdiff_t, so that we don't have
to worry about wraparound.

19 years agofnmatch_loop.c (EXT, FCT): Use bool when appropriate.
Paul Eggert [Mon, 2 Aug 2004 18:10:55 +0000 (18:10 +0000)]
fnmatch_loop.c (EXT, FCT): Use bool when appropriate.
(FCT): Use size_t, not unsigned int, for sizes.
(EXT): Use ptrdiff_t, not int, for a variable that has to
store a size-related quantity but might go negative.
ptrdiff_t is good enough here, since in practice the value
can't exceed SIZE_MAX/2.

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 18:10:35 +0000 (18:10 +0000)]
Include <stdbool.h>.
(errno): Remove decl; we now assume C89 or better.

19 years ago(strip_trailing_slashes): Now returns bool.
Paul Eggert [Mon, 2 Aug 2004 17:33:57 +0000 (17:33 +0000)]
(strip_trailing_slashes): Now returns bool.

19 years ago(dir_name): Use bool when appropriate.
Paul Eggert [Mon, 2 Aug 2004 17:33:37 +0000 (17:33 +0000)]
(dir_name): Use bool when appropriate.

19 years agoInclude <stdbool.h>.
Paul Eggert [Mon, 2 Aug 2004 17:33:24 +0000 (17:33 +0000)]
Include <stdbool.h>.
(strip_trailing_slashes): Now returns bool.

19 years ago(argmatch, __xargmatch_internal, argmatch_invalid):
Paul Eggert [Mon, 2 Aug 2004 17:24:00 +0000 (17:24 +0000)]
(argmatch, __xargmatch_internal, argmatch_invalid):
Use ptrdiff_t, not int, when counting arguments, to allow more
than INT_MAX arguments.
Use bool when appropriate.

19 years ago(argmatch, __xargmatch_internal, argmatch_invalid):
Paul Eggert [Mon, 2 Aug 2004 17:23:19 +0000 (17:23 +0000)]
(argmatch, __xargmatch_internal, argmatch_invalid):
Use ptrdiff_t, not int, when counting arguments, to allow more
than INT_MAX arguments.

19 years agoInstall safe-read fix for blocksizes greater than 2**31.
Paul Eggert [Mon, 2 Aug 2004 05:56:14 +0000 (05:56 +0000)]
Install safe-read fix for blocksizes greater than 2**31.

19 years ago(errno): Remove decl; we now assume C89 or better.
Paul Eggert [Mon, 2 Aug 2004 05:55:54 +0000 (05:55 +0000)]
(errno): Remove decl; we now assume C89 or better.
(safe_rw): Don't work around Tru64 bug unless the bug symptoms
manifest themselves.  This allows us to do proper reads and writes
on other hosts, e.g., "dd" with a block size greater than 2**31.

19 years agoRegenerate.
Paul Eggert [Mon, 2 Aug 2004 05:30:48 +0000 (05:30 +0000)]
Regenerate.

19 years agoRegenerate.
Paul Eggert [Mon, 2 Aug 2004 05:29:29 +0000 (05:29 +0000)]
Regenerate.

19 years agoInitial revision
Paul Eggert [Mon, 2 Aug 2004 05:28:02 +0000 (05:28 +0000)]
Initial revision

19 years agouintptr_t and uint32_t port to Solaris 8.
Paul Eggert [Mon, 2 Aug 2004 05:26:59 +0000 (05:26 +0000)]
uintptr_t and uint32_t port to Solaris 8.

19 years ago(ptr_align): Use size_t; in practice, this is just as
Paul Eggert [Mon, 2 Aug 2004 05:26:19 +0000 (05:26 +0000)]
(ptr_align): Use size_t; in practice, this is just as
good as uintptr_t in checking for alignments, and has fewer
configuration hassles.

19 years ago(UINT_MAX_32_BITS): Remove.
Paul Eggert [Mon, 2 Aug 2004 05:26:01 +0000 (05:26 +0000)]
(UINT_MAX_32_BITS): Remove.
(word32): Remove.  All uses changed to uint32_t.
(isaac_seed_data): Remove unnecessary cast.

19 years ago(hash_int) [!defined UINTPTR_MAX]: Use size_t instead of uintptr_t.
Paul Eggert [Mon, 2 Aug 2004 05:25:33 +0000 (05:25 +0000)]
(hash_int) [!defined UINTPTR_MAX]: Use size_t instead of uintptr_t.

19 years agoInitial revision.
Paul Eggert [Mon, 2 Aug 2004 05:24:47 +0000 (05:24 +0000)]
Initial revision.

19 years ago(gl_MD5): Require gl_AC_TYPE_UINT32_T.
Paul Eggert [Mon, 2 Aug 2004 05:23:39 +0000 (05:23 +0000)]
(gl_MD5): Require gl_AC_TYPE_UINT32_T.

19 years ago(gl_CHECK_ALL_TYPES):
Paul Eggert [Mon, 2 Aug 2004 05:22:57 +0000 (05:22 +0000)]
(gl_CHECK_ALL_TYPES):
Require gl_AC_TYPE_UINTPTR_T instead of using AC_CHECK_TYPE
on uintptr_t.  Require gl_AC_TYPE_UINT32_T.

19 years ago(UNALIGNED_P): Use size_t; in practice, this is just as
Paul Eggert [Mon, 2 Aug 2004 05:22:22 +0000 (05:22 +0000)]
(UNALIGNED_P): Use size_t; in practice, this is just as
good as uintptr_t in checking for alignments, and has fewer
configuration hassles.

19 years agoDon't include inttypes.h or stdint.h.
Paul Eggert [Mon, 2 Aug 2004 05:21:47 +0000 (05:21 +0000)]
Don't include inttypes.h or stdint.h.
(UNALIGNED_P): Remove.
(__memrchr): Use size_t, not uintptr_t, to test alignment.

19 years agoDon't include inttypes.h or stdint.h.
Paul Eggert [Mon, 2 Aug 2004 05:21:12 +0000 (05:21 +0000)]
Don't include inttypes.h or stdint.h.
(UNALIGNED_P): Remove.
(__memchr): Use size_t, not uintptr_t, to test alignment.