From b1c72a850aea2d3ffc16bf8732d75c428c02d093 Mon Sep 17 00:00:00 2001 From: Andrew McDermott Date: Thu, 24 Dec 2009 15:30:50 +0000 Subject: [PATCH] conditionally include intptr_t --- hashtbl.c | 7 +++---- hashtbl_test.c | 3 --- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/hashtbl.c b/hashtbl.c index 4fb21d7..ac78709 100644 --- a/hashtbl.c +++ b/hashtbl.c @@ -43,7 +43,7 @@ #include #include /* size_t, offsetof, NULL */ #include /* strcmp */ -#if 0 +#if defined(linux) #include /* intptr_t */ #endif #include @@ -514,7 +514,7 @@ int hashtbl_string_equals(const void *a, const void *b) unsigned int hashtbl_int_hash(const void *k) { - return hash_helper(*(const unsigned int *)k); + return hash_helper(*(unsigned int *)k); } int hashtbl_int_equals(const void *a, const void *b) @@ -539,9 +539,8 @@ int hashtbl_load_factor(const struct hashtbl *h) void hashtbl_iter_init(struct hashtbl *h, struct hashtbl_iter *iter) { - struct dllist *node = h->all_entries.next; - iter->private = node; iter->key = iter->val = NULL; + iter->private = h->all_entries.next; } int hashtbl_iter_next(struct hashtbl *h, struct hashtbl_iter *iter) diff --git a/hashtbl_test.c b/hashtbl_test.c index ddcbdf9..e38266c 100644 --- a/hashtbl_test.c +++ b/hashtbl_test.c @@ -28,9 +28,6 @@ /* hashtbl_test.c - unit tests for hashtbl */ #include -#if 0 -#include -#endif #include #include #include "CUnitTest.h"