From eb5aa9d9d499b4a547a0a365853e254ad607ef5a Mon Sep 17 00:00:00 2001 From: Thomas Porzelt Date: Thu, 2 Oct 2008 02:37:36 +0200 Subject: [PATCH] fix and comment ip hashing functions --- src/utils.c | 2 +- src/utils.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 8623d8b..a8e4e95 100644 --- a/src/utils.c +++ b/src/utils.c @@ -277,7 +277,7 @@ void string_destroy_notify(gpointer str) { guint hash_ipv4(gconstpointer key) { - return GPOINTER_TO_UINT(key); + return *((guint*)key); } guint hash_ipv6(gconstpointer key) { diff --git a/src/utils.h b/src/utils.h index 74466ab..2c71dbb 100644 --- a/src/utils.h +++ b/src/utils.h @@ -26,7 +26,9 @@ LI_API gchar *ev_backend_string(guint backend); LI_API void string_destroy_notify(gpointer str); +/* expects a pointer to a 32bit value */ LI_API guint hash_ipv4(gconstpointer key); +/* expects a pointer to a 128bit value */ LI_API guint hash_ipv6(gconstpointer key); #endif