1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-03 15:26:39 +02:00
Commit Graph

4325 Commits

Author SHA1 Message Date
Jim Meyering d08a2b63dc (BITSPERBYTE): Remove.
(UID_T_MAX, GID_T_MAX): Define in terms of TYPE_MAXIMUM.
1997-11-30 10:25:11 +00:00
Jim Meyering 6ed8115087 (<inttypes.h>): Include if HAVE_INTTYPES_H.
("human.h"): Include.
(LONGEST_HUMAN_READABLE, enum Output_units): Remove.
(count_entry): Now returns uintmax_t, not long.
(human_readable_base): Renamed from opt_human_readable; value is now
zero or positive integer, not just zero or nonzero.
(output_units): Now an integer giving output size.
(tot_size): Now uintmax_t, not long.
(long_options, usage): Add --si or -H.
(main): Adjust to renamed option variables.
Use -H if BLOCKSIZE is SI.  Add -H.
(human_readable): Remove; rewritten and now in lib/human.c.
(print_size): Rewrite in terms of human_readable.
Accept extra arg to be printed after size; all callers changed.
1997-11-30 10:25:07 +00:00
Jim Meyering 76916942ca (<inttypes.h>): Include if HAVE_INTTYPES_H.
("human.h"): Include.
(LONGEST_HUMAN_READABLE_1K_BYTE_BLOCKS): Remove.
(human_readable_base): Renamed from human_blocks; value is now
zero or positive integer, not just zero or nonzero.
(output_units): New variable;
replaces booleans kilobyte_blocks and megabyte_blocks.
(long_options): Add --si or -H.
(print_header): Adjust to renamed option variables.
(human_readable_1k_blocks): Remove.
(show_dev): Count blocks using uintmax_t, not long.
Calculate percentages using double, not long; this still isn't
perfect as it suffers double rounding, but it's more likely to
round correctly in practice than using long did.
Adjust to renamed option variables.
Use new human_readable library function to format uintmax_t values.
(usage): Add -H, --si.
(main): Adjust to renamed option variables.
Use -H if BLOCKSIZE is SI.  Add -H.
1997-11-30 10:25:02 +00:00
Jim Meyering 72bc3b818f (<inttypes.h>): Include if HAVE_INTTYPES_H.
("human.h"): Include.
(input_blocksize, output_blocksize, conversion_blocksize):
Now size_t instead of long.  0 means unset.
(skip_records, seek_record, max_records): Now uintmax_t, not long.
(w_partial, w_full, r_partial, r_full, r_truncate):
Now uintmax_t instead of unsigned.
(print_stats): Print counts as uintmax_t, not unsigned.
(main, skip): Check for overflow when computing file offsets.
(skip): Records count arg is uintmax_t, not long; blocksize arg is
size_t, not long.  Try lseek even on non regular files, as per comment.
(oc, col): Now size_t, not int.
(copy): No need to check max_records >= 0 any more, as the
default value is now effectively infinity.
Cast lseek arg to off_t.
(copy, copy_with_block): conversion_blocksize - col can never
be negative now, since it's unsigned, so rewrite loops to
avoid problems with unsigned.
(scanargs): Parse numeric args using uintmax_t, not int.
Check for overflow when converting block size args to size_t.
Blocksize options are now unsigned, and are now 0 when not set yet.
(parse_integer): Return uintmax_t, not int; accept new int * arg
to store error indicator, since all returned values are now valid.
Check for overflow when scanning integer.
1997-11-30 10:24:58 +00:00
Jim Meyering a5fe3a240b (<inttypes.h>): Include if HAVE_INTTYPES_H.
(hash_insert2): Cast inode number to uintmax_t; this prevents
negative remainders if the inode number is negative and ino_t
is longer than unsigned.
1997-11-30 10:24:54 +00:00
Jim Meyering b8c474191a (copy_reg): Store file size as off_t, not long.
Do not assume st_size has been normalized to 512 byte blocks,
or that it fits in size_t after dividing by the blocksize.
1997-11-30 10:24:50 +00:00
Jim Meyering 0f411474da (<limits.h>, UINT_MAX, UINT_MAX): Remove; now
done by system.h.
1997-11-30 10:24:45 +00:00
Jim Meyering dcd4c05dfa (savedir): Check for size zero before invoking
malloc; this can occur if st_size arg overflows on conversion to
unsigned int.  All callers now cast st_size arg to unsigned int.
1997-11-30 10:24:41 +00:00
Jim Meyering 07783bcdf0 (getuidbyname, getgidbyname): Names can now
be NULL in cache.  This change merely fixes ifdeffed-out code.
1997-11-30 10:24:38 +00:00
Jim Meyering 240cb49efe New file. The interface is inspired
by the human_readable function that was in du.c, but it's pretty
much rewritten from scratch.
1997-11-30 10:24:32 +00:00
Jim Meyering 412d0aba50 (struct fs_usage): New member fsu_blocksize.
Other members are now uintmax_t, not long.
1997-11-30 10:24:28 +00:00
Jim Meyering 25fabf3d2d Do all calculations using uintmax_t.
Include <inttypes.h> if available.
(adjust_blocks, CONVERT_BLOCKS): Remove.
(get_fs_usage): Set new member fsu_blocksize, and do not convert
numbers to 512-byte block units; this avoids overflow here.
Cast lseek arg to off_t, not long.
1997-11-30 10:24:24 +00:00
Jim Meyering f633782aa1 (st_blocks): long -> off_t.
Avoid arithmetic overflow when size is near max.
Depend on _POSIX_SOURCE and BSIZE, not _POSIX_VERSION, for
compatibility with system.h.
(BSIZE): Remove definition, since if BSIZE is not defined
we're never invoked.
1997-11-30 10:24:20 +00:00
Jim Meyering ce43e130bb (libfu_a_SOURCES): Add new file human.c.
(noinst_HEADERS): Add new file human.h.
1997-11-30 10:24:16 +00:00
Jim Meyering 8754a488e0 . 1997-11-30 08:32:44 +00:00
Jim Meyering 75a5b970b3 (mempcpy): remove static inline function 1997-11-30 07:34:12 +00:00
Jim Meyering e08f95ef54 . 1997-11-29 18:05:14 +00:00
Jim Meyering 4eac40b0e5 *** empty log message *** 1997-11-24 14:25:52 +00:00
Jim Meyering 04712f52ad also test for stdlib.h
don't use STDC_HEADERS in ifdef for stdlib.h
1997-11-24 14:21:16 +00:00
Jim Meyering c781b840f2 move big chunk of defs to sys2 1997-11-24 14:19:32 +00:00
Jim Meyering d8415fe94f *** empty log message *** 1997-11-24 12:57:50 +00:00
Jim Meyering 9928e82eac *** empty log message *** 1997-11-24 12:53:29 +00:00
Jim Meyering 49803907f5 . 1997-11-19 18:59:48 +00:00
Jim Meyering 4c3aa5cba3 (hash_pjw): Don't use ANSI `U' suffix. Cast instead. 1997-11-19 18:59:02 +00:00
Jim Meyering c04cb4522a add PARAMS around prototype lists 1997-11-19 18:57:40 +00:00
Jim Meyering f62113bea3 . 1997-11-19 18:55:53 +00:00
Jim Meyering d92a618daf revert a mempcpy to memcpy 1997-11-19 18:55:31 +00:00
Jim Meyering 1110f5f335 (AUTOMAKE_OPTIONS): Use ansi2knr so *I* don't
have to convert my hash package to use k&r C.
1997-11-19 15:04:15 +00:00
Jim Meyering 68c59ca300 *** empty log message *** 1997-11-18 03:47:06 +00:00
Jim Meyering 65eb6ca593 *** empty log message *** 1997-11-18 03:32:19 +00:00
Jim Meyering 9ed80c0140 (_REENTRANT): #define, as some hosts need this to declare localtime_r properly.
From Paul Eggert.
1997-11-18 03:32:00 +00:00
Jim Meyering 6106d5a733 . 1997-11-18 03:29:24 +00:00
Jim Meyering 59b9b24bad undef putenv 1997-11-17 15:45:19 +00:00
Jim Meyering f1b490166e add jm_ prefix to use of am_cv_func_working_mktime
increment serial #
1997-11-17 15:13:41 +00:00
Jim Meyering 3c94a67faa . 1997-11-16 15:28:23 +00:00
Jim Meyering 434a17cc05 . 1997-11-16 15:27:52 +00:00
Jim Meyering aa96253ae1 . 1997-11-15 19:58:19 +00:00
Jim Meyering 87cff95abc . 1997-11-15 19:54:47 +00:00
Jim Meyering 4da60d3e2c *** empty log message *** 1997-11-15 19:51:16 +00:00
Jim Meyering fec9572013 include unistd.h 1997-11-15 19:43:06 +00:00
Jim Meyering 1076c92f8d . 1997-11-15 17:19:48 +00:00
Jim Meyering 8def3e3ec1 remove fixup_null_alloc prototype 1997-11-15 17:18:01 +00:00
Jim Meyering 83ef9b531a (EXTRA_DIST): Add mktime.m4. 1997-11-15 17:14:10 +00:00
Jim Meyering f9d9d1cbb4 . 1997-11-15 17:13:23 +00:00
Jim Meyering 31c1d2ed3d *** empty log message *** 1997-11-15 17:13:20 +00:00
Jim Meyering e66833e32e Require jm_AM_FUNC_MKTIME, not the one from automake. 1997-11-15 17:13:02 +00:00
Jim Meyering e6186db39f (mempcpy): Remove definition. 1997-11-15 17:09:34 +00:00
Jim Meyering ae2984e8ca . 1997-11-15 17:08:32 +00:00
Jim Meyering ed5048e229 Check for %F format.
Add comments.
1997-11-15 13:17:15 +00:00
Jim Meyering e84c69c6cf (bigtime_test): New function from Paul Eggert to detect SunOS4.1.4's
infinite looping mktime.
Portability tweaks from Paul Eggert.
1997-11-15 05:41:02 +00:00