summaryrefslogtreecommitdiff
path: root/module/hash.c
diff options
context:
space:
mode:
authorStef Walter <stefw@collabora.co.uk>2011-01-26 12:46:14 -0600
committerStef Walter <stefw@collabora.co.uk>2011-01-26 12:46:14 -0600
commit4375e297b19bc2177e17cc5616e75d96be053328 (patch)
treee62b542ae6bb600332912e14c480270709934760 /module/hash.c
parentf8009b4d504de0ed752b867893acd263108409e0 (diff)
Add testing and start testing hash table functionality.
Diffstat (limited to 'module/hash.c')
-rw-r--r--module/hash.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/module/hash.c b/module/hash.c
index 84d57a2..30efced 100644
--- a/module/hash.c
+++ b/module/hash.c
@@ -425,6 +425,21 @@ hash_ulongptr_equal (const void *ulong_one, const void *ulong_two)
}
unsigned int
+hash_intptr_hash (const void *to_int)
+{
+ assert (to_int);
+ return (unsigned int)*((unsigned long*)to_int);
+}
+
+int
+hash_intptr_equal (const void *int_one, const void *int_two)
+{
+ assert (int_one);
+ assert (int_two);
+ return *((unsigned long*)int_one) == *((unsigned long*)int_two);
+}
+
+unsigned int
hash_direct_hash (const void *ptr)
{
return (unsigned int)ptr;