# HG changeset patch # User John Tsiombikas # Date 1334525459 -10800 # Node ID b45febfd29222698c5918fd9f5a1af1e06679ade # Parent 8d7233ff61d35f99ffb16a12cd4c9179c65b88c4 fixed all the conversion warnings diff -r 8d7233ff61d3 -r b45febfd2922 src/rbtree.c --- a/src/rbtree.c Mon Apr 16 00:26:38 2012 +0300 +++ b/src/rbtree.c Mon Apr 16 00:30:59 2012 +0300 @@ -1,10 +1,11 @@ #include #include +#include #include #include "rbtree.h" -#define INT2PTR(x) ((void*)(x)) -#define PTR2INT(x) ((int)(x)) +#define INT2PTR(x) ((void*)(intptr_t)(x)) +#define PTR2INT(x) ((int)(intptr_t)(x)) struct rbtree { struct rbnode *root; @@ -19,8 +20,8 @@ struct rbnode *rstack, *iter; }; -static int cmpaddr(void *ap, void *bp); -static int cmpint(void *ap, void *bp); +static int cmpaddr(const void *ap, const void *bp); +static int cmpint(const void *ap, const void *bp); static int count_nodes(struct rbnode *node); static void del_tree(struct rbnode *node, void (*delfunc)(struct rbnode*, void*), void *cls); @@ -221,12 +222,12 @@ return node ? node->data : 0; } -static int cmpaddr(void *ap, void *bp) +static int cmpaddr(const void *ap, const void *bp) { return ap < bp ? -1 : (ap > bp ? 1 : 0); } -static int cmpint(void *ap, void *bp) +static int cmpint(const void *ap, const void *bp) { return PTR2INT(ap) - PTR2INT(bp); }