mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-28 13:43:02 +00:00
(bitset_set, bitset_reset, bitset_test): Use function prototypes; this
removes the need for declaring static functions simply to provide their prototypes.
This commit is contained in:
26
lib/bitset.h
26
lib/bitset.h
@@ -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_choose PARAMS ((bitset_bindex,
|
||||
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 PARAMS ((bitset));
|
||||
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, bitno)
|
||||
|
||||
|
||||
/* 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, bitno)
|
||||
|
||||
|
||||
/* 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;
|
||||
|
||||
Reference in New Issue
Block a user