Commit Graph

114 Commits

Author SHA1 Message Date
Paul Eggert
447e90bcef (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_, bitset_andn_or_,
bitset_andn_or_cmp_, bitset_bytes, bitset_copy_, bitset_count_,
bitset_create, bitset_dump, bitset_first, bitset_free, bitset_init,
bitset_last, bitset_next, bitset_obstack_alloc, bitset_obstack_free,
bitset_only_set_p, bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_,
bitset_prev, bitset_print, bitset_release_memory, bitset_toggle_,
bitset_type_choose, bitset_type_get, bitset_type_name_get,
debug_bitset): Use function prototypes; this removes the need for
declaring static functions simply to provide their prototypes.
2002-10-16 06:18:00 +00:00
Paul Eggert
59fc3dcdf4 (enum_bitset_ops, enum_bitset_type): Remove.
All uses of "enum_" changed to "enum ".
2002-10-16 06:16:29 +00:00
Paul Eggert
a911db9cba (abitset_and, abitset_and_cmp, abitset_and_or,
abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
abitset_copy1, abitset_disjoint_p, abitset_empty_p,
abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
abitset_not, abitset_ones, abitset_or, abitset_or_and,
abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
Use function prototypes; this removes the need for declaring
static functions simply to provide their prototypes.
2002-10-16 06:15:02 +00:00
Paul Eggert
bd0ba42d72 Import GCC version as of today, then merge Bison's changes.
Change "GCC" to "Bison" in copyright notice.
2002-10-13 05:58:38 +00:00
Paul Eggert
46b8b6ce90 Fix copyright and authorship notice to point to Bison, not GCC. 2002-10-13 05:57:10 +00:00
Paul Eggert
fdabfd76d6 [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
Update copyright date and clarify comments.
(get_time) [IN_GCC]: Keep the GCC version for reference.

Merge GCC changes.  Change "GCC" to "Bison" in the copyright notice.
2002-10-13 05:56:20 +00:00
Paul Eggert
ea9ed226e0 Import of GCC head 2002-10-11 2002-10-13 04:42:59 +00:00
Paul Eggert
303e6da265 Include bitset.h, not bbitset.h. 2002-10-10 07:35:19 +00:00
Paul Eggert
ef5da92061 Include <stddef.h>, for offsetof.
(lbitset_bytes): Adjust to new, unique names for structures.

(lbitset_and, lbitset_and_cmp, lbitset_andn, lbitset_andn_cmp,
lbitset_or, lbitset_or_cmp, lbitset_xor, lbitset_xor_cmp,
lbitset_empty_p, lbitset_ones, lbitset_not, lbitset_subset_p,
lbitset_disjoint_p, debug_lbitset): Supply prototype decls.

(enum_lbitset_find_mode): New type.  All instances of parameters of
type enum FOO are now of type enum_FOO, to conform to the C Standard.

(struct lbitset_struct, lbitset, bitset_struct, PFV): Remove.

(lbitset_and, lbitset_andn, lbitset_or, lbitset_xor): New functions.
2002-10-10 07:33:59 +00:00
Paul Eggert
3e0a8627e1 (ebitset_bytes): Adjust to new, unique names for structures.
(enum_ebitset_find_mode): New type.
(struct ebitset_struct, ebitset, struct bitset_struct, PFV): Remove.
(ebitset_and, ebitset_andn, ebitset_or,
ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New decls.
2002-10-10 07:28:53 +00:00
Paul Eggert
fd5c1e824e enum -> enum_ 2002-10-10 07:26:15 +00:00
Paul Eggert
f5e211a120 (bitsetv_alloc): Return a size that is aligned properly for vectors of
objects.  Do not assume that adding a header size to a multiple of a
word size yields a value that is properly aligned for the whole union.

(bitsetv_alloc): Add a cast to (void *) to avoid a GCC warning.
2002-10-10 07:25:21 +00:00
Paul Eggert
55e728eb31 (bitset_stats_bytes): Adjust to new, unique names for structures.
(bitset_stats_count, bitset_stats_empty_p, bitset_stats_ones,
bitset_stats_zero, bitset_stats_copy, bitset_stats_disjoint_p,
bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
bitset_stats_and_or_cmp, bitset_stats_andn_or,
bitset_stats_andn_or_cmp, bitset_stats_or_and,
bitset_stats_or_and_cmp): Supply prototype decls, to improve the
type-checking that GCC can do.

(struct bitset_stats_struct, bitset_stats, struct bitset_struct): Remove.
2002-10-10 07:23:15 +00:00
Paul Eggert
47c8386f83 (struct bitset_struct): Remove, replacing with....
(union bitset_union, struct abitset_struct, struct ebitset_struct,
struct lbitset_struct, struct bitset_stats_struct): New types.
All uses of struct bitset_struct changed to union bitset_union,
etc.
(bitset_next, bitset_prev, bitset_only_set_p): Declare.
2002-10-10 07:20:24 +00:00
Paul Eggert
d5c559cde4 (bitset_op4_cmp): Supply prototype decls,
to improve the type-checking that GCC can do.

(bitset_and_or_, bitset_andn_or_, bitset_or_and_): New functions.
2002-10-10 07:18:47 +00:00
Paul Eggert
d9d83ef277 (enum_bitset_ops, enum_bitset_type): New types.
All instances of parameters of type enum bitset_opts are now of
type enum_bitset_opts, to conform to the C Standard, and similarly
for enum_bitset_type.

(bitset): Now points to a union, not to a struct.
All instances of "struct bitset_struct *" replaced with "bitset".

(bitset_and_or_, bitset_andn_or_, bitset_or_and_): New decls.
2002-10-10 07:15:56 +00:00
Paul Eggert
d4d399fcce Include <stddef.h>, for offsetof.
(abitset_bytes): Return a size that is aligned
properly for vectors of objects.  Do not assume that adding a
header size to a multiple of a word size yields a value that is
properly aligned for the whole union.

(abitset_ones, abitset_zero, abitset_empty_p, abitset_copy1,
abitset_not, abitset_equal_p, abitset_subset_p, abitset_disjoint_p,
abitset_and, abitset_and_cmp, abitset_andn, abitset_andn_cmp,
abitset_or, abitset_or_cmp, abitset_xor, abitset_xor_cmp,
abitset_and_or, abitset_and_or_cmp, abitset_andn_or,
abitset_andn_or_cmp, abitset_or_and, abitset_or_and_cmp,
abitset_copy): Supply prototype decls, to improve the type-checking
that GCC can do.

(struct abitset_struct, abitset, struct bitset_struct): Remove.
2002-10-10 07:13:58 +00:00
Paul Eggert
0f9cd74fdb (bitset_reset): Do not assume that bitset_word is
the same width as int.  This reapplies a hunk of the 2002-08-12 patch
<http://mail.gnu.org/pipermail/bison-patches/2002-August/001111.html>,
which was inadvertently undone by the 2002-09-30 patch.
2002-10-07 05:43:35 +00:00
Paul Eggert
09147be095 (debug_lbitset): Do not assume that bitset_word is the same width as
int.
2002-10-07 05:41:35 +00:00
Paul Eggert
5beedd9b58 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
interpreted as signed.
* lib/ebitset.c (ebitset_list): Fix bug.
From Michael Hayes.
2002-10-05 05:02:30 +00:00
Paul Eggert
cd931d9b53 (AM_CFLAGS): Renamed from CFLAGS. 2002-10-05 04:53:54 +00:00
Paul Eggert
bf5c381136 (lbitset_bytes): Use size_t, not unsigned int, to count bytes. 2002-10-02 08:02:06 +00:00
Paul Eggert
5c319390d7 (lbitset_size, lbitset_list, lbitset_list_merge):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(lbitset_bytes): Use size_t, not unsigned int, to count bytes.
Use proper printf formats for widths of integer types.

(lbitset_ones, lbitset_not): Use bitset_windex instead of unsigned int.

(lbitset_elt_find): Simplify windex calculation and avoid cast to unsigned.
2002-10-02 08:00:19 +00:00
Paul Eggert
effda851f6 (ebitset_bytes): Use size_t, not unsigned int, to count bytes. 2002-10-02 07:58:11 +00:00
Paul Eggert
52f8da14ea (ebitset_size, ebitset_list, ebitset_list_reverse):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(ebitset_bytes): Use size_t, not unsigned int, to count bytes.

(struct ebitset_struct.size, ebitset_elts_grow,
ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
Use bitset_windex instead of unsigned int.

(ebitset_elts_grow): Check for arithmetic overflow when computing sizes.
2002-10-02 07:57:24 +00:00
Paul Eggert
eb6172cd1e (bitsetv_alloc, bitsetv_create):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.
2002-10-02 07:55:44 +00:00
Paul Eggert
32e218da16 (bitsetv_alloc, bitsetv_create, bitsetv_free,
bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
bitsetv_reflexive_transitive_closure):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(bitsetv_alloc): Use size_t, not unsigned int, to count bytes.

(bitsetv_dump, debug_bitsetv):
Use bitset_windex instead of unsigned int.
Use proper printf formats for widths of integer types.

(bitsetv_alloc): Check for arithmetic overflow when computing sizes.
2002-10-02 07:54:52 +00:00
Paul Eggert
4fc71aa390 (bitsetv_matrix_dump):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.
Use proper printf formats for widths of integer types.
2002-10-02 07:52:50 +00:00
Paul Eggert
c9de3b4080 (bitset_stats_bytes): Use size_t, not unsigned int, to count bytes. 2002-10-02 07:50:39 +00:00
Paul Eggert
2d382ea853 (bitset_stats_size, bitset_stats_list,
bitset_stats_list_reverse, bitset_stats_size,
bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(bitset_stats_bytes, bitset_stats_init):
Use size_t, not unsigned int, to count bytes.

(bitset_percent_histogram_print,
bitset_log_histogram_print, bitset_stats_print_1):
Use proper printf formats for width of integer types.
2002-10-02 07:49:35 +00:00
Paul Eggert
808a5918e6 (bitset_iterator.num, bitset_iterator.i, bitset_first, bitset_last):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(bitset_bytes): Use size_t, not unsigned int, to count bytes.
2002-10-02 07:47:03 +00:00
Paul Eggert
d32fe6f64f (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
Use size_t, not unsigned int, to count bytes.

(bitset_print): Use proper printf format for bitset types.

(bitset_next, bitset_prev, bitset_first, bitset_last):
Return BITSET_BINDEX_MAX (not -1) for no value,
since we now return the bitset_bindex type (not int).
2002-10-02 07:45:37 +00:00
Paul Eggert
f6ebdb3174 (struct bitset_vtable.size, struct bitset_vtable.count,
struct bitset_vtable.list, struct bitset_vtable.list_reverse,
bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
bitset_count_):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(BITSET_BINDEX_MAX, BITSET_WINDEX_MAX, BITSET_SIZE_MAX): New macros.
(BITSET_INDEX_MAX): Remove.  It wasn't right, since it assumed that
sizeof (bitset_word) == sizeof (bitset_windex).  All uses changed
to BITSET_WINDEX_MAX.
2002-10-02 07:44:07 +00:00
Paul Eggert
8207d52123 (abitset_bytes): Use size_t, not unsigned int, to count bytes. 2002-10-02 07:42:26 +00:00
Paul Eggert
62a34c3eb6 (struct abitset_struct.n_bits, abitset_small_list, abitset_size,
abitset_list, abitset_list_reverse, abitset_list):
Use bitset_bindex, not int or unsigned int or size_t, to count bits.

(abitset_ones, abitset_zero, abitset_bytes):
Use size_t, not unsigned int, to count bytes.

(abitset_empty_p, abitset_not, abitset_equal_p,
abitset_subset_p, abitset_disjoint_p, abitset_and,
abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
abitset_or_and, abitset_or_and_cmp): Use bitset_windex instead of
unsigned int.
2002-10-02 07:41:04 +00:00
Akim Demaille
6aa452a643 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
* lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
Updates from Michael Hayes.
2002-09-30 12:50:49 +00:00
Akim Demaille
8280e1797d Playing with Autoscan.
* configure.ac: Remove the old LIBOBJ tweaks.
(AC_REPLACE_FUNCS): Add strrchr and strtol.
* lib/strrchr.c: New.
* lib/strtol.c: New, from the Coreutils 4.5.1.
2002-09-27 13:19:59 +00:00
Akim Demaille
ae64af3556 Playing with Autoscan.
* m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
* lib/Makefile.am (libbison_a_SOURCES): No longer include
argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
* lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
Coreutils 4.5.1.
2002-09-27 13:03:32 +00:00
Paul Eggert
eb9568566a Sync with fileutils. 2002-08-12 14:25:24 +00:00
Paul Eggert
d5629ce34a Sync with diffutils. 2002-08-12 14:25:03 +00:00
Paul Eggert
c340180d81 (lbitset_set, lbitset_reset): Do not assume that
bitset_word is the same width as int.
(lbitset_op1): Use -1, not ~0, as memset arg (for
portability to one's complement hosts!).
2002-08-12 14:22:08 +00:00
Paul Eggert
c837b82803 (ebitset_set, ebitset_reset): Do not assume that bitset_word is the
same width as int.
(ebitset_op1): Use -1, not ~0, as memset arg (for portability to one's
complement hosts!).
2002-08-12 14:20:35 +00:00
Paul Eggert
e601ff27f4 (bitset_set, bitset_reset): Do not assume that bitset_word is the same
width as int.
2002-08-12 14:19:02 +00:00
Paul Eggert
c131cbff03 Include "gettext.h".
(_): New macro.
(bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
name locals "index", as it generates unnecessary warnings on some
hosts that have an "index" function.

(bitset_stats_print_1, bitset_stats_print, bitset_stats_read,
bitset_stats_write): Wrap strings in _() if they need translation.

(bitset_stats_set, bitset_stats_reset): Do not assume that bitset_word
is the same width as int.
2002-08-12 14:16:49 +00:00
Paul Eggert
50f095c92f (BITSET_WORD_BITS): Now of type unsigned, not
size_t; the old version tried to do this but casted improperly.
(bitset_bindex, bitset_windex): Now size_t, not unsigned long.
(bitset_test): Now returns int, not unsigned long.
2002-08-12 14:13:56 +00:00
Paul Eggert
16cb098b72 Sync with fileutils, except use
PROTOTYPES to check for prototypes, and "defined __STDC__" to
check for void *.
2002-08-12 14:12:57 +00:00
Paul Eggert
9742c552f2 Use GPL, not LGPL. 2002-08-12 14:12:13 +00:00
Paul Eggert
8434f2222e Sync with GNU tar. 2002-08-12 14:10:23 +00:00
Paul Eggert
d6eba4239f (abitset_reverse_list, ebitset_reverse_list):
Do not assume that bitset_windex is the same width as unsigned.
(abitset_unused_clear): Do not assume that bitset_word is the same
width as int.
(abitset_op1): Use -1, not ~0, as memset arg (for portability to one's
complement hosts!).
2002-08-12 14:09:24 +00:00
Paul Eggert
81fe8b23e9 (INCLUDES): Do not include from the intl directory, which has been
removed.
(libbison_a_SOURCES): Add unlocked-io.h.  Avoid +=, a GNU make extension.
(bitsets_sources, additional_bitsets_sources, timevars_sources): New vars.
2002-08-12 14:08:04 +00:00