--- lib/rbtr.c 2006/04/05 20:30:03 1.5 +++ lib/rbtr.c 2007/11/02 10:27:06 @@ -393,8 +393,8 @@ int int_compare(void *a, void *b) { - if ((int)a < (int)b) return -1; - else if ((int)a > (int)b) return 1; + if (*((int *)a) < *((int *)b)) return -1; + else if ((*(int *)a) > (*(int *)b)) return 1; else return 0; } --- hobbitd/hobbitd.c 2007/09/11 21:20:54 1.274 +++ hobbitd/hobbitd.c 2007/11/08 07:10:58 @@ -986,7 +986,7 @@ dbgprintf("-> find_cookie\n"); - cookiehandle = rbtFind(rbcookies, (void *)cookie); + cookiehandle = rbtFind(rbcookies, &cookie); if (cookiehandle != rbtEnd(rbcookies)) { result = gettreeitem(rbcookies, cookiehandle); if (result->cookieexpires <= getcurrenttime(NULL)) result = NULL; @@ -1003,7 +1003,7 @@ if (log->cookie <= 0) return; - cookiehandle = rbtFind(rbcookies, (void *)log->cookie); + cookiehandle = rbtFind(rbcookies, &log->cookie); log->cookie = -1; log->cookieexpires = 0; if (cookiehandle == rbtEnd(rbcookies)) return; @@ -1250,7 +1250,7 @@ } while (find_cookie(newcookie)); log->cookie = newcookie; - rbtInsert(rbcookies, (void *)newcookie, log); + rbtInsert(rbcookies, &log->cookie, log); /* * This is fundamentally flawed. The cookie should be generated by @@ -3890,7 +3890,7 @@ else ltail->ackmsg = NULL; ltail->cookie = cookie; - if (cookie > 0) rbtInsert(rbcookies, (void *)cookie, ltail); + if (cookie > 0) rbtInsert(rbcookies, <ail->cookie, ltail); ltail->cookieexpires = cookieexpires; ltail->metas = NULL; ltail->acklist = NULL;