summaryrefslogtreecommitdiff
path: root/src/rdxtree.c
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2018-02-23 09:53:00 +0100
committerRichard Braun <rbraun@sceen.net>2018-02-23 09:56:13 +0100
commitfec9bb4f8f17f3e45a5a869701c65f2f7f0fa299 (patch)
treeb17efde7e14c244680915516cf4c994950d44347 /src/rdxtree.c
parent5df0aba1129b292f41f83ac679fd46a52bc9af3e (diff)
rdxtree: use bool instead of int wwhere applicable
Diffstat (limited to 'src/rdxtree.c')
-rw-r--r--src/rdxtree.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rdxtree.c b/src/rdxtree.c
index d5fc7ee..38ee7cb 100644
--- a/src/rdxtree.c
+++ b/src/rdxtree.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 Richard Braun.
+ * Copyright (c) 2011-2018 Richard Braun.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -120,7 +120,7 @@ rdxtree_entry_addr(void *entry)
return (void *)((uintptr_t)entry & RDXTREE_ENTRY_ADDR_MASK);
}
-static inline int
+static inline bool
rdxtree_entry_is_node(const void *entry)
{
return ((uintptr_t)entry & 1) != 0;
@@ -191,13 +191,13 @@ rdxtree_node_unlink(struct rdxtree_node *node)
node->parent = NULL;
}
-static inline int
+static inline bool
rdxtree_node_full(struct rdxtree_node *node)
{
return (node->nr_entries == ARRAY_SIZE(node->entries));
}
-static inline int
+static inline bool
rdxtree_node_empty(struct rdxtree_node *node)
{
return (node->nr_entries == 0);
@@ -265,13 +265,13 @@ rdxtree_node_bm_clear(struct rdxtree_node *node, unsigned short index)
node->alloc_bm &= ~((rdxtree_bm_t)1 << index);
}
-static inline int
+static inline bool
rdxtree_node_bm_is_set(struct rdxtree_node *node, unsigned short index)
{
return (node->alloc_bm & ((rdxtree_bm_t)1 << index));
}
-static inline int
+static inline bool
rdxtree_node_bm_empty(struct rdxtree_node *node)
{
return (node->alloc_bm == RDXTREE_BM_EMPTY);
@@ -660,7 +660,7 @@ rdxtree_remove(struct rdxtree *tree, rdxtree_key_t key)
void *
rdxtree_lookup_common(const struct rdxtree *tree, rdxtree_key_t key,
- int get_slot)
+ bool get_slot)
{
struct rdxtree_node *node, *prev;
unsigned short height, shift, index;