summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/bitset.h2
-rw-r--r--src/util/list.h22
2 files changed, 23 insertions, 1 deletions
diff --git a/src/util/bitset.h b/src/util/bitset.h
index c452819414f..2404ce7f630 100644
--- a/src/util/bitset.h
+++ b/src/util/bitset.h
@@ -98,7 +98,7 @@ __bitset_ffs(const BITSET_WORD *x, int n)
static inline unsigned
__bitset_next_set(unsigned i, BITSET_WORD *tmp,
- BITSET_WORD *set, unsigned size)
+ const BITSET_WORD *set, unsigned size)
{
unsigned bit, word;
diff --git a/src/util/list.h b/src/util/list.h
index 066f9b8dfe5..f0dec5da608 100644
--- a/src/util/list.h
+++ b/src/util/list.h
@@ -116,6 +116,28 @@ static inline unsigned list_length(struct list_head *list)
return length;
}
+static inline void list_splice(struct list_head *src, struct list_head *dst)
+{
+ if (list_empty(src))
+ return;
+
+ src->next->prev = dst;
+ src->prev->next = dst->next;
+ dst->next->prev = src->prev;
+ dst->next = src->next;
+}
+
+static inline void list_splicetail(struct list_head *src, struct list_head *dst)
+{
+ if (list_empty(src))
+ return;
+
+ src->prev->next = dst;
+ src->next->prev = dst->prev;
+ dst->prev->next = src->next;
+ dst->prev = src->prev;
+}
+
static inline void list_validate(struct list_head *list)
{
struct list_head *node;