[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bitset portability patches to better conform to Standard C
From: |
Paul Eggert |
Subject: |
Re: bitset portability patches to better conform to Standard C |
Date: |
Tue, 15 Oct 2002 23:41:14 -0700 (PDT) |
This is a followup to my previous message on the subject, archived at
<http://mail.gnu.org/pipermail/bison-patches/2002-October/001169.html>.
In rereading the code that I wrote for that patch, I decided that the
"enum_" convention was too tricky, so I went back to using ordinary
"enum". This requires converting to function prototypes, but I guess
that's OK these days.
Here is the patch that I installed. I also normalized white space
but omit that from the listing below.
2002-10-15 Paul Eggert <address@hidden>
Stop using the "enum_" trick for K&R-style function definitions;
it confused me, and I was the author! Instead, assume that people
who want to use K&R C compilers (when using these modules in GCC,
perhaps?) will run ansi2knr.
* lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
All uses of "enum_" changed to "enum ".
* lib/ebitset.c (enum_ebitset_find_mode): Likewise.
* lib/lbitset.c (enum_lbitset_find_mode): Likewise.
* lib/abitset.c (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.
* lib/bitset.c (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): Likewise.
* lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
* lib/bitset_stats.c (bitset_log_histogram_print,
bitset_percent_histogram_print, bitset_stats_and,
bitset_stats_and_cmp, bitset_stats_and_or,
bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
bitset_stats_zero): Likewise.
* lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
bitsetv_dump, debug_bitsetv): Likewise.
* lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
Likewise.
* lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
lbitset_xor_cmp, lbitset_zero): Likewise.
Index: lib/abitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/abitset.c,v
retrieving revision 1.5
diff -p -u -r1.5 abitset.c
--- lib/abitset.c 10 Oct 2002 07:13:58 -0000 1.5
+++ lib/abitset.c 16 Oct 2002 05:52:01 -0000
@@ -29,44 +29,6 @@
/* This file implements fixed size bitsets stored as an array
of words. Any unused bits in the last word must be zero. */
-static void abitset_unused_clear PARAMS ((bitset));
-static void abitset_ones PARAMS ((bitset));
-static void abitset_zero PARAMS ((bitset));
-static int abitset_empty_p PARAMS ((bitset));
-static void abitset_copy1 PARAMS ((bitset, bitset));
-static void abitset_not PARAMS ((bitset, bitset));
-static int abitset_equal_p PARAMS ((bitset, bitset));
-static int abitset_subset_p PARAMS ((bitset, bitset));
-static int abitset_disjoint_p PARAMS ((bitset, bitset));
-static void abitset_and PARAMS ((bitset, bitset, bitset));
-static int abitset_and_cmp PARAMS ((bitset, bitset, bitset));
-static void abitset_andn PARAMS ((bitset, bitset, bitset));
-static int abitset_andn_cmp PARAMS ((bitset, bitset, bitset));
-static void abitset_or PARAMS ((bitset, bitset, bitset));
-static int abitset_or_cmp PARAMS ((bitset, bitset, bitset));
-static void abitset_xor PARAMS ((bitset, bitset, bitset));
-static int abitset_xor_cmp PARAMS ((bitset, bitset, bitset));
-static void abitset_and_or PARAMS ((bitset, bitset, bitset, bitset));
-static int abitset_and_or_cmp PARAMS ((bitset, bitset, bitset, bitset));
-static void abitset_andn_or PARAMS ((bitset, bitset, bitset, bitset));
-static int abitset_andn_or_cmp PARAMS ((bitset, bitset, bitset, bitset));
-static void abitset_or_and PARAMS ((bitset, bitset, bitset, bitset));
-static int abitset_or_and_cmp PARAMS ((bitset, bitset, bitset, bitset));
-static void abitset_copy PARAMS ((bitset, bitset));
-
-static bitset_bindex abitset_small_list PARAMS ((bitset, bitset_bindex *,
- bitset_bindex,
- bitset_bindex *));
-
-static void abitset_set PARAMS ((bitset, bitset_bindex));
-static void abitset_reset PARAMS ((bitset, bitset_bindex));
-static int abitset_test PARAMS ((bitset, bitset_bindex));
-static bitset_bindex abitset_size PARAMS ((bitset));
-static bitset_bindex abitset_list PARAMS ((bitset, bitset_bindex *,
- bitset_bindex, bitset_bindex *));
-static bitset_bindex abitset_list_reverse
-PARAMS ((bitset, bitset_bindex *, bitset_bindex, bitset_bindex *));
-
#define ABITSET_N_WORDS(N) (((N) + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
#define ABITSET_WORDS(X) ((X)->a.words)
#define ABITSET_N_BITS(X) ((X)->a.n_bits)
@@ -74,8 +36,7 @@ PARAMS ((bitset, bitset_bindex *, bitset
/* Return size in bits of bitset SRC. */
static bitset_bindex
-abitset_size (src)
- bitset src;
+abitset_size (bitset src)
{
return ABITSET_N_BITS (src);
}
@@ -85,11 +46,8 @@ abitset_size (src)
*NEXT and store in array LIST. Return with actual number of bits
found and with *NEXT indicating where search stopped. */
static bitset_bindex
-abitset_small_list (src, list, num, next)
- bitset src;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+abitset_small_list (bitset src, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex count;
@@ -145,9 +103,7 @@ abitset_small_list (src, list, num, next
/* Set bit BITNO in bitset DST. */
static void
-abitset_set (dst, bitno)
- bitset dst ATTRIBUTE_UNUSED;
- bitset_bindex bitno ATTRIBUTE_UNUSED;
+abitset_set (bitset dst ATTRIBUTE_UNUSED, bitset_bindex bitno ATTRIBUTE_UNUSED)
{
/* This should never occur for abitsets since we should always
hit the cache. */
@@ -157,9 +113,8 @@ abitset_set (dst, bitno)
/* Reset bit BITNO in bitset DST. */
static void
-abitset_reset (dst, bitno)
- bitset dst ATTRIBUTE_UNUSED;
- bitset_bindex bitno ATTRIBUTE_UNUSED;
+abitset_reset (bitset dst ATTRIBUTE_UNUSED,
+ bitset_bindex bitno ATTRIBUTE_UNUSED)
{
/* This should never occur for abitsets since we should always
hit the cache. */
@@ -169,9 +124,8 @@ abitset_reset (dst, bitno)
/* Test bit BITNO in bitset SRC. */
static int
-abitset_test (src, bitno)
- bitset src ATTRIBUTE_UNUSED;
- bitset_bindex bitno ATTRIBUTE_UNUSED;
+abitset_test (bitset src ATTRIBUTE_UNUSED,
+ bitset_bindex bitno ATTRIBUTE_UNUSED)
{
/* This should never occur for abitsets since we should always
hit the cache. */
@@ -185,11 +139,8 @@ abitset_test (src, bitno)
actual number of bits found and with *NEXT indicating where search
stopped. */
static bitset_bindex
-abitset_list_reverse (src, list, num, next)
- bitset src;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+abitset_list_reverse (bitset src, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex rbitno;
@@ -248,11 +199,8 @@ abitset_list_reverse (src, list, num, ne
*NEXT and store in array LIST. Return with actual number of bits
found and with *NEXT indicating where search stopped. */
static bitset_bindex
-abitset_list (src, list, num, next)
- bitset src;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+abitset_list (bitset src, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_bindex count;
@@ -352,8 +300,7 @@ abitset_list (src, list, num, next)
/* Ensure that any unused bits within the last word are clear. */
static inline void
-abitset_unused_clear (dst)
- bitset dst;
+abitset_unused_clear (bitset dst)
{
unsigned int last_bit;
@@ -365,8 +312,7 @@ abitset_unused_clear (dst)
static void
-abitset_ones (dst)
- bitset dst;
+abitset_ones (bitset dst)
{
bitset_word *dstp = ABITSET_WORDS (dst);
size_t bytes;
@@ -379,8 +325,7 @@ abitset_ones (dst)
static void
-abitset_zero (dst)
- bitset dst;
+abitset_zero (bitset dst)
{
bitset_word *dstp = ABITSET_WORDS (dst);
size_t bytes;
@@ -392,8 +337,7 @@ abitset_zero (dst)
static int
-abitset_empty_p (dst)
- bitset dst;
+abitset_empty_p (bitset dst)
{
bitset_windex i;
bitset_word *dstp = ABITSET_WORDS (dst);
@@ -407,9 +351,7 @@ abitset_empty_p (dst)
static void
-abitset_copy1 (dst, src)
- bitset dst;
- bitset src;
+abitset_copy1 (bitset dst, bitset src)
{
bitset_word *srcp = ABITSET_WORDS (src);
bitset_word *dstp = ABITSET_WORDS (dst);
@@ -422,9 +364,7 @@ abitset_copy1 (dst, src)
static void
-abitset_not (dst, src)
- bitset dst;
- bitset src;
+abitset_not (bitset dst, bitset src)
{
bitset_windex i;
bitset_word *srcp = ABITSET_WORDS (src);
@@ -438,9 +378,7 @@ abitset_not (dst, src)
static int
-abitset_equal_p (dst, src)
- bitset dst;
- bitset src;
+abitset_equal_p (bitset dst, bitset src)
{
bitset_windex i;
bitset_word *srcp = ABITSET_WORDS (src);
@@ -455,9 +393,7 @@ abitset_equal_p (dst, src)
static int
-abitset_subset_p (dst, src)
- bitset dst;
- bitset src;
+abitset_subset_p (bitset dst, bitset src)
{
bitset_windex i;
bitset_word *srcp = ABITSET_WORDS (src);
@@ -472,9 +408,7 @@ abitset_subset_p (dst, src)
static int
-abitset_disjoint_p (dst, src)
- bitset dst;
- bitset src;
+abitset_disjoint_p (bitset dst, bitset src)
{
bitset_windex i;
bitset_word *srcp = ABITSET_WORDS (src);
@@ -490,10 +424,7 @@ abitset_disjoint_p (dst, src)
static void
-abitset_and (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+abitset_and (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
@@ -507,10 +438,7 @@ abitset_and (dst, src1, src2)
static int
-abitset_and_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+abitset_and_cmp (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
int changed = 0;
@@ -534,10 +462,7 @@ abitset_and_cmp (dst, src1, src2)
static void
-abitset_andn (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+abitset_andn (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
@@ -551,10 +476,7 @@ abitset_andn (dst, src1, src2)
static int
-abitset_andn_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+abitset_andn_cmp (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
int changed = 0;
@@ -578,10 +500,7 @@ abitset_andn_cmp (dst, src1, src2)
static void
-abitset_or (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+abitset_or (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
@@ -595,10 +514,7 @@ abitset_or (dst, src1, src2)
static int
-abitset_or_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+abitset_or_cmp (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
int changed = 0;
@@ -622,10 +538,7 @@ abitset_or_cmp (dst, src1, src2)
static void
-abitset_xor (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+abitset_xor (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
@@ -639,10 +552,7 @@ abitset_xor (dst, src1, src2)
static int
-abitset_xor_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+abitset_xor_cmp (bitset dst, bitset src1, bitset src2)
{
bitset_windex i;
int changed = 0;
@@ -666,11 +576,7 @@ abitset_xor_cmp (dst, src1, src2)
static void
-abitset_and_or (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+abitset_and_or (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
@@ -685,11 +591,7 @@ abitset_and_or (dst, src1, src2, src3)
static int
-abitset_and_or_cmp (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+abitset_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
int changed = 0;
@@ -714,11 +616,7 @@ abitset_and_or_cmp (dst, src1, src2, src
static void
-abitset_andn_or (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+abitset_andn_or (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
@@ -733,11 +631,7 @@ abitset_andn_or (dst, src1, src2, src3)
static int
-abitset_andn_or_cmp (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+abitset_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
int changed = 0;
@@ -762,11 +656,7 @@ abitset_andn_or_cmp (dst, src1, src2, sr
static void
-abitset_or_and (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+abitset_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
bitset_word *src1p = ABITSET_WORDS (src1);
@@ -781,11 +671,7 @@ abitset_or_and (dst, src1, src2, src3)
static int
-abitset_or_and_cmp (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+abitset_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_windex i;
int changed = 0;
@@ -810,9 +696,7 @@ abitset_or_and_cmp (dst, src1, src2, src
static void
-abitset_copy (dst, src)
- bitset dst;
- bitset src;
+abitset_copy (bitset dst, bitset src)
{
if (BITSET_COMPATIBLE_ (dst, src))
abitset_copy1 (dst, src);
@@ -896,8 +780,7 @@ struct bitset_vtable abitset_vtable = {
size_t
-abitset_bytes (n_bits)
- bitset_bindex n_bits;
+abitset_bytes (bitset_bindex n_bits)
{
bitset_windex size;
size_t bytes;
@@ -921,9 +804,7 @@ abitset_bytes (n_bits)
bitset
-abitset_init (bset, n_bits)
- bitset bset;
- bitset_bindex n_bits;
+abitset_init (bitset bset, bitset_bindex n_bits)
{
bitset_windex size;
Index: lib/bbitset.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/bbitset.h,v
retrieving revision 1.8
diff -p -u -r1.8 bbitset.h
--- lib/bbitset.h 10 Oct 2002 07:15:56 -0000 1.8
+++ lib/bbitset.h 16 Oct 2002 05:52:01 -0000
@@ -25,15 +25,6 @@ Foundation, Inc., 59 Temple Place - Suit
#include <limits.h>
#endif
-/* Use the following types for function parameters where the
- corresponding enum would be the correct type if we could use
- prototyped function definitions. Standard C says that one cannot
- portably use an enum as a parameter of an old-style function
- definition that is also declared with a prototype. */
-
-typedef int enum_bitset_ops;
-typedef int enum_bitset_type;
-
/* Currently we support three flavours of bitsets:
BITSET_ARRAY: Array of bits (fixed size, fast for dense bitsets).
BITSET_LIST: Linked list of array of bits (variable size, least storage
Index: lib/bitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset.c,v
retrieving revision 1.7
diff -p -u -r1.7 bitset.c
--- lib/bitset.c 10 Oct 2002 07:18:47 -0000 1.7
+++ lib/bitset.c 16 Oct 2002 05:52:02 -0000
@@ -30,16 +30,11 @@
const char * const bitset_type_names[] = BITSET_TYPE_NAMES;
-static void bitset_print PARAMS ((FILE *, bitset, int));
-static int bitset_op4_cmp PARAMS ((bitset, bitset, bitset, bitset, int));
-
/* Return number of bytes required to create a N_BIT bitset
of TYPE. The bitset may grow to require more bytes than this. */
size_t
-bitset_bytes (type, n_bits)
- enum_bitset_type type;
- bitset_bindex n_bits;
+bitset_bytes (enum bitset_type type, bitset_bindex n_bits)
{
size_t bytes;
@@ -70,10 +65,7 @@ bitset_bytes (type, n_bits)
/* Initialise bitset BSET of TYPE for N_BITS. */
bitset
-bitset_init (bset, n_bits, type)
- bitset bset;
- bitset_bindex n_bits;
- enum_bitset_type type;
+bitset_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
{
if (bitset_stats_enabled)
return bitset_stats_init (bset, n_bits, type);
@@ -99,9 +91,7 @@ bitset_init (bset, n_bits, type)
specified by ATTR. For variable size bitsets, N_BITS is only a
hint and may be zero. */
enum bitset_type
-bitset_type_choose (n_bits, attr)
- bitset_bindex n_bits ATTRIBUTE_UNUSED;
- unsigned int attr;
+bitset_type_choose (bitset_bindex n_bits ATTRIBUTE_UNUSED, unsigned int attr)
{
enum bitset_type type;
@@ -129,9 +119,7 @@ bitset_type_choose (n_bits, attr)
/* Create a bitset of N_BITS of type TYPE. */
bitset
-bitset_alloc (n_bits, type)
- bitset_bindex n_bits;
- enum_bitset_type type;
+bitset_alloc (bitset_bindex n_bits, enum bitset_type type)
{
size_t bytes;
bitset bset;
@@ -150,10 +138,8 @@ bitset_alloc (n_bits, type)
/* Create a bitset of N_BITS of type TYPE. */
bitset
-bitset_obstack_alloc (bobstack, n_bits, type)
- struct obstack *bobstack;
- bitset_bindex n_bits;
- enum_bitset_type type;
+bitset_obstack_alloc (struct obstack *bobstack,
+ bitset_bindex n_bits, enum bitset_type type)
{
size_t bytes;
bitset bset;
@@ -170,9 +156,7 @@ bitset_obstack_alloc (bobstack, n_bits,
/* Create a bitset of N_BITS and with attribute hints specified by
ATTR. */
bitset
-bitset_create (n_bits, attr)
- bitset_bindex n_bits;
- unsigned int attr;
+bitset_create (bitset_bindex n_bits, unsigned int attr)
{
enum bitset_type type;
@@ -184,8 +168,7 @@ bitset_create (n_bits, attr)
/* Free bitset BSET. */
void
-bitset_free (bset)
- bitset bset;
+bitset_free (bitset bset)
{
BITSET_FREE_ (bset);
free (bset);
@@ -194,8 +177,7 @@ bitset_free (bset)
/* Free bitset BSET allocated on obstack. */
void
-bitset_obstack_free (bset)
- bitset bset;
+bitset_obstack_free (bitset bset)
{
BITSET_FREE_ (bset);
}
@@ -203,8 +185,7 @@ bitset_obstack_free (bset)
/* Return bitset type. */
enum bitset_type
-bitset_type_get (bset)
- bitset bset;
+bitset_type_get (bitset bset)
{
enum bitset_type type;
@@ -218,8 +199,7 @@ bitset_type_get (bset)
/* Return name of bitset type. */
const char *
-bitset_type_name_get (bset)
- bitset bset;
+bitset_type_name_get (bitset bset)
{
enum bitset_type type;
@@ -232,9 +212,7 @@ bitset_type_name_get (bset)
/* Find next bit set in SRC starting from and including BITNO.
Return BITSET_BINDEX_MAX if SRC empty. */
bitset_bindex
-bitset_next (src, bitno)
- bitset src;
- bitset_bindex bitno;
+bitset_next (bitset src, bitset_bindex bitno)
{
bitset_bindex val;
bitset_bindex next = bitno;
@@ -248,9 +226,7 @@ bitset_next (src, bitno)
/* Find previous bit set in SRC starting from and including BITNO.
Return BITSET_BINDEX_MAX if SRC empty. */
bitset_bindex
-bitset_prev (src, bitno)
- bitset src;
- bitset_bindex bitno;
+bitset_prev (bitset src, bitset_bindex bitno)
{
bitset_bindex val;
bitset_bindex next = bitno;
@@ -263,8 +239,7 @@ bitset_prev (src, bitno)
/* Find first set bit. */
bitset_bindex
-bitset_first (src)
- bitset src;
+bitset_first (bitset src)
{
return bitset_next (src, 0);
}
@@ -272,8 +247,7 @@ bitset_first (src)
/* Find last set bit. */
bitset_bindex
-bitset_last (src)
- bitset src;
+bitset_last (bitset src)
{
return bitset_prev (src, 0);
}
@@ -281,9 +255,7 @@ bitset_last (src)
/* Return non-zero if BITNO in SRC is the only set bit. */
int
-bitset_only_set_p (src, bitno)
- bitset src;
- bitset_bindex bitno;
+bitset_only_set_p (bitset src, bitset_bindex bitno)
{
bitset_bindex val[2];
bitset_bindex next = 0;
@@ -296,10 +268,7 @@ bitset_only_set_p (src, bitno)
/* Print contents of bitset BSET to FILE. */
static void
-bitset_print (file, bset, verbose)
- FILE *file;
- bitset bset;
- int verbose;
+bitset_print (FILE *file, bitset bset, int verbose)
{
unsigned int pos;
bitset_bindex i;
@@ -329,9 +298,7 @@ bitset_print (file, bset, verbose)
/* Dump bitset BSET to FILE. */
void
-bitset_dump (file, bset)
- FILE *file;
- bitset bset;
+bitset_dump (FILE *file, bitset bset)
{
bitset_print (file, bset, 0);
}
@@ -340,7 +307,7 @@ bitset_dump (file, bset)
/* Release memory associated with bitsets. */
void
-bitset_release_memory ()
+bitset_release_memory (void)
{
lbitset_release_memory ();
ebitset_release_memory ();
@@ -350,9 +317,7 @@ bitset_release_memory ()
/* Toggle bit BITNO in bitset BSET and return non-zero if not set. */
int
-bitset_toggle_ (bset, bitno)
- bitset bset;
- bitset_bindex bitno;
+bitset_toggle_ (bitset bset, bitset_bindex bitno)
{
/* This routine is for completeness. It could be optimized if
required. */
@@ -371,8 +336,7 @@ bitset_toggle_ (bset, bitno)
/* Return number of bits set in bitset SRC. */
bitset_bindex
-bitset_count_ (src)
- bitset src;
+bitset_count_ (bitset src)
{
bitset_bindex list[BITSET_LIST_SIZE];
bitset_bindex next;
@@ -396,9 +360,7 @@ bitset_count_ (src)
This is a fallback for the case where SRC and DST are different
bitset types. */
int
-bitset_copy_ (dst, src)
- bitset dst;
- bitset src;
+bitset_copy_ (bitset dst, bitset src)
{
bitset_bindex i;
bitset_iterator iter;
@@ -418,12 +380,8 @@ bitset_copy_ (dst, src)
/* This is a fallback for implementations that do not support
four operand operations. */
static inline int
-bitset_op4_cmp (dst, src1, src2, src3, op)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
- enum_bitset_ops op;
+bitset_op4_cmp (bitset dst, bitset src1, bitset src2, bitset src3,
+ enum bitset_ops op)
{
int changed = 0;
int stats_enabled_save;
@@ -463,11 +421,7 @@ bitset_op4_cmp (dst, src1, src2, src3, o
/* DST = (SRC1 & SRC2) | SRC3. */
void
-bitset_and_or_ (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_and_or_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_and_or_cmp_ (dst, src1, src2, src3);
}
@@ -476,11 +430,7 @@ bitset_and_or_ (dst, src1, src2, src3)
/* DST = (SRC1 & SRC2) | SRC3. Return non-zero if
DST != (SRC1 & SRC2) | SRC3. */
int
-bitset_and_or_cmp_ (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_and_or_cmp_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
return bitset_op4_cmp (dst, src1, src2, src3, BITSET_OP_AND_OR);
}
@@ -488,11 +438,7 @@ bitset_and_or_cmp_ (dst, src1, src2, src
/* DST = (SRC1 & ~SRC2) | SRC3. */
void
-bitset_andn_or_ (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_andn_or_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_andn_or_cmp_ (dst, src1, src2, src3);
}
@@ -501,11 +447,7 @@ bitset_andn_or_ (dst, src1, src2, src3)
/* DST = (SRC1 & ~SRC2) | SRC3. Return non-zero if
DST != (SRC1 & ~SRC2) | SRC3. */
int
-bitset_andn_or_cmp_ (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_andn_or_cmp_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
return bitset_op4_cmp (dst, src1, src2, src3, BITSET_OP_ANDN_OR);
}
@@ -513,11 +455,7 @@ bitset_andn_or_cmp_ (dst, src1, src2, sr
/* DST = (SRC1 | SRC2) & SRC3. */
void
-bitset_or_and_ (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_or_and_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
bitset_or_and_cmp_ (dst, src1, src2, src3);
}
@@ -526,11 +464,7 @@ bitset_or_and_ (dst, src1, src2, src3)
/* DST = (SRC1 | SRC2) & SRC3. Return non-zero if
DST != (SRC1 | SRC2) & SRC3. */
int
-bitset_or_and_cmp_ (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_or_and_cmp_ (bitset dst, bitset src1, bitset src2, bitset src3)
{
return bitset_op4_cmp (dst, src1, src2, src3, BITSET_OP_OR_AND);
}
@@ -538,8 +472,7 @@ bitset_or_and_cmp_ (dst, src1, src2, src
/* Function to be called from debugger to print bitset. */
void
-debug_bitset (bset)
- bitset bset;
+debug_bitset (bitset bset)
{
if (bset)
bitset_print (stderr, bset, 1);
Index: lib/bitset.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset.h,v
retrieving revision 1.9
diff -p -u -r1.9 bitset.h
--- lib/bitset.h 10 Oct 2002 07:20:24 -0000 1.9
+++ lib/bitset.h 16 Oct 2002 05:52:02 -0000
@@ -87,10 +87,10 @@ typedef struct
/* Return bytes required for bitset of desired type and size. */
-extern size_t bitset_bytes PARAMS ((enum_bitset_type, bitset_bindex));
+extern size_t bitset_bytes PARAMS ((enum bitset_type, bitset_bindex));
/* Initialise a bitset with desired type and size. */
-extern bitset bitset_init PARAMS ((bitset, bitset_bindex, enum_bitset_type));
+extern bitset bitset_init PARAMS ((bitset, bitset_bindex, enum bitset_type));
/* Select an implementation type based on the desired bitset size
and attributes. */
@@ -98,7 +98,7 @@ extern enum bitset_type bitset_type_choo
bitset_attrs));
/* Create a bitset of desired type and size. The bitset is zeroed. */
-extern bitset bitset_alloc PARAMS ((bitset_bindex, enum_bitset_type));
+extern bitset bitset_alloc PARAMS ((bitset_bindex, enum bitset_type));
/* Free bitset. */
extern void bitset_free PARAMS ((bitset));
@@ -106,7 +106,7 @@ extern void bitset_free PARAMS ((bitset)
/* Create a bitset of desired type and size using an obstack. The
bitset is zeroed. */
extern bitset bitset_obstack_alloc PARAMS ((struct obstack *bobstack,
- bitset_bindex, enum_bitset_type));
+ bitset_bindex, enum bitset_type));
/* Free bitset allocated on obstack. */
extern void bitset_obstack_free PARAMS ((bitset));
@@ -121,14 +121,10 @@ extern enum bitset_type bitset_type_get
extern const char *bitset_type_name_get PARAMS ((bitset));
#if BITSET_INLINE
-static inline void bitset_set PARAMS ((bitset, bitset_bindex));
-static inline void bitset_reset PARAMS ((bitset, bitset_bindex));
-static inline int bitset_test PARAMS ((bitset, bitset_bindex));
/* Set bit BITNO in bitset BSET. */
-static inline void bitset_set (bset, bitno)
- bitset bset;
- bitset_bindex bitno;
+static inline void
+bitset_set (bitset bset, bitset_bindex bitno)
{
bitset_windex index = bitno / BITSET_WORD_BITS;
bitset_windex offset = index - bset->b.cindex;
@@ -141,9 +137,8 @@ static inline void bitset_set (bset, bit
/* Reset bit BITNO in bitset BSET. */
-static inline void bitset_reset (bset, bitno)
- bitset bset;
- bitset_bindex bitno;
+static inline void
+bitset_reset (bitset bset, bitset_bindex bitno)
{
bitset_windex index = bitno / BITSET_WORD_BITS;
bitset_windex offset = index - bset->b.cindex;
@@ -156,9 +151,8 @@ static inline void bitset_reset (bset, b
/* Test bit BITNO in bitset BSET. */
-static inline int bitset_test (bset, bitno)
- bitset bset;
- bitset_bindex bitno;
+static inline int
+bitset_test (bitset bset, bitset_bindex bitno)
{
bitset_windex index = bitno / BITSET_WORD_BITS;
bitset_windex offset = index - bset->b.cindex;
Index: lib/bitset_stats.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset_stats.c,v
retrieving revision 1.5
diff -p -u -r1.5 bitset_stats.c
--- lib/bitset_stats.c 10 Oct 2002 07:23:15 -0000 1.5
+++ lib/bitset_stats.c 16 Oct 2002 05:52:02 -0000
@@ -103,61 +103,10 @@ struct bitset_stats_info_struct *bitset_
int bitset_stats_enabled = 0;
-static void bitset_stats_set PARAMS ((bitset, bitset_bindex));
-static void bitset_stats_reset PARAMS ((bitset, bitset_bindex));
-static int bitset_stats_toggle PARAMS ((bitset, bitset_bindex));
-static int bitset_stats_test PARAMS ((bitset, bitset_bindex));
-static bitset_bindex bitset_stats_size PARAMS ((bitset));
-static bitset_bindex bitset_stats_count PARAMS ((bitset));
-static int bitset_stats_empty_p PARAMS ((bitset));
-static void bitset_stats_ones PARAMS ((bitset));
-static void bitset_stats_zero PARAMS ((bitset));
-static void bitset_stats_copy PARAMS ((bitset, bitset));
-static int bitset_stats_disjoint_p PARAMS ((bitset, bitset));
-static int bitset_stats_equal_p PARAMS ((bitset, bitset));
-static void bitset_stats_not PARAMS ((bitset, bitset));
-static int bitset_stats_subset_p PARAMS ((bitset, bitset));
-static void bitset_stats_and PARAMS ((bitset, bitset, bitset));
-static int bitset_stats_and_cmp PARAMS ((bitset, bitset, bitset));
-static void bitset_stats_andn PARAMS ((bitset, bitset, bitset));
-static int bitset_stats_andn_cmp PARAMS ((bitset, bitset, bitset));
-static void bitset_stats_or PARAMS ((bitset, bitset, bitset));
-static int bitset_stats_or_cmp PARAMS ((bitset, bitset, bitset));
-static void bitset_stats_xor PARAMS ((bitset, bitset, bitset));
-static int bitset_stats_xor_cmp PARAMS ((bitset, bitset, bitset));
-static void bitset_stats_and_or PARAMS ((bitset, bitset, bitset, bitset));
-static int bitset_stats_and_or_cmp PARAMS ((bitset, bitset, bitset, bitset));
-static void bitset_stats_andn_or PARAMS ((bitset, bitset, bitset, bitset));
-static int bitset_stats_andn_or_cmp PARAMS ((bitset, bitset, bitset, bitset));
-static void bitset_stats_or_and PARAMS ((bitset, bitset, bitset, bitset));
-static int bitset_stats_or_and_cmp PARAMS ((bitset, bitset, bitset, bitset));
-static bitset_bindex bitset_stats_list PARAMS ((bitset, bitset_bindex *,
- bitset_bindex,
- bitset_bindex *));
-static bitset_bindex bitset_stats_list_reverse
-PARAMS ((bitset, bitset_bindex *, bitset_bindex, bitset_bindex *));
-static void bitset_stats_free PARAMS ((bitset));
-static void bitset_percent_histogram_print PARAMS ((FILE *, const char *,
- const char *,
- unsigned int,
- unsigned int *));
-static void bitset_log_histogram_print PARAMS ((FILE *, const char *,
- const char *,
- unsigned int,
- unsigned int *));
-static void bitset_stats_print_1
-PARAMS ((FILE *, const char *, struct bitset_type_info_struct *));
-static void bitset_stats_print PARAMS ((FILE *, int));
-
-
/* Print a percentage histogram with message MSG to FILE. */
static void
-bitset_percent_histogram_print (file, name, msg, n_bins, bins)
- FILE *file;
- const char *name;
- const char *msg;
- unsigned int n_bins;
- unsigned int *bins;
+bitset_percent_histogram_print (FILE *file, const char *name, const char *msg,
+ unsigned int n_bins, unsigned int *bins)
{
unsigned int i;
unsigned int total;
@@ -180,12 +129,8 @@ bitset_percent_histogram_print (file, na
/* Print a log histogram with message MSG to FILE. */
static void
-bitset_log_histogram_print (file, name, msg, n_bins, bins)
- FILE *file;
- const char *name;
- const char *msg;
- unsigned int n_bins;
- unsigned int *bins;
+bitset_log_histogram_print (FILE *file, const char *name, const char *msg,
+ unsigned int n_bins, unsigned int *bins)
{
unsigned int i;
unsigned int total;
@@ -223,10 +168,8 @@ bitset_log_histogram_print (file, name,
/* Print bitset statistics to FILE. */
static void
-bitset_stats_print_1 (file, name, stats)
- FILE *file;
- const char *name;
- struct bitset_type_info_struct *stats;
+bitset_stats_print_1 (FILE *file, const char *name,
+ struct bitset_type_info_struct *stats)
{
if (!stats)
return;
@@ -260,9 +203,7 @@ bitset_stats_print_1 (file, name, stats)
/* Print all bitset statistics to FILE. */
static void
-bitset_stats_print (file, verbose)
- FILE *file;
- int verbose ATTRIBUTE_UNUSED;
+bitset_stats_print (FILE *file, int verbose ATTRIBUTE_UNUSED)
{
int i;
@@ -282,7 +223,7 @@ bitset_stats_print (file, verbose)
/* Initialise bitset statistics logging. */
void
-bitset_stats_enable ()
+bitset_stats_enable (void)
{
if (!bitset_stats_info)
bitset_stats_info = &bitset_stats_info_data;
@@ -291,7 +232,7 @@ bitset_stats_enable ()
void
-bitset_stats_disable ()
+bitset_stats_disable (void)
{
bitset_stats_enabled = 0;
}
@@ -299,8 +240,7 @@ bitset_stats_disable ()
/* Read bitset statistics file. */
void
-bitset_stats_read (filename)
- const char *filename;
+bitset_stats_read (const char *filename)
{
FILE *file;
@@ -329,8 +269,7 @@ bitset_stats_read (filename)
/* Write bitset statistics file. */
void
-bitset_stats_write (filename)
- const char *filename;
+bitset_stats_write (const char *filename)
{
FILE *file;
@@ -355,8 +294,7 @@ bitset_stats_write (filename)
/* Dump bitset statistics to FILE. */
void
-bitset_stats_dump (file)
- FILE *file;
+bitset_stats_dump (FILE *file)
{
bitset_stats_print (file, 0);
}
@@ -371,9 +309,7 @@ debug_bitset_stats (void)
static void
-bitset_stats_set (dst, bitno)
- bitset dst;
- bitset_bindex bitno;
+bitset_stats_set (bitset dst, bitset_bindex bitno)
{
bitset bset = dst->s.bset;
bitset_windex wordno = bitno / BITSET_WORD_BITS;
@@ -392,9 +328,7 @@ bitset_stats_set (dst, bitno)
static void
-bitset_stats_reset (dst, bitno)
- bitset dst;
- bitset_bindex bitno;
+bitset_stats_reset (bitset dst, bitset_bindex bitno)
{
bitset bset = dst->s.bset;
bitset_windex wordno = bitno / BITSET_WORD_BITS;
@@ -414,18 +348,14 @@ bitset_stats_reset (dst, bitno)
static int
-bitset_stats_toggle (src, bitno)
- bitset src;
- bitset_bindex bitno;
+bitset_stats_toggle (bitset src, bitset_bindex bitno)
{
return BITSET_TOGGLE_ (src->s.bset, bitno);
}
static int
-bitset_stats_test (src, bitno)
- bitset src;
- bitset_bindex bitno;
+bitset_stats_test (bitset src, bitset_bindex bitno)
{
bitset bset = src->s.bset;
bitset_windex wordno = bitno / BITSET_WORD_BITS;
@@ -444,49 +374,42 @@ bitset_stats_test (src, bitno)
static bitset_bindex
-bitset_stats_size (src)
- bitset src;
+bitset_stats_size (bitset src)
{
return BITSET_SIZE_ (src->s.bset);
}
static bitset_bindex
-bitset_stats_count (src)
- bitset src;
+bitset_stats_count (bitset src)
{
return BITSET_COUNT_ (src->s.bset);
}
static int
-bitset_stats_empty_p (dst)
- bitset dst;
+bitset_stats_empty_p (bitset dst)
{
return BITSET_EMPTY_P_ (dst->s.bset);
}
static void
-bitset_stats_ones (dst)
- bitset dst;
+bitset_stats_ones (bitset dst)
{
BITSET_ONES_ (dst->s.bset);
}
static void
-bitset_stats_zero (dst)
- bitset dst;
+bitset_stats_zero (bitset dst)
{
BITSET_ZERO_ (dst->s.bset);
}
static void
-bitset_stats_copy (dst, src)
- bitset dst;
- bitset src;
+bitset_stats_copy (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
BITSET_COPY_ (dst->s.bset, src->s.bset);
@@ -494,9 +417,7 @@ bitset_stats_copy (dst, src)
static int
-bitset_stats_disjoint_p (dst, src)
- bitset dst;
- bitset src;
+bitset_stats_disjoint_p (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
return BITSET_DISJOINT_P_ (dst->s.bset, src->s.bset);
@@ -504,9 +425,7 @@ bitset_stats_disjoint_p (dst, src)
static int
-bitset_stats_equal_p (dst, src)
- bitset dst;
- bitset src;
+bitset_stats_equal_p (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
return BITSET_EQUAL_P_ (dst->s.bset, src->s.bset);
@@ -514,9 +433,7 @@ bitset_stats_equal_p (dst, src)
static void
-bitset_stats_not (dst, src)
- bitset dst;
- bitset src;
+bitset_stats_not (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
BITSET_NOT_ (dst->s.bset, src->s.bset);
@@ -524,9 +441,7 @@ bitset_stats_not (dst, src)
static int
-bitset_stats_subset_p (dst, src)
- bitset dst;
- bitset src;
+bitset_stats_subset_p (bitset dst, bitset src)
{
BITSET_CHECK2_ (dst, src);
return BITSET_SUBSET_P_ (dst->s.bset, src->s.bset);
@@ -534,10 +449,7 @@ bitset_stats_subset_p (dst, src)
static void
-bitset_stats_and (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+bitset_stats_and (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
BITSET_AND_ (dst->s.bset, src1->s.bset, src2->s.bset);
@@ -545,10 +457,7 @@ bitset_stats_and (dst, src1, src2)
static int
-bitset_stats_and_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+bitset_stats_and_cmp (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
return BITSET_AND_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset);
@@ -556,10 +465,7 @@ bitset_stats_and_cmp (dst, src1, src2)
static void
-bitset_stats_andn (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+bitset_stats_andn (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
BITSET_ANDN_ (dst->s.bset, src1->s.bset, src2->s.bset);
@@ -567,10 +473,7 @@ bitset_stats_andn (dst, src1, src2)
static int
-bitset_stats_andn_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+bitset_stats_andn_cmp (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
return BITSET_ANDN_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset);
@@ -578,10 +481,7 @@ bitset_stats_andn_cmp (dst, src1, src2)
static void
-bitset_stats_or (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+bitset_stats_or (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
BITSET_OR_ (dst->s.bset, src1->s.bset, src2->s.bset);
@@ -589,10 +489,7 @@ bitset_stats_or (dst, src1, src2)
static int
-bitset_stats_or_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+bitset_stats_or_cmp (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
return BITSET_OR_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset);
@@ -600,10 +497,7 @@ bitset_stats_or_cmp (dst, src1, src2)
static void
-bitset_stats_xor (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+bitset_stats_xor (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
BITSET_XOR_ (dst->s.bset, src1->s.bset, src2->s.bset);
@@ -611,10 +505,7 @@ bitset_stats_xor (dst, src1, src2)
static int
-bitset_stats_xor_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+bitset_stats_xor_cmp (bitset dst, bitset src1, bitset src2)
{
BITSET_CHECK3_ (dst, src1, src2);
return BITSET_XOR_CMP_ (dst->s.bset, src1->s.bset, src2->s.bset);
@@ -622,11 +513,7 @@ bitset_stats_xor_cmp (dst, src1, src2)
static void
-bitset_stats_and_or (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_stats_and_or (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
@@ -635,11 +522,7 @@ bitset_stats_and_or (dst, src1, src2, sr
static int
-bitset_stats_and_or_cmp (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_stats_and_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
@@ -648,11 +531,7 @@ bitset_stats_and_or_cmp (dst, src1, src2
static void
-bitset_stats_andn_or (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_stats_andn_or (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
@@ -661,11 +540,7 @@ bitset_stats_andn_or (dst, src1, src2, s
static int
-bitset_stats_andn_or_cmp (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_stats_andn_or_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
@@ -674,11 +549,7 @@ bitset_stats_andn_or_cmp (dst, src1, src
static void
-bitset_stats_or_and (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_stats_or_and (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
@@ -687,11 +558,7 @@ bitset_stats_or_and (dst, src1, src2, sr
static int
-bitset_stats_or_and_cmp (dst, src1, src2, src3)
- bitset dst;
- bitset src1;
- bitset src2;
- bitset src3;
+bitset_stats_or_and_cmp (bitset dst, bitset src1, bitset src2, bitset src3)
{
BITSET_CHECK4_ (dst, src1, src2, src3);
@@ -700,11 +567,8 @@ bitset_stats_or_and_cmp (dst, src1, src2
static bitset_bindex
-bitset_stats_list (bset, list, num, next)
- bitset bset;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+bitset_stats_list (bitset bset, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex count;
bitset_bindex tmp;
@@ -742,19 +606,15 @@ bitset_stats_list (bset, list, num, next
static bitset_bindex
-bitset_stats_list_reverse (bset, list, num, next)
- bitset bset;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+bitset_stats_list_reverse (bitset bset, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
return BITSET_LIST_REVERSE_ (bset->s.bset, list, num, next);
}
static void
-bitset_stats_free (bset)
- bitset bset;
+bitset_stats_free (bitset bset)
{
BITSET_STATS_FREES_INC (bset->s.bset);
BITSET_FREE_ (bset->s.bset);
@@ -799,8 +659,7 @@ struct bitset_vtable bitset_stats_vtable
/* Return enclosed bitset type. */
enum bitset_type
-bitset_stats_type_get (bset)
- bitset bset;
+bitset_stats_type_get (bitset bset)
{
return BITSET_TYPE_ (bset->s.bset);
}
@@ -814,10 +673,7 @@ bitset_stats_bytes (void)
bitset
-bitset_stats_init (bset, n_bits, type)
- bitset bset;
- bitset_bindex n_bits;
- enum_bitset_type type;
+bitset_stats_init (bitset bset, bitset_bindex n_bits, enum bitset_type type)
{
size_t bytes;
bitset sbset;
Index: lib/bitset_stats.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitset_stats.h,v
retrieving revision 1.3
diff -p -u -r1.3 bitset_stats.h
--- lib/bitset_stats.h 10 Oct 2002 07:23:50 -0000 1.3
+++ lib/bitset_stats.h 16 Oct 2002 05:52:02 -0000
@@ -28,6 +28,6 @@ extern enum bitset_type bitset_stats_typ
extern size_t bitset_stats_bytes PARAMS ((void));
extern bitset bitset_stats_init PARAMS ((bitset, bitset_bindex,
- enum_bitset_type));
+ enum bitset_type));
#endif
Index: lib/bitsetv.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitsetv.c,v
retrieving revision 1.7
diff -p -u -r1.7 bitsetv.c
--- lib/bitsetv.c 10 Oct 2002 07:25:21 -0000 1.7
+++ lib/bitsetv.c 16 Oct 2002 05:52:02 -0000
@@ -29,10 +29,8 @@ Software Foundation, 59 Temple Place - S
/* Create a vector of N_VECS bitsets, each of N_BITS, and of
type TYPE. */
bitset *
-bitsetv_alloc (n_vecs, n_bits, type)
- bitset_bindex n_vecs;
- bitset_bindex n_bits;
- enum_bitset_type type;
+bitsetv_alloc (bitset_bindex n_vecs, bitset_bindex n_bits,
+ enum bitset_type type)
{
size_t vector_bytes;
size_t bytes;
@@ -67,10 +65,7 @@ bitsetv_alloc (n_vecs, n_bits, type)
/* Create a vector of N_VECS bitsets, each of N_BITS, and with
attribute hints specified by ATTR. */
bitset *
-bitsetv_create (n_vecs, n_bits, attr)
- bitset_bindex n_vecs;
- bitset_bindex n_bits;
- unsigned int attr;
+bitsetv_create (bitset_bindex n_vecs, bitset_bindex n_bits, unsigned int attr)
{
enum bitset_type type;
@@ -81,8 +76,7 @@ bitsetv_create (n_vecs, n_bits, attr)
/* Free bitset vector BSETV. */
void
-bitsetv_free (bsetv)
- bitset *bsetv;
+bitsetv_free (bitsetv bsetv)
{
bitset_bindex i;
@@ -94,8 +88,7 @@ bitsetv_free (bsetv)
/* Zero a vector of bitsets. */
void
-bitsetv_zero (bsetv)
- bitsetv bsetv;
+bitsetv_zero (bitsetv bsetv)
{
bitset_bindex i;
@@ -106,8 +99,7 @@ bitsetv_zero (bsetv)
/* Set a vector of bitsets to ones. */
void
-bitsetv_ones (bsetv)
- bitset *bsetv;
+bitsetv_ones (bitsetv bsetv)
{
bitset_bindex i;
@@ -119,8 +111,7 @@ bitsetv_ones (bsetv)
/* Given a vector BSETV of N bitsets of size N, modify its contents to
be the transitive closure of what was given. */
void
-bitsetv_transitive_closure (bsetv)
- bitset *bsetv;
+bitsetv_transitive_closure (bitsetv bsetv)
{
bitset_bindex i;
bitset_bindex j;
@@ -150,10 +141,8 @@ bitsetv_reflexive_transitive_closure (bi
/* Dump the contents of a bitset vector BSETV with N_VECS elements to
FILE. */
void
-bitsetv_dump (file, title, subtitle, bsetv)
- FILE *file;
- const char *title, *subtitle;
- bitset *bsetv;
+bitsetv_dump (FILE *file, char const *title, char const *subtitle,
+ bitsetv bsetv)
{
bitset_windex i;
@@ -169,8 +158,7 @@ bitsetv_dump (file, title, subtitle, bse
void
-debug_bitsetv (bsetv)
- bitset *bsetv;
+debug_bitsetv (bitsetv bsetv)
{
bitset_windex i;
Index: lib/bitsetv.h
===================================================================
RCS file: /cvsroot/bison/bison/lib/bitsetv.h,v
retrieving revision 1.5
diff -p -u -r1.5 bitsetv.h
--- lib/bitsetv.h 10 Oct 2002 07:26:15 -0000 1.5
+++ lib/bitsetv.h 16 Oct 2002 05:52:02 -0000
@@ -26,7 +26,7 @@ typedef bitset * bitsetv;
/* Create a vector of N_VECS bitsets, each of N_BITS, and of
type TYPE. */
extern bitsetv bitsetv_alloc PARAMS ((bitset_bindex, bitset_bindex,
- enum_bitset_type));
+ enum bitset_type));
/* Create a vector of N_VECS bitsets, each of N_BITS, and with
attribute hints specified by ATTR. */
Index: lib/ebitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/ebitset.c,v
retrieving revision 1.9
diff -p -u -r1.9 ebitset.c
--- lib/ebitset.c 10 Oct 2002 07:28:53 -0000 1.9
+++ lib/ebitset.c 16 Oct 2002 05:52:02 -0000
@@ -83,7 +83,6 @@ typedef ebitset_elt *ebitset_elts;
enum ebitset_find_mode
{ EBITSET_FIND, EBITSET_CREATE, EBITSET_SUBST };
-typedef int enum_ebitset_find_mode;
static ebitset_elt ebitset_zero_elts[1]; /* Elements of all zero bits. */
@@ -92,47 +91,6 @@ static struct obstack ebitset_obstack;
static int ebitset_obstack_init = 0;
static ebitset_elt *ebitset_free_list; /* Free list of bitset elements. */
-static void ebitset_elts_grow PARAMS ((bitset, bitset_windex));
-static ebitset_elt *ebitset_elt_alloc PARAMS ((void));
-static ebitset_elt *ebitset_elt_calloc PARAMS ((void));
-static void ebitset_elt_add PARAMS ((bitset, ebitset_elt *, bitset_windex));
-static void ebitset_elt_remove PARAMS ((bitset, bitset_windex));
-static void ebitset_elt_free PARAMS ((ebitset_elt *));
-static ebitset_elt *ebitset_elt_find PARAMS ((bitset, bitset_windex,
- enum_ebitset_find_mode));
-static ebitset_elt *ebitset_elt_last PARAMS ((bitset));
-static int ebitset_elt_zero_p PARAMS ((ebitset_elt *));
-
-static bitset_windex ebitset_weed PARAMS ((bitset));
-static void ebitset_zero PARAMS ((bitset));
-static void ebitset_copy_ PARAMS ((bitset, bitset));
-static int ebitset_copy_cmp PARAMS ((bitset, bitset));
-static void ebitset_set PARAMS ((bitset, bitset_bindex));
-static void ebitset_reset PARAMS ((bitset, bitset_bindex));
-static int ebitset_test PARAMS ((bitset, bitset_bindex));
-static bitset_bindex ebitset_size PARAMS ((bitset));
-static int ebitset_disjoint_p PARAMS ((bitset, bitset));
-static int ebitset_equal_p PARAMS ((bitset, bitset));
-static void ebitset_not PARAMS ((bitset, bitset));
-static int ebitset_subset_p PARAMS ((bitset, bitset));
-static int ebitset_op3_cmp PARAMS ((bitset, bitset, bitset, enum_bitset_ops));
-static void ebitset_and PARAMS ((bitset, bitset, bitset));
-static int ebitset_and_cmp PARAMS ((bitset, bitset, bitset));
-static void ebitset_andn PARAMS ((bitset, bitset, bitset));
-static int ebitset_andn_cmp PARAMS ((bitset, bitset, bitset));
-static void ebitset_or PARAMS ((bitset, bitset, bitset));
-static int ebitset_or_cmp PARAMS ((bitset, bitset, bitset));
-static void ebitset_xor PARAMS ((bitset, bitset, bitset));
-static int ebitset_xor_cmp PARAMS ((bitset, bitset, bitset));
-static void ebitset_copy PARAMS ((bitset, bitset));
-static bitset_bindex ebitset_list PARAMS ((bitset, bitset_bindex *,
- bitset_bindex, bitset_bindex *));
-static bitset_bindex ebitset_list_reverse
-PARAMS ((bitset, bitset_bindex *, bitset_bindex, bitset_bindex *));
-static void ebitset_ones PARAMS ((bitset));
-static int ebitset_empty_p PARAMS ((bitset));
-static void ebitset_free PARAMS ((bitset));
-
#define EBITSET_ELTS(BSET) ((BSET)->e.elts)
#define EBITSET_SIZE(BSET) ((BSET)->e.size)
@@ -162,9 +120,7 @@ static void ebitset_free PARAMS ((bitset
/* Grow the expandable table for BSET by SIZE elements. */
static void
-ebitset_elts_grow (bset, size)
- bitset bset;
- bitset_windex size;
+ebitset_elts_grow (bitset bset, bitset_windex size)
{
bitset_windex oldsize;
bitset_windex newsize;
@@ -185,7 +141,7 @@ ebitset_elts_grow (bset, size)
/* Allocate a ebitset element. The bits are not cleared. */
static inline ebitset_elt *
-ebitset_elt_alloc ()
+ebitset_elt_alloc (void)
{
ebitset_elt *elt;
@@ -240,7 +196,7 @@ ebitset_elt_alloc ()
/* Allocate a ebitset element. The bits are cleared. */
static inline ebitset_elt *
-ebitset_elt_calloc ()
+ebitset_elt_calloc (void)
{
ebitset_elt *elt;
@@ -251,8 +207,7 @@ ebitset_elt_calloc ()
static inline void
-ebitset_elt_free (elt)
- ebitset_elt *elt;
+ebitset_elt_free (ebitset_elt *elt)
{
EBITSET_NEXT (elt) = ebitset_free_list;
ebitset_free_list = elt;
@@ -261,9 +216,7 @@ ebitset_elt_free (elt)
/* Remove element with index EINDEX from bitset BSET. */
static inline void
-ebitset_elt_remove (bset, eindex)
- bitset bset;
- bitset_windex eindex;
+ebitset_elt_remove (bitset bset, bitset_windex eindex)
{
ebitset_elts *elts;
ebitset_elt *elt;
@@ -279,10 +232,7 @@ ebitset_elt_remove (bset, eindex)
/* Add ELT into elts at index EINDEX of bitset BSET. */
static inline void
-ebitset_elt_add (bset, elt, eindex)
- bitset bset;
- ebitset_elt *elt;
- bitset_windex eindex;
+ebitset_elt_add (bitset bset, ebitset_elt *elt, bitset_windex eindex)
{
ebitset_elts *elts;
@@ -294,8 +244,7 @@ ebitset_elt_add (bset, elt, eindex)
/* Return nonzero if all bits in an element are zero. */
static inline int
-ebitset_elt_zero_p (elt)
- ebitset_elt *elt;
+ebitset_elt_zero_p (ebitset_elt *elt)
{
int i;
@@ -308,10 +257,8 @@ ebitset_elt_zero_p (elt)
static ebitset_elt *
-ebitset_elt_find (bset, windex, mode)
- bitset bset;
- bitset_windex windex;
- enum_ebitset_find_mode mode;
+ebitset_elt_find (bitset bset, bitset_windex windex,
+ enum ebitset_find_mode mode)
{
ebitset_elt *elt;
bitset_windex size;
@@ -376,8 +323,7 @@ ebitset_elt_find (bset, windex, mode)
static inline ebitset_elt *
-ebitset_elt_last (bset)
- bitset bset;
+ebitset_elt_last (bitset bset)
{
ebitset_elts *elts;
@@ -390,8 +336,7 @@ ebitset_elt_last (bset)
/* Weed out the zero elements from the elts. */
static inline bitset_windex
-ebitset_weed (bset)
- bitset bset;
+ebitset_weed (bitset bset)
{
ebitset_elts *elts;
bitset_windex j;
@@ -434,8 +379,7 @@ ebitset_weed (bset)
/* Set all bits in the bitset to zero. */
static inline void
-ebitset_zero (bset)
- bitset bset;
+ebitset_zero (bitset bset)
{
ebitset_elts *elts;
bitset_windex j;
@@ -459,9 +403,7 @@ ebitset_zero (bset)
static inline int
-ebitset_equal_p (dst, src)
- bitset dst;
- bitset src;
+ebitset_equal_p (bitset dst, bitset src)
{
ebitset_elts *selts;
ebitset_elts *delts;
@@ -500,9 +442,7 @@ ebitset_equal_p (dst, src)
/* Copy bits from bitset SRC to bitset DST. */
static inline void
-ebitset_copy_ (dst, src)
- bitset dst;
- bitset src;
+ebitset_copy_ (bitset dst, bitset src)
{
ebitset_elts *selts;
ebitset_elts *delts;
@@ -539,9 +479,7 @@ ebitset_copy_ (dst, src)
/* Copy bits from bitset SRC to bitset DST. Return non-zero if
bitsets different. */
static inline int
-ebitset_copy_cmp (dst, src)
- bitset dst;
- bitset src;
+ebitset_copy_cmp (bitset dst, bitset src)
{
if (src == dst)
return 0;
@@ -562,8 +500,7 @@ ebitset_copy_cmp (dst, src)
/* Return size in bits of bitset SRC. */
static bitset_bindex
-ebitset_size (src)
- bitset src;
+ebitset_size (bitset src)
{
/* Return current size of bitset in bits. */
return EBITSET_SIZE (src) * EBITSET_ELT_BITS;
@@ -572,9 +509,7 @@ ebitset_size (src)
/* Set bit BITNO in bitset DST. */
static void
-ebitset_set (dst, bitno)
- bitset dst;
- bitset_bindex bitno;
+ebitset_set (bitset dst, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
@@ -587,9 +522,7 @@ ebitset_set (dst, bitno)
/* Reset bit BITNO in bitset DST. */
static void
-ebitset_reset (dst, bitno)
- bitset dst;
- bitset_bindex bitno;
+ebitset_reset (bitset dst, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
@@ -607,9 +540,7 @@ ebitset_reset (dst, bitno)
/* Test bit BITNO in bitset SRC. */
static int
-ebitset_test (src, bitno)
- bitset src;
- bitset_bindex bitno;
+ebitset_test (bitset src, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
@@ -622,8 +553,7 @@ ebitset_test (src, bitno)
static void
-ebitset_free (bset)
- bitset bset;
+ebitset_free (bitset bset)
{
ebitset_zero (bset);
free (EBITSET_ELTS (bset));
@@ -634,11 +564,8 @@ ebitset_free (bset)
*NEXT and store in array LIST. Return with actual number of bits
found and with *NEXT indicating where search stopped. */
static bitset_bindex
-ebitset_list_reverse (bset, list, num, next)
- bitset bset;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+ebitset_list_reverse (bitset bset, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex n_bits;
bitset_bindex bitno;
@@ -726,11 +653,8 @@ ebitset_list_reverse (bset, list, num, n
*NEXT and store in array LIST. Return with actual number of bits
found and with *NEXT indicating where search stopped. */
static bitset_bindex
-ebitset_list (bset, list, num, next)
- bitset bset;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+ebitset_list (bitset bset, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_windex windex;
@@ -866,8 +790,7 @@ ebitset_list (bset, list, num, next)
static void
-ebitset_ones (dst)
- bitset dst;
+ebitset_ones (bitset dst)
{
bitset_windex j;
ebitset_elt *elt;
@@ -886,17 +809,14 @@ ebitset_ones (dst)
static int
-ebitset_empty_p (dst)
- bitset dst;
+ebitset_empty_p (bitset dst)
{
return !ebitset_weed (dst);
}
static void
-ebitset_not (dst, src)
- bitset dst;
- bitset src;
+ebitset_not (bitset dst, bitset src)
{
unsigned int i;
ebitset_elt *selt;
@@ -921,9 +841,7 @@ ebitset_not (dst, src)
/* Return 1 if DST == DST | SRC. */
static int
-ebitset_subset_p (dst, src)
- bitset dst;
- bitset src;
+ebitset_subset_p (bitset dst, bitset src)
{
bitset_windex j;
ebitset_elts *selts;
@@ -965,9 +883,7 @@ ebitset_subset_p (dst, src)
/* Return 1 if DST & SRC == 0. */
static int
-ebitset_disjoint_p (dst, src)
- bitset dst;
- bitset src;
+ebitset_disjoint_p (bitset dst, bitset src)
{
bitset_windex j;
ebitset_elts *selts;
@@ -1003,11 +919,7 @@ ebitset_disjoint_p (dst, src)
static int
-ebitset_op3_cmp (dst, src1, src2, op)
- bitset dst;
- bitset src1;
- bitset src2;
- enum_bitset_ops op;
+ebitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
{
bitset_windex ssize1;
bitset_windex ssize2;
@@ -1155,21 +1067,8 @@ ebitset_op3_cmp (dst, src1, src2, op)
}
-static void
-ebitset_and (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
-{
- ebitset_and_cmp (dst, src1, src2);
-}
-
-
static int
-ebitset_and_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+ebitset_and_cmp (bitset dst, bitset src1, bitset src2)
{
int changed;
@@ -1192,20 +1091,14 @@ ebitset_and_cmp (dst, src1, src2)
static void
-ebitset_andn (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+ebitset_and (bitset dst, bitset src1, bitset src2)
{
- ebitset_andn_cmp (dst, src1, src2);
+ ebitset_and_cmp (dst, src1, src2);
}
static int
-ebitset_andn_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+ebitset_andn_cmp (bitset dst, bitset src1, bitset src2)
{
int changed;
@@ -1225,20 +1118,14 @@ ebitset_andn_cmp (dst, src1, src2)
static void
-ebitset_or (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+ebitset_andn (bitset dst, bitset src1, bitset src2)
{
- ebitset_or_cmp (dst, src1, src2);
+ ebitset_andn_cmp (dst, src1, src2);
}
static int
-ebitset_or_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+ebitset_or_cmp (bitset dst, bitset src1, bitset src2)
{
if (EBITSET_ZERO_P (src2))
{
@@ -1253,20 +1140,14 @@ ebitset_or_cmp (dst, src1, src2)
static void
-ebitset_xor (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+ebitset_or (bitset dst, bitset src1, bitset src2)
{
- ebitset_xor_cmp (dst, src1, src2);
+ ebitset_or_cmp (dst, src1, src2);
}
static int
-ebitset_xor_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+ebitset_xor_cmp (bitset dst, bitset src1, bitset src2)
{
if (EBITSET_ZERO_P (src2))
{
@@ -1281,9 +1162,14 @@ ebitset_xor_cmp (dst, src1, src2)
static void
-ebitset_copy (dst, src)
- bitset dst;
- bitset src;
+ebitset_xor (bitset dst, bitset src1, bitset src2)
+{
+ ebitset_xor_cmp (dst, src1, src2);
+}
+
+
+static void
+ebitset_copy (bitset dst, bitset src)
{
if (BITSET_COMPATIBLE_ (dst, src))
ebitset_copy_ (dst, src);
@@ -1331,8 +1217,7 @@ struct bitset_vtable ebitset_vtable = {
/* Return size of initial structure. */
size_t
-ebitset_bytes (n_bits)
- bitset_bindex n_bits ATTRIBUTE_UNUSED;
+ebitset_bytes (bitset_bindex n_bits ATTRIBUTE_UNUSED)
{
return sizeof (struct ebitset_struct);
}
@@ -1341,9 +1226,7 @@ ebitset_bytes (n_bits)
/* Initialize a bitset. */
bitset
-ebitset_init (bset, n_bits)
- bitset bset;
- bitset_bindex n_bits;
+ebitset_init (bitset bset, bitset_bindex n_bits)
{
bitset_windex size;
@@ -1365,7 +1248,7 @@ ebitset_init (bset, n_bits)
void
-ebitset_release_memory ()
+ebitset_release_memory (void)
{
ebitset_free_list = 0;
if (ebitset_obstack_init)
Index: lib/lbitset.c
===================================================================
RCS file: /cvsroot/bison/bison/lib/lbitset.c,v
retrieving revision 1.9
diff -p -u -r1.9 lbitset.c
--- lib/lbitset.c 10 Oct 2002 07:33:59 -0000 1.9
+++ lib/lbitset.c 16 Oct 2002 05:52:02 -0000
@@ -66,7 +66,6 @@ lbitset_elt;
enum lbitset_find_mode
{ LBITSET_FIND, LBITSET_CREATE, LBITSET_SUBST };
-typedef int enum_lbitset_find_mode;
static lbitset_elt lbitset_zero_elts[3]; /* Elements of all zero bits. */
@@ -75,44 +74,6 @@ static struct obstack lbitset_obstack;
static int lbitset_obstack_init = 0;
static lbitset_elt *lbitset_free_list; /* Free list of bitset elements. */
-static lbitset_elt *lbitset_elt_alloc PARAMS ((void));
-static lbitset_elt *lbitset_elt_calloc PARAMS ((void));
-static void lbitset_elt_link PARAMS ((bitset, lbitset_elt *));
-static void lbitset_elt_unlink PARAMS ((bitset, lbitset_elt *));
-static void lbitset_elt_free PARAMS ((lbitset_elt *));
-static lbitset_elt *lbitset_elt_find PARAMS ((bitset, bitset_windex,
- enum_lbitset_find_mode));
-static int lbitset_elt_zero_p PARAMS ((lbitset_elt *));
-
-static void lbitset_prune PARAMS ((bitset, lbitset_elt *));
-static void lbitset_weed PARAMS ((bitset));
-static void lbitset_zero PARAMS ((bitset));
-static int lbitset_equal_p PARAMS ((bitset, bitset));
-static void lbitset_copy PARAMS ((bitset, bitset));
-static int lbitset_copy_cmp PARAMS ((bitset, bitset));
-static void lbitset_set PARAMS ((bitset, bitset_bindex));
-static void lbitset_reset PARAMS ((bitset, bitset_bindex));
-static int lbitset_test PARAMS ((bitset, bitset_bindex));
-static bitset_bindex lbitset_size PARAMS ((bitset));
-static int lbitset_op3_cmp PARAMS ((bitset, bitset, bitset, enum_bitset_ops));
-static void lbitset_and PARAMS ((bitset, bitset, bitset));
-static int lbitset_and_cmp PARAMS ((bitset, bitset, bitset));
-static void lbitset_andn PARAMS ((bitset, bitset, bitset));
-static int lbitset_andn_cmp PARAMS ((bitset, bitset, bitset));
-static void lbitset_or PARAMS ((bitset, bitset, bitset));
-static int lbitset_or_cmp PARAMS ((bitset, bitset, bitset));
-static void lbitset_xor PARAMS ((bitset, bitset, bitset));
-static int lbitset_xor_cmp PARAMS ((bitset, bitset, bitset));
-static bitset_bindex lbitset_list PARAMS ((bitset, bitset_bindex *,
- bitset_bindex, bitset_bindex *));
-static bitset_bindex lbitset_list_reverse
-PARAMS ((bitset, bitset_bindex *, bitset_bindex, bitset_bindex *));
-static int lbitset_empty_p PARAMS ((bitset));
-static void lbitset_ones PARAMS ((bitset));
-static void lbitset_not PARAMS ((bitset, bitset));
-static int lbitset_subset_p PARAMS ((bitset, bitset));
-static int lbitset_disjoint_p PARAMS ((bitset, bitset));
-static void lbitset_free PARAMS ((bitset));
extern void debug_lbitset PARAMS ((bitset));
#define LBITSET_CURRENT1(X) \
@@ -125,7 +86,7 @@ extern void debug_lbitset PARAMS ((bitse
/* Allocate a lbitset element. The bits are not cleared. */
static inline lbitset_elt *
-lbitset_elt_alloc ()
+lbitset_elt_alloc (void)
{
lbitset_elt *elt;
@@ -180,7 +141,7 @@ lbitset_elt_alloc ()
/* Allocate a lbitset element. The bits are cleared. */
static inline lbitset_elt *
-lbitset_elt_calloc ()
+lbitset_elt_calloc (void)
{
lbitset_elt *elt;
@@ -191,8 +152,7 @@ lbitset_elt_calloc ()
static inline void
-lbitset_elt_free (elt)
- lbitset_elt *elt;
+lbitset_elt_free (lbitset_elt *elt)
{
elt->next = lbitset_free_list;
lbitset_free_list = elt;
@@ -201,9 +161,7 @@ lbitset_elt_free (elt)
/* Unlink element ELT from bitset BSET. */
static inline void
-lbitset_elt_unlink (bset, elt)
- bitset bset;
- lbitset_elt *elt;
+lbitset_elt_unlink (bitset bset, lbitset_elt *elt)
{
lbitset_elt *next = elt->next;
lbitset_elt *prev = elt->prev;
@@ -248,9 +206,7 @@ lbitset_elt_unlink (bset, elt)
/* Cut the chain of bitset BSET before element ELT and free the
elements. */
static inline void
-lbitset_prune (bset, elt)
- bitset bset;
- lbitset_elt *elt;
+lbitset_prune (bitset bset, lbitset_elt *elt)
{
lbitset_elt *next;
@@ -282,8 +238,7 @@ lbitset_prune (bset, elt)
/* Return nonzero if all bits in an element are zero. */
static inline int
-lbitset_elt_zero_p (elt)
- lbitset_elt *elt;
+lbitset_elt_zero_p (lbitset_elt *elt)
{
int i;
@@ -297,9 +252,7 @@ lbitset_elt_zero_p (elt)
/* Link the bitset element into the current bitset linked list. */
static inline void
-lbitset_elt_link (bset, elt)
- bitset bset;
- lbitset_elt *elt;
+lbitset_elt_link (bitset bset, lbitset_elt *elt)
{
bitset_windex windex = elt->index;
lbitset_elt *ptr;
@@ -361,10 +314,8 @@ lbitset_elt_link (bset, elt)
static lbitset_elt *
-lbitset_elt_find (bset, windex, mode)
- bitset bset;
- bitset_windex windex;
- enum_lbitset_find_mode mode;
+lbitset_elt_find (bitset bset, bitset_windex windex,
+ enum lbitset_find_mode mode)
{
lbitset_elt *elt;
lbitset_elt *current;
@@ -432,8 +383,7 @@ lbitset_elt_find (bset, windex, mode)
/* Weed out the zero elements from the list. */
static inline void
-lbitset_weed (bset)
- bitset bset;
+lbitset_weed (bitset bset)
{
lbitset_elt *elt;
lbitset_elt *next;
@@ -449,8 +399,7 @@ lbitset_weed (bset)
/* Set all bits in the bitset to zero. */
static void
-lbitset_zero (bset)
- bitset bset;
+lbitset_zero (bitset bset)
{
lbitset_elt *head;
@@ -465,9 +414,7 @@ lbitset_zero (bset)
/* Return 1 if DST == SRC. */
static inline int
-lbitset_equal_p (dst, src)
- bitset dst;
- bitset src;
+lbitset_equal_p (bitset dst, bitset src)
{
lbitset_elt *selt;
lbitset_elt *delt;
@@ -494,9 +441,7 @@ lbitset_equal_p (dst, src)
/* Copy bits from bitset SRC to bitset DST. */
static inline void
-lbitset_copy (dst, src)
- bitset dst;
- bitset src;
+lbitset_copy (bitset dst, bitset src)
{
lbitset_elt *elt;
lbitset_elt *head;
@@ -538,9 +483,7 @@ lbitset_copy (dst, src)
/* Copy bits from bitset SRC to bitset DST. Return non-zero if
bitsets different. */
static inline int
-lbitset_copy_cmp (dst, src)
- bitset dst;
- bitset src;
+lbitset_copy_cmp (bitset dst, bitset src)
{
if (src == dst)
return 0;
@@ -561,8 +504,7 @@ lbitset_copy_cmp (dst, src)
/* Return size in bits of bitset SRC. */
static bitset_bindex
-lbitset_size (src)
- bitset src;
+lbitset_size (bitset src)
{
lbitset_elt *elt;
@@ -577,9 +519,7 @@ lbitset_size (src)
/* Set bit BITNO in bitset DST. */
static void
-lbitset_set (dst, bitno)
- bitset dst;
- bitset_bindex bitno;
+lbitset_set (bitset dst, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
@@ -592,9 +532,7 @@ lbitset_set (dst, bitno)
/* Reset bit BITNO in bitset DST. */
static void
-lbitset_reset (dst, bitno)
- bitset dst;
- bitset_bindex bitno;
+lbitset_reset (bitset dst, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
@@ -610,9 +548,7 @@ lbitset_reset (dst, bitno)
/* Test bit BITNO in bitset SRC. */
static int
-lbitset_test (src, bitno)
- bitset src;
- bitset_bindex bitno;
+lbitset_test (bitset src, bitset_bindex bitno)
{
bitset_windex windex = bitno / BITSET_WORD_BITS;
@@ -625,8 +561,7 @@ lbitset_test (src, bitno)
static void
-lbitset_free (bset)
- bitset bset;
+lbitset_free (bitset bset)
{
lbitset_zero (bset);
}
@@ -636,11 +571,8 @@ lbitset_free (bset)
*NEXT and store in array LIST. Return with actual number of bits
found and with *NEXT indicating where search stopped. */
static bitset_bindex
-lbitset_list_reverse (bset, list, num, next)
- bitset bset;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+lbitset_list_reverse (bitset bset, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex rbitno;
bitset_bindex bitno;
@@ -734,11 +666,8 @@ lbitset_list_reverse (bset, list, num, n
*NEXT and store in array LIST. Return with actual number of bits
found and with *NEXT indicating where search stopped. */
static bitset_bindex
-lbitset_list (bset, list, num, next)
- bitset bset;
- bitset_bindex *list;
- bitset_bindex num;
- bitset_bindex *next;
+lbitset_list (bitset bset, bitset_bindex *list,
+ bitset_bindex num, bitset_bindex *next)
{
bitset_bindex bitno;
bitset_windex windex;
@@ -937,8 +866,7 @@ lbitset_list (bset, list, num, next)
static int
-lbitset_empty_p (dst)
- bitset dst;
+lbitset_empty_p (bitset dst)
{
lbitset_weed (dst);
if (LBITSET_HEAD (dst))
@@ -948,8 +876,7 @@ lbitset_empty_p (dst)
static void
-lbitset_ones (dst)
- bitset dst;
+lbitset_ones (bitset dst)
{
bitset_windex i;
bitset_windex windex;
@@ -975,9 +902,7 @@ lbitset_ones (dst)
static void
-lbitset_not (dst, src)
- bitset dst;
- bitset src;
+lbitset_not (bitset dst, bitset src)
{
lbitset_elt *elt;
lbitset_elt *selt;
@@ -1011,9 +936,7 @@ lbitset_not (dst, src)
/* Return 1 if DST == DST | SRC. */
static int
-lbitset_subset_p (dst, src)
- bitset dst;
- bitset src;
+lbitset_subset_p (bitset dst, bitset src)
{
lbitset_elt *selt;
lbitset_elt *delt;
@@ -1050,9 +973,7 @@ lbitset_subset_p (dst, src)
/* Return 1 if DST & SRC == 0. */
static int
-lbitset_disjoint_p (dst, src)
- bitset dst;
- bitset src;
+lbitset_disjoint_p (bitset dst, bitset src)
{
lbitset_elt *selt;
lbitset_elt *delt;
@@ -1087,11 +1008,7 @@ lbitset_disjoint_p (dst, src)
static int
-lbitset_op3_cmp (dst, src1, src2, op)
- bitset dst;
- bitset src1;
- bitset src2;
- enum_bitset_ops op;
+lbitset_op3_cmp (bitset dst, bitset src1, bitset src2, enum bitset_ops op)
{
lbitset_elt *selt1 = LBITSET_HEAD (src1);
lbitset_elt *selt2 = LBITSET_HEAD (src2);
@@ -1248,21 +1165,8 @@ lbitset_op3_cmp (dst, src1, src2, op)
}
-static void
-lbitset_and (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
-{
- lbitset_and_cmp (dst, src1, src2);
-}
-
-
static int
-lbitset_and_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+lbitset_and_cmp (bitset dst, bitset src1, bitset src2)
{
lbitset_elt *selt1 = LBITSET_HEAD (src1);
lbitset_elt *selt2 = LBITSET_HEAD (src2);
@@ -1287,20 +1191,14 @@ lbitset_and_cmp (dst, src1, src2)
static void
-lbitset_andn (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+lbitset_and (bitset dst, bitset src1, bitset src2)
{
- lbitset_andn_cmp (dst, src1, src2);
+ lbitset_and_cmp (dst, src1, src2);
}
static int
-lbitset_andn_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+lbitset_andn_cmp (bitset dst, bitset src1, bitset src2)
{
lbitset_elt *selt1 = LBITSET_HEAD (src1);
lbitset_elt *selt2 = LBITSET_HEAD (src2);
@@ -1322,20 +1220,14 @@ lbitset_andn_cmp (dst, src1, src2)
static void
-lbitset_or (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+lbitset_andn (bitset dst, bitset src1, bitset src2)
{
- lbitset_or_cmp (dst, src1, src2);
+ lbitset_andn_cmp (dst, src1, src2);
}
static int
-lbitset_or_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+lbitset_or_cmp (bitset dst, bitset src1, bitset src2)
{
lbitset_elt *selt1 = LBITSET_HEAD (src1);
lbitset_elt *selt2 = LBITSET_HEAD (src2);
@@ -1353,20 +1245,14 @@ lbitset_or_cmp (dst, src1, src2)
static void
-lbitset_xor (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+lbitset_or (bitset dst, bitset src1, bitset src2)
{
- lbitset_xor_cmp (dst, src1, src2);
+ lbitset_or_cmp (dst, src1, src2);
}
static int
-lbitset_xor_cmp (dst, src1, src2)
- bitset dst;
- bitset src1;
- bitset src2;
+lbitset_xor_cmp (bitset dst, bitset src1, bitset src2)
{
lbitset_elt *selt1 = LBITSET_HEAD (src1);
lbitset_elt *selt2 = LBITSET_HEAD (src2);
@@ -1383,6 +1269,13 @@ lbitset_xor_cmp (dst, src1, src2)
}
+static void
+lbitset_xor (bitset dst, bitset src1, bitset src2)
+{
+ lbitset_xor_cmp (dst, src1, src2);
+}
+
+
/* Vector of operations for linked-list bitsets. */
struct bitset_vtable lbitset_vtable = {
@@ -1423,8 +1316,7 @@ struct bitset_vtable lbitset_vtable = {
/* Return size of initial structure. */
size_t
-lbitset_bytes (n_bits)
- bitset_bindex n_bits ATTRIBUTE_UNUSED;
+lbitset_bytes (bitset_bindex n_bits ATTRIBUTE_UNUSED)
{
return sizeof (struct lbitset_struct);
}
@@ -1432,9 +1324,7 @@ lbitset_bytes (n_bits)
/* Initialize a bitset. */
bitset
-lbitset_init (bset, n_bits)
- bitset bset;
- bitset_bindex n_bits ATTRIBUTE_UNUSED;
+lbitset_init (bitset bset, bitset_bindex n_bits ATTRIBUTE_UNUSED)
{
bset->b.vtable = &lbitset_vtable;
return bset;
@@ -1442,7 +1332,7 @@ lbitset_init (bset, n_bits)
void
-lbitset_release_memory ()
+lbitset_release_memory (void)
{
lbitset_free_list = 0;
if (lbitset_obstack_init)
@@ -1455,8 +1345,7 @@ lbitset_release_memory ()
/* Function to be called from debugger to debug lbitset. */
void
-debug_lbitset (bset)
- bitset bset;
+debug_lbitset (bitset bset)
{
lbitset_elt *elt;
unsigned int i;