Commit Graph
19097 Commits
Author SHA1 Message Date
Paul Eggert a4e2377f60 Just include xstrtol.h rather than rolling our own include pattern. 2004-08-02 22:55:59 +00:00
Paul Eggert dc44675984 Just include xstrtol.h rather than rolling our own include pattern. 2004-08-02 22:55:32 +00:00
Paul Eggert 965de5df36 Log today's int-related changes 2004-08-02 22:55:12 +00:00
Paul Eggert 596f9e22e1 (version_etc_va): Use size_t for sizes. 2004-08-02 22:54:36 +00:00
Paul Eggert 325ec4052e Include <stdbool.h>.
(same_name): Return bool, not int.
2004-08-02 22:54:15 +00:00
Paul Eggert f8a0187525 (errno): Remove decl; we now assume C89 or better.
(same_name): Return bool, not int.
2004-08-02 22:53:41 +00:00
Paul Eggert 7fed0a985b Rewrite to avoid casts. 2004-08-02 22:52:39 +00:00
Paul Eggert f9bbf56c51 Include stdbool.h.
(quotearg_buffer_restyled): Use bool for booleans.
2004-08-02 22:52:17 +00:00
Paul Eggert cd24faad5f nanosleep.c (errno): Remove decl; we now assume C89 or better.
Include stdbool.h.
(rpl_nanosleep): Usee bool for booleans.
2004-08-02 22:51:56 +00:00
Paul Eggert 24cdab4d1a Use Autoconf-suggested pattern for inttypes and stdint. 2004-08-02 22:51:09 +00:00
Paul Eggert 58907a1ee9 Update copyright. 2004-08-02 22:50:47 +00:00
Paul Eggert c04045506d Use Autoconf-suggested pattern for inttypes and stdint. 2004-08-02 22:50:29 +00:00
Paul Eggert 75d42c8224 Use Autoconf-suggested pattern for inttypes and stdint. 2004-08-02 22:49:58 +00:00
Paul Eggert d5905bb653 (hash_string): Rewrite to avoid cast. 2004-08-02 22:49:34 +00:00
Paul Eggert 28730b8b36 Include <stdbool.h>.
(hard_locale): Return bool, not int.
2004-08-02 22:49:12 +00:00
Paul Eggert ecb7230885 hard-locale.c (hard_locale): Return bool, not int. 2004-08-02 22:48:49 +00:00
Paul Eggert 21e7da65ea Include <stdbool.h>.
(getloadavg_initialized): Use bool for booleans.
2004-08-02 22:48:05 +00:00
Paul Eggert a3b96dbd55 (lookup_word): Rewrite to avoid cast. 2004-08-02 22:47:44 +00:00
Paul Eggert e9d449928d (textutils_fileblocks_unused): Make it a typedef
instead of an int, to save a few bytes in the object file.
2004-08-02 22:47:25 +00:00
Paul Eggert 632f0144b2 Update copyright. 2004-08-02 22:47:00 +00:00
Paul Eggert f4afb6798d (enum canonicalize_mode_t): Reformat comments to fit in 80 columns. 2004-08-02 22:42:37 +00:00
Paul Eggert fd0ca86dd2 (errno): Remove decl; we now assume C89 or better. 2004-08-02 22:41:37 +00:00
Paul Eggert 2b9bdc6ee0 (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.
2004-08-02 22:20:24 +00:00
Paul Eggert 9d581705a7 (apply_suffix): Use bool for booleans. 2004-08-02 22:19:27 +00:00
Paul Eggert 76a844a9c3 (equal_width, valid_format, main): Use bool for booleans. 2004-08-02 22:19:01 +00:00
Paul Eggert 61c0c553f8 (xstrtod): Return bool, not int. Invert the sense of the boolean.
All uses changed.
2004-08-02 22:18:32 +00:00
Paul Eggert a43efc5f75 (xstrtod): Return bool, not int. Invert the sense of the boolean.
All uses changed.
2004-08-02 22:17:42 +00:00
Paul Eggert 98d2fbe280 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.
2004-08-02 21:52:28 +00:00
Paul Eggert c87d825fd3 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.
2004-08-02 21:52:07 +00:00
Paul Eggert 27454c431f 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.
2004-08-02 21:06:22 +00:00
Paul Eggert d0cbf9ff71 (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.
2004-08-02 20:56:46 +00:00
Paul Eggert 889b25b472 (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.
2004-08-02 20:56:30 +00:00
Paul Eggert 67f5163d28 (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.
2004-08-02 20:56:10 +00:00
Paul Eggert ea81db5369 (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.
2004-08-02 20:55:44 +00:00
Paul Eggert 838af3f618 (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.
2004-08-02 20:55:14 +00:00
Paul Eggert 6517d85e05 (UT_USER): Parenthesize properly.
(UT_USER_SIZE): New constant.
(read_utmp): Don't assume that the number of users is less than
INT_MAX.
2004-08-02 20:54:45 +00:00
Paul Eggert e71e29e309 (posix_time_parse): Don't assume that the length of
the string being parsed is <= UINT_MAX.
2004-08-02 20:34:27 +00:00
Paul Eggert 25d291e3ec (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.
2004-08-02 20:27:45 +00:00
Paul Eggert d1ee2543c7 Include <stdbool.h>.
(read_file_system_list): Accept bool flag, not int.
2004-08-02 20:27:16 +00:00
Paul Eggert df3b48143b Regenerate. 2004-08-02 20:17:31 +00:00
Paul Eggert 7bb8bcf375 No longer needed by 'install', so remove it. 2004-08-02 20:15:49 +00:00
Paul Eggert def5c89707 (libfetish_a_SOURCES): Remove isdir.c. 2004-08-02 20:14:53 +00:00
Paul Eggert 1dfc8b472e (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.
2004-08-02 20:14:39 +00:00
Paul Eggert e4d5fc2283 (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.
2004-08-02 19:43:38 +00:00
Paul Eggert c1bbe24045 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.
2004-08-02 19:42:01 +00:00
Paul Eggert 787b4d50d0 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.
2004-08-02 19:41:35 +00:00
Paul Eggert 97f2714e35 Use Autoconf-suggested pattern for inttypes and stdint.
Include unistd.h, for lseek.
2004-08-02 18:44:11 +00:00
Paul Eggert 11e8886958 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.
2004-08-02 18:43:56 +00:00
Paul Eggert 2f9bb99f37 (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.
2004-08-02 18:43:35 +00:00
Paul Eggert b4b2eed874 (EXT): Use size_t for sizes, not ptrdiff_t, so that we don't have
to worry about wraparound.
2004-08-02 18:21:05 +00:00