From 8a87b3f1ffe54df5b53cca9ae2d02250031c0afe Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Fri, 4 Mar 2016 15:44:50 -0500 Subject: make bshas() inline --- lisc/lisc.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lisc/lisc.h') 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 *)); -- cgit 1.4.1