]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Add map_clr_at and MAPCLR_AT
authorMichael Schroeder <mls@suse.de>
Thu, 18 Jan 2018 12:20:24 +0000 (13:20 +0100)
committerMichael Schroeder <mls@suse.de>
Thu, 18 Jan 2018 12:20:24 +0000 (13:20 +0100)
Clear some bits around the specified bit.

src/bitmap.h

index c20b48f16b974579f4927a0d5b541c81a7d42346..0050a6a4c20f959da0b68b474d4d2461672540e5 100644 (file)
@@ -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
 }