summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2003-08-04(main): Use unsigned int instead of int for `nsigs'Jim Meyering
and for the indices to iterate through nsigs.
2003-08-03Minor code cleanups, mostly to use more accurateJim Meyering
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-02[!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>Jim Meyering
to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
2003-08-02(cut_fields): Don't read again after encountering EOF.Jim Meyering
E.g., `cut -f2' would do so.
2003-08-02(sortlines): Add description and references.Jim Meyering
From Paul Eggert.
2003-08-01(long_options, usage, main): Add --rfc-2822 option to GNU date.Jim Meyering
2003-08-01Do not include bumpalloc.h.Jim Meyering
(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-07-31.Jim Meyering
2003-07-28(sortlines_temp): Undo previous change.Jim Meyering
2003-07-27(sortlines_temp): Declare local `swap' to be `int', notJim Meyering
`bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4) would cause lines[-1 - swap] (with swap = false) to evaluate to lines[4294967295].
2003-07-27(prompt) [! recursive]: Don't prompt about unwritableJim Meyering
directories, as required by POSIX. Reported by Karl Berry.
2003-07-27remove trailing blanksJim Meyering
2003-07-27(sort): Don't require two `struct line's per text line,Jim Meyering
the new sort algorithm requires just 1.5.
2003-07-27This change was inspired by a similar proposal by Stepan Kasal.Jim Meyering
(mergelines, sortlines_temp): New functions. (sortlines): Use them, to reduce the number of times that we need to copy 'struct line' values. This improved CPU performance by about 30% on one 18 MB test. (sort): Don't invoke sortlines unless we have 2 or more lines.
2003-07-27(is_printable_field): Simplify bit arithmetic.Jim Meyering
2003-07-27(validate_path): Use %lu, not %ld.Jim Meyering
2003-07-27(sort_files): Put `volatile' in the right place.Jim Meyering
2003-07-26.Jim Meyering
2003-07-26Include exitfail.h.Jim Meyering
(TEST_FAILURE): New constant, used for exit status if 'test' fails. (test-syntax_error): Use it. (binary_operator): Now takes bool arg specifying whether left operand is -l ARG, so that caller determines this rather than us. All uses changed. (term): Use posixtest to evaluate parenthesized subexpressions. (unary_operator, one_argument): Remove support for -t without operand. (one_argument): Take argument from argv[pos]. (one_argument, two_arguments, three_arguments): Advance pos. All callers changed. (three_arguments): Look for binary ops before "!". Then look for parenthesized one_argument expressions, instead of trusting expr () to do the right thing. (posixtest): Now takes number of args. All callers changed. Treat "( A B )" like "A B". (main): Set exit_failure to TEST_FAILURE. Don't depend on POSIXLY_CORRECT, as we now conform to POSIX by default. (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
2003-07-26Use only one bit per field/offset in array, not one `int'.Jim Meyering
(printable_field): Change type to `unsigned char'. (mark_printable_field, is_printable_field): New functions. Use them in place of all direct accesses of `printable_field'.
2003-07-26(set_fields): Detect overflow properly.Jim Meyering
2003-07-26(parse_tabstops): Detect overflow properly.Jim Meyering
2003-07-26 * src/rm.c: Include "dirname.h".Jim Meyering
(usage): Use base_name (program_name) in body of --help output. This lets me... * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
2003-07-26(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.Jim Meyering
2003-07-26(validate_path): Cast strlen value to `unsigned long'Jim Meyering
so it matches `%ld' format even on 32-bit systems.
2003-07-26(flush_paragraph): Cast field width to `int' to avoid warning on 64-bit systems.Jim Meyering
2003-07-26(sort_files): Make `func' volatile, so it can't beJim Meyering
clobbered by a `longjmp' into this function.
2003-07-25(validate_path): Use %ld format (not %d) for size_t value.Jim Meyering
2003-07-25(usage): Document the fact that SIGUSR1 makes ddJim Meyering
output its current record counts. Reported by Jurriaan.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include version-etc.h.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include stdlib.h.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include errno.h.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include limits.h or error.h.
2003-07-23Don't include unistd.h or time.h; system.h already does it.Jim Meyering
2003-07-23Don't include stdlib.h, unistd.h, or limits.h; system.h already does it.Jim Meyering
2003-07-23Don't include time.h; system.h already does it.Jim Meyering
2003-07-23Don't include errno.h; system.h already does it.Jim Meyering
2003-07-23Don't include sys/time.h; system.h already does it.Jim Meyering
2003-07-23.Jim Meyering
2003-07-23(parse_tabstops): Detect overflow in tabstop sizes.Jim Meyering
2003-07-23Include xstrndup.h.Jim Meyering
(xstrndup): Remove function, now that it's been factored out into it's own file.
2003-07-23Tweak comment: Solaris2.5.1 -> Solaris 2.5.1Jim Meyering
2003-07-23Tweak comment: Solaris2.7 -> Solaris 2.7Jim Meyering
2003-07-23(wc): Fix typo in computation of file from file_x,Jim Meyering
which caused the former to be used uninitialized if file_x was nonzero.
2003-07-22tweak commentJim Meyering
2003-07-22(set_fields): Use xcalloc in place of xmalloc+memset.Jim Meyering
2003-07-22don't include stdboo.h. it's already included via system.hJim Meyering
2003-07-22.Jim Meyering
2003-07-22(main) [lint]: Initialize spec_list_string to avoid warning.Jim Meyering