Rework RBTree to use RBNode in the compare function

This commit is contained in:
Nils O. Selåsdal
2013-06-10 23:00:24 +02:00
parent eba7590e6c
commit 150edaeada
3 changed files with 12 additions and 9 deletions
+4 -3
View File
@@ -1,12 +1,13 @@
#include <assert.h>
#include "ucore/timers.h"
#include "ucore/clock.h"
#include "ucore/utils.h"
static int timers_cmp(const void *a_, const void *b_)
static int timers_cmp(const RBNode *a_, const RBNode *b_)
{
const struct UCTimer *a = a_;
const struct UCTimer *b = b_;
const struct UCTimer *a = CONST_CONTAINER_OF(a_, struct UCTimer, rb_node);
const struct UCTimer *b = CONST_CONTAINER_OF(b_, struct UCTimer, rb_node);
if (timercmp(&a->timeout, &b->timeout, <)) {
return -1;