Commit Graph

16324 Commits

Author SHA1 Message Date
Jim Meyering 801362fc36 Minor code cleanups, mostly to use more accurate
types and to remove unnecessary casts.
(min, max): Remove.  All uses changed to MIN and MAX.
(hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
keyfield.skipsblanks, struct keyfield.skipeblanks, struct
keyfield.numeric, struct keyfield.general_numeric, struct
keyfield.month, struct keyfield.reverse, reverse, unique,
have_read_stdin): Now bool, not int.  All uses changed.
(eolchar): Now char, not int.
(struct keyfield.ignore): Now bool const *, not int *.
(struct keyfield.translate): Now char const *, not char *.
(struct month.name): Likewise.
(blanks, nonprinting, nondictionary): Now bool[], not int[].
(cleanup, inittables, keycompare, check, mergefps, first_same_file,
check, sort, main): Use const * pointers when possible.
(month_cmp): Rewrite to avoid casts.
(inittables): Initialize tables unconditionally, to avoid branches.
(fillbuf): Return bool, not int.  All uses changed.
(fillbuf, keycompare, new_key, main):
Use SIZE_MAX rather than (size_t) -1.
(trailing_blanks): Renamed from trim_trailing_blanks.
Return the number of blanks to trim.  All uses changed.
(getmonth): Use trailing_blanks rather than open code.
(keycompare): Do not cast char * to unsigned char *; not needed.
CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
ourselves.
(compare, main): Use | rather than || to avoid jumps.
Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
be nonzero there.
(check, first_same_file, sort, main):
Use bool instead of int local vars when possible.
(check): Merge the old 'checkfp' and 'check' into a single function,
that returns a boolean (true if the file was ordered).
All uses changed.
(main): Use int instead of unsigned for iterating through nsigs.
Rename local var "posix_pedantic" to "posixly_correct".
2003-08-03 10:28:10 +00:00
Jim Meyering a875d6bc23 *** empty log message *** 2003-08-03 10:20:35 +00:00
Jim Meyering 016c2ea295 (_Bool): Use a #define, not a typedef. 2003-08-03 10:20:32 +00:00
Jim Meyering c36e601b67 *** empty log message *** 2003-08-02 21:16:04 +00:00
Jim Meyering 9070de3ea2 *** empty log message *** 2003-08-02 20:39:13 +00:00
Jim Meyering 846a7a53eb [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
2003-08-02 20:39:06 +00:00
Jim Meyering 4c3962cc7a *** empty log message *** 2003-08-02 20:07:57 +00:00
Jim Meyering fa446c2243 . 2003-08-02 20:07:12 +00:00
Jim Meyering 445b9e169b *** empty log message *** 2003-08-02 19:53:59 +00:00
Jim Meyering aca28ca9ac (cut_fields): Don't read again after encountering EOF.
E.g., `cut -f2' would do so.
2003-08-02 19:53:52 +00:00
Jim Meyering 40944ce6ce Add a test for the above fix.
`cut -f2' would read after EOF.
2003-08-02 19:41:28 +00:00
Jim Meyering ca78a418b2 *** empty log message *** 2003-08-02 19:40:48 +00:00
Jim Meyering f9971e4c43 . 2003-08-02 06:27:30 +00:00
Jim Meyering 93f9ffc614 Document in TODO Paul's desire to make sort faster (and how he
was foiled this time around).

