diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-04 15:44:50 -0500 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2016-03-04 15:44:50 -0500 |
commit | 8a87b3f1ffe54df5b53cca9ae2d02250031c0afe (patch) | |
tree | 91bc070069abdea23cd00163a396ac50f060dc93 /lisc | |
parent | 9b31b1eba23cd20290197a4b34d604d50ec3a4a9 (diff) | |
download | roux-8a87b3f1ffe54df5b53cca9ae2d02250031c0afe.tar.gz |
make bshas() inline
Diffstat (limited to 'lisc')
-rw-r--r-- | lisc/lisc.h | 8 | ||||
-rw-r--r-- | lisc/util.c | 7 |
2 files changed, 7 insertions, 8 deletions
diff --git a/lisc/lisc.h b/lisc/lisc.h index 813f9b2..12ea1ea 100644 --- a/lisc/lisc.h +++ b/lisc/lisc.h @@ -482,7 +482,6 @@ void dumpts(BSet *, Tmp *, FILE *); void bsinit(BSet *, uint); void bszero(BSet *); uint bscount(BSet *); -int bshas(BSet *, uint); void bsset(BSet *, uint); void bsclr(BSet *, uint); void bscopy(BSet *, BSet *); @@ -492,6 +491,13 @@ void bsdiff(BSet *, BSet *); int bsequal(BSet *, BSet *); int bsiter(BSet *, uint *); +static inline int +bshas(BSet *bs, uint elt) +{ + assert(elt < bs->nt * NBit); + return (bs->t[elt/NBit] & BIT(elt%NBit)) != 0; +} + /* parse.c */ extern OpDesc opdesc[NOp]; void parse(FILE *, char *, void (Dat *), void (Fn *)); diff --git a/lisc/util.c b/lisc/util.c index cccbcf6..fc9884a 100644 --- a/lisc/util.c +++ b/lisc/util.c @@ -245,13 +245,6 @@ bsmax(BSet *bs) return bs->nt * NBit; } -int -bshas(BSet *bs, uint elt) -{ - assert(elt < bsmax(bs)); - return (bs->t[elt/NBit] & BIT(elt%NBit)) != 0; -} - void bsset(BSet *bs, uint elt) { |