Paul Eggert [Sat, 23 Nov 2002 07:02:40 +0000 (07:02 +0000)]
Avoid use of <assert.h>, as the GNU Coding Standards hint that one
should use `if (! x) abort ();' rather than `assert (x);', and anyway
it's one less thing to worry about configuring. (hash_lookup,
hash_get_first, hash_get_next, hash_find_entry, hash_rehash,
hash_insert): Use abort rather than assert.
Paul Eggert [Sat, 23 Nov 2002 06:45:49 +0000 (06:45 +0000)]
Include quotearg.h immediately after config.h.
No need to include stddef.h or sys/types.h any more.
Surround local include files with "", not "<>".
Assume HAVE_LIMITS_H unconditionally, as we assume C89.
Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
(HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
(mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
(ISPRINT): Remove; no longer needed now that we assume C89.
Paul Eggert [Sat, 23 Nov 2002 06:45:22 +0000 (06:45 +0000)]
Allow multiple inclusion by surrounding with
"#ifndef QUOTEARG_H_". Include <stddef.h>, for size_t,
so that we can be included first.
(PARAMS): Remove; we now assume C89 or later. All uses removed.
Jim Meyering [Thu, 21 Nov 2002 13:22:51 +0000 (13:22 +0000)]
2002-09-25 Paul Eggert <eggert@twinsun.com>
[! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
(UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
(PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
int. Work more efficiently if X is the same width as uintmax_t.
Do not compare X to -1, to avoid bogus compiler warning.
(get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
Don't assume that f_frsize and f_bsize are the same type.
Paul Eggert [Thu, 21 Nov 2002 07:19:54 +0000 (07:19 +0000)]
Do not include <config.h> or <sys/types.h>.
Include <stddef.h> instead, since it's all we need for size_t.
(PARAMS): Remove. All uses removed.
(ARRAY_CARDINALITY): Do not bother to #undef.
(ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
Remove unnecessary parentheses.
(ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
Insert necessary parentheses.
(ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
(ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
Paul Eggert [Thu, 21 Nov 2002 07:19:33 +0000 (07:19 +0000)]
Include config.h here, not in argmatch.h.
Include stdlib.h, for EXIT_FAILURE.
Always include <string.h>, since we assume C89.
(EXIT_FAILURE): Remove pre-C89 bug workaround.
Stefan Monnier [Tue, 10 Sep 2002 05:59:32 +0000 (05:59 +0000)]
(DISCARD_FAILURE_REG_OR_COUNT): Delete.
(CHECK_INFINITE_LOOP): Don't pop anything: just set `cycle' to 1.
(re_match_2_internal): Be more careful with infinite loops.
(set_image_of_range_1): In no-TRANSLATE case,
call EXTEND_RANGE_TABLE and return a proper value.
(set_image_of_range): Don't call set_image_of_range_1
if no TRANSLATE or if range includes all of Latin-1.
Only call it for the Latin-1 part of the range.
For other cases, make two separate ranges,
one for the original specified characters and one for
their case-conversions.
(set_image_of_range_1): New function.
(set_image_of_range): Use set_image_of_range_1 for Latin-1.
Return a value to indicate running out of memory.
(SET_RANGE_TABLE_WORK_AREA): Check value from set_image_of_range.
(extend_range_table_work_area): New subroutine.
(EXTEND_RANGE_TABLE): Replaces EXTEND_RANGE_TABLE_WORK_AREA.
Different calling conventions, and used from set_image_of_range{,_1}.
(IMMEDIATE_QUIT_CHECK): Definitions moved.