from Paul Eggert.
2003-08-02 06:27:13 +00:00
Jim Meyering 054819d791 (sortlines): Add description and references.
From Paul Eggert.
2003-08-02 06:25:50 +00:00
Jim Meyering 2300c75a6d *** empty log message *** 2003-08-01 22:40:58 +00:00
Jim Meyering 187adbe0b1 *** empty log message *** 2003-08-01 22:40:16 +00:00
Jim Meyering 37eb1bb333 *** empty log message *** 2003-08-01 22:38:50 +00:00
Jim Meyering cd5b47646f (General date syntax): Add --rfc-2822 option to GNU date. 2003-08-01 22:38:36 +00:00
Jim Meyering 6f2002699e (Options for date): Fix a typo in format: it's now %d not %_d. Add URLs.
(Time directives, Options for date, Examples of date): Add --rfc-2822
option to GNU date.
2003-08-01 22:37:20 +00:00
Jim Meyering 953ab84d68 (long_options, usage, main): Add --rfc-2822 option to GNU date. 2003-08-01 22:36:34 +00:00
Jim Meyering 832557df66 Add --rfc-2822 option to GNU date. 2003-08-01 22:35:57 +00:00
Jim Meyering 572d582d8d Ensure that $? is 0 for the final `exit 0'.
Otherwise, with at least the /bin/sh from HPUX 10.20,
the trap code would end up converting that to exit 1 and thus an
unexpected test failure.  Reported by Christian Krackowizer.
2003-08-01 22:33:04 +00:00
Jim Meyering 77b694e03a *** empty log message *** 2003-08-01 22:32:47 +00:00
Jim Meyering f9bbf80f93 (TESTS_ENVIRONMENT): Set PATH so that
the tests in help-version will use the just-built binaries.
2003-08-01 22:32:41 +00:00
Jim Meyering 8355cbbdfc *** empty log message *** 2003-08-01 06:44:33 +00:00
Jim Meyering 09df41c60f Do not include bumpalloc.h.
(WORD_TABLE): New member alloc.
(ALLOC_NEW_WORD): Remove.
(occurs_alloc): New var.
(digest_word_file, find_occurs_in_text): Check for arithmetic
overflow when computing table size.  Use xrealloc rather than
bumpalloc primitives.
2003-08-01 06:44:28 +00:00
Jim Meyering 7f18ea73ce *** empty log message *** 2003-08-01 06:39:01 +00:00
Jim Meyering 3e65255557 (libfetish_a_SOURCES): Remove bumpalloc.h. 2003-08-01 06:38:38 +00:00
Jim Meyering ecc4d8f34d . 2003-08-01 06:38:15 +00:00
Jim Meyering 85dfddc659 *** empty log message *** 2003-07-31 20:33:48 +00:00
Jim Meyering fed2d190f0 (Relative items in date strings): Warn about fuzz in relative units. 2003-07-31 20:33:45 +00:00
Jim Meyering 689ba6d996 . 2003-07-31 11:14:56 +00:00
Jim Meyering 4bc98a14dd *** empty log message *** 2003-07-31 11:10:52 +00:00
Jim Meyering ed1951c7c7 . 2003-07-30 19:31:03 +00:00
Jim Meyering 2c8255c34b . COREUTILS-5_0_90 2003-07-29 21:20:01 +00:00
Jim Meyering 1e47145d72 When running tests as root, suggest using sudo with NON_ROOT_USERNAME=$USER. 2003-07-29 20:55:00 +00:00
Jim Meyering c2b4cbc163 *** empty log message *** 2003-07-29 20:54:50 +00:00
Jim Meyering 55804c74a2 . 2003-07-29 19:38:34 +00:00
Jim Meyering 1bb4c2c6b6 *** empty log message *** 2003-07-29 18:21:35 +00:00
Jim Meyering 4867e7aa90 (tail invocation): Restore two end-of-sentence
words that were mistakenly removed on 2002-09-13.
2003-07-29 18:20:56 +00:00
Jim Meyering ff83ba2830 . 2003-07-29 06:44:28 +00:00
Jim Meyering bbf7fda701 *** empty log message *** 2003-07-29 06:41:17 +00:00
Jim Meyering 7261a4b4d8 (all_programs): Makefile is in ../src, not $(srcdir)/../src. 2003-07-29 06:41:08 +00:00
Jim Meyering 9f39cea8a1 . 2003-07-29 06:22:25 +00:00
Jim Meyering a586b992d7 *** empty log message *** 2003-07-28 10:15:14 +00:00
Jim Meyering 9943b0564a (dd invocation): Explain that a SIGUSR1 signal
makes dd give a progress report to stderr.
2003-07-28 10:15:11 +00:00
Jim Meyering 69aae1e511 . 2003-07-28 10:04:56 +00:00
Jim Meyering 6c11db0ce5 *** empty log message *** 2003-07-28 08:40:32 +00:00
Jim Meyering e7f67448e8 (GZIP_ENV): Try Debian/gzip's new --rsyncable option. 2003-07-28 08:40:27 +00:00