small fixes in debug and rbtree.
This commit is contained in:
parent
d0d344a78c
commit
304049064e
2 changed files with 5 additions and 5 deletions
|
|
@ -39,6 +39,6 @@
|
||||||
#else
|
#else
|
||||||
#define dassert(expr)
|
#define dassert(expr)
|
||||||
#define dprint(...)
|
#define dprint(...)
|
||||||
#endif
|
#endif /* __DEBUG__ */
|
||||||
|
|
||||||
#endif /* __COMMON_DEBUG_H */
|
#endif /* __COMMON_DEBUG_H */
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* common/rbtree.c - red black tree implementation
|
/* common/rbtree.c - red black tree implementation
|
||||||
*
|
*
|
||||||
* Copyright (C) 2010 Hernrik Hautakoski <henrik.hautakoski@gmail.com>
|
* Copyright (C) 2010 Henrik Hautakoski <henrik.hautakoski@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "rbtree.h"
|
#include "rbtree.h"
|
||||||
|
|
||||||
#define is_red(n) (n != NULL && n->color == RB_RED)
|
#define is_red(n) ((n) != NULL && (n)->color == RB_RED)
|
||||||
#define swap(n,d,q) n->child[n->child[d] == q]
|
#define swap(n,d,q) ((n)->child[(n)->child[d] == (q)])
|
||||||
|
|
||||||
static rbnode* node_alloc(uint key, void *ptr) {
|
static rbnode* node_alloc(uint key, void *ptr) {
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@ void rbtree_free(rbtree *tree, void (*action)(rbnode *)) {
|
||||||
* be heap allocated, and the client expects us to keep track of it.
|
* be heap allocated, and the client expects us to keep track of it.
|
||||||
*
|
*
|
||||||
* for general purposes, we should notify client about it so
|
* for general purposes, we should notify client about it so
|
||||||
* then they can chose what to do
|
* then they can choose what to do
|
||||||
*
|
*
|
||||||
* the function now returns -1 in that situation // H Hautakoski
|
* the function now returns -1 in that situation // H Hautakoski
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Reference in a new issue