From: Michael Schroeder Date: Thu, 18 Jan 2018 12:20:24 +0000 (+0100) Subject: Add map_clr_at and MAPCLR_AT X-Git-Tag: 0.6.31~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eebcc9a322a94556c0d7e804fc1025d26e8fc5c5;p=thirdparty%2Flibsolv.git Add map_clr_at and MAPCLR_AT Clear some bits around the specified bit. --- diff --git a/src/bitmap.h b/src/bitmap.h index c20b48f1..0050a6a4 100644 --- a/src/bitmap.h +++ b/src/bitmap.h @@ -33,6 +33,8 @@ typedef struct _Map { #define MAPCLR(m, n) ((m)->map[(n) >> 3] &= ~(1 << ((n) & 7))) /* test bit */ #define MAPTST(m, n) ((m)->map[(n) >> 3] & (1 << ((n) & 7))) +/* clear some bits at a position */ +#define MAPCLR_AT(m, n) ((m)->map[(n) >> 3] = 0) extern void map_init(Map *m, int n); extern void map_init_clone(Map *t, Map *s); @@ -63,6 +65,10 @@ static inline int map_tst(Map *m, int n) { return MAPTST(m, n); } +static inline void map_clr_at(Map *m, int n) +{ + MAPCLR_AT(m, n); +} #ifdef __cplusplus }