X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/e141f4d4bb6584bfbf13003047a2e48e9a6eab6a..222342aa6708814c01a63ff7d568209d3705ff47:/lib/bbitset.h?ds=sidebyside diff --git a/lib/bbitset.h b/lib/bbitset.h index c24d1163..c4a74cf3 100644 --- a/lib/bbitset.h +++ b/lib/bbitset.h @@ -1,6 +1,8 @@ /* Base bitset stuff. - Copyright (C) 2002-2004, 2006, 2009-2010 Free Software Foundation, + + Copyright (C) 2002-2004, 2006, 2009-2012 Free Software Foundation, Inc. + Contributed by Michael Hayes (m.hayes@elec.canterbury.ac.nz). This program is free software: you can redistribute it and/or modify @@ -30,9 +32,9 @@ Memory for bit array and bitset structure allocated contiguously. BITSET_LIST: Linked list of arrays of bits (variable size, least storage - for large very sparse sets). + for large very sparse sets). BITSET_TABLE: Expandable table of pointers to arrays of bits - (variable size, less storage for large sparse sets). + (variable size, less storage for large sparse sets). Faster than BITSET_LIST for random access. BITSET_VARRAY: Variable array of bits (variable size, fast for dense bitsets). @@ -40,7 +42,7 @@ statistics and/or better run-time checking. */ enum bitset_type {BITSET_ARRAY, BITSET_LIST, BITSET_TABLE, BITSET_VARRAY, - BITSET_TYPE_NUM, BITSET_STATS}; + BITSET_TYPE_NUM, BITSET_STATS}; #define BITSET_TYPE_NAMES {"abitset", "lbitset", "ebitset", "vbitset"} extern const char * const bitset_type_names[]; @@ -76,19 +78,19 @@ typedef size_t bitset_windex; #define BITSET_LIST_SIZE 1024 enum bitset_ops {BITSET_OP_ZERO, BITSET_OP_ONES, - BITSET_OP_COPY, BITSET_OP_NOT, - BITSET_OP_EMPTY_P, BITSET_OP_EQUAL_P, - BITSET_OP_SUBSET_P, BITSET_OP_DISJOINT_P, - BITSET_OP_AND, BITSET_OP_OR, BITSET_OP_XOR, BITSET_OP_ANDN, - BITSET_OP_OR_AND, BITSET_OP_AND_OR, BITSET_OP_ANDN_OR}; + BITSET_OP_COPY, BITSET_OP_NOT, + BITSET_OP_EMPTY_P, BITSET_OP_EQUAL_P, + BITSET_OP_SUBSET_P, BITSET_OP_DISJOINT_P, + BITSET_OP_AND, BITSET_OP_OR, BITSET_OP_XOR, BITSET_OP_ANDN, + BITSET_OP_OR_AND, BITSET_OP_AND_OR, BITSET_OP_ANDN_OR}; struct bbitset_struct { const struct bitset_vtable *vtable; - bitset_windex cindex; /* Cache word index. */ - bitset_windex csize; /* Cache size in words. */ - bitset_word *cdata; /* Cache data pointer. */ - bitset_bindex n_bits; /* Number of bits. */ + bitset_windex cindex; /* Cache word index. */ + bitset_windex csize; /* Cache size in words. */ + bitset_word *cdata; /* Cache data pointer. */ + bitset_bindex n_bits; /* Number of bits. */ /* Perhaps we could sacrifice another word to indicate that the bitset is known to be zero, that a bit has been set in the cache, and that a bit has been cleared in the cache. @@ -146,9 +148,9 @@ struct bitset_vtable bool (*or_and_cmp) (bitset, bitset, bitset, bitset); bitset_bindex (*list) (bitset, bitset_bindex *, bitset_bindex, - bitset_bindex *); + bitset_bindex *); bitset_bindex (*list_reverse) (bitset, bitset_bindex *, bitset_bindex, - bitset_bindex *); + bitset_bindex *); void (*free) (bitset); enum bitset_type type; };