From d2fab28d0105fed5f4665ae3a8793fe990566945 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 30 Oct 2012 19:58:19 +0900 Subject: [PATCH] Implement set_is_member. Oops, forgot that one. --- tools/qfcc/source/set.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/qfcc/source/set.c b/tools/qfcc/source/set.c index a3e2bc828..2a68422a6 100644 --- a/tools/qfcc/source/set.c +++ b/tools/qfcc/source/set.c @@ -235,3 +235,11 @@ set_is_subset (const set_t *set, const set_t *sub) return 0; return 1; } + +int +set_is_member (const set_t *set, unsigned x) +{ + if (x >= set->size) + return 0; + return (set->map[x / BITS] & (1 << (x % BITS))) != 0; +}