From fd144ef57517b9cff624d5c8ca11d2bc3f461ed2 Mon Sep 17 00:00:00 2001 From: Ales Kozumplik Date: Tue, 27 Mar 2012 14:06:42 +0200 Subject: bitmap: implement map_and_not. --- src/bitmap.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/bitmap.c') diff --git a/src/bitmap.c b/src/bitmap.c index 94a88ca..5a8dcd8 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -71,4 +71,16 @@ map_and(Map *t, Map *s) *ti++ &= *si++; } +/* like map_and but negates value in s first, i.e. t & ~s */ +void +map_and_not(Map *t, Map *s) +{ + unsigned char *ti, *si, *end; + ti = t->map; + si = s->map; + end = ti + t->size; + while (ti < end) + *ti++ &= ~*si++; +} + /* EOF */ -- cgit v1.2.3