lib: rbtree: Make boolean functions return bool
MISRA-C rule 14.4 Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
parent
b87d48c814
commit
ad90341288
1 changed files with 3 additions and 2 deletions
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
#include <misc/rb.h>
|
#include <misc/rb.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
enum rb_color { RED = 0, BLACK = 1 };
|
enum rb_color { RED = 0, BLACK = 1 };
|
||||||
|
|
||||||
|
@ -49,12 +50,12 @@ static enum rb_color get_color(struct rbnode *n)
|
||||||
return ((uintptr_t)n->children[0]) & 1ul;
|
return ((uintptr_t)n->children[0]) & 1ul;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_black(struct rbnode *n)
|
static bool is_black(struct rbnode *n)
|
||||||
{
|
{
|
||||||
return get_color(n) == BLACK;
|
return get_color(n) == BLACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_red(struct rbnode *n)
|
static bool is_red(struct rbnode *n)
|
||||||
{
|
{
|
||||||
return get_color(n) == RED;
|
return get_color(n) == RED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue