aboutsummaryrefslogtreecommitdiffstats
path: root/camel/hash-table-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/hash-table-utils.c')
-rw-r--r--camel/hash-table-utils.c37
1 files changed, 11 insertions, 26 deletions
diff --git a/camel/hash-table-utils.c b/camel/hash-table-utils.c
index f17f6ce5d5..195afbee2d 100644
--- a/camel/hash-table-utils.c
+++ b/camel/hash-table-utils.c
@@ -23,22 +23,11 @@
* USA
*/
-#include <ctype.h>
-#include "hash-table-utils.h"
+#include <string.h>
+#include <ctype.h>
-/*
- * free a (key/value) hash table pair.
- * to be called in a g_hash_table_foreach()
- * before g_hash_table_destroy().
- */
-void
-g_hash_table_generic_free (gpointer key, gpointer value, gpointer user_data)
-{
- g_free (key);
- g_free (value);
-}
-
+#include "hash-table-utils.h"
/***/
@@ -47,7 +36,7 @@ g_hash_table_generic_free (gpointer key, gpointer value, gpointer user_data)
gint
g_strcase_equal (gconstpointer a, gconstpointer b)
{
- return (g_strcasecmp ((gchar *)a, (gchar *)b) == 0);
+ return (strcasecmp ((char *) a, (char *) b) == 0);
}
@@ -60,19 +49,15 @@ g_strcase_hash (gconstpointer v)
{
const char *s = (char*)v;
const char *p;
- guint h=0, g;
+ guint h = 0, g;
- for(p = s; *p != '\0'; p += 1) {
- h = ( h << 4 ) + toupper(*p);
- if ( ( g = h & 0xf0000000 ) ) {
+ for (p = s; *p != '\0'; p += 1) {
+ h = (h << 4) + toupper (*p);
+ if ((g = h & 0xf0000000)) {
h = h ^ (g >> 24);
h = h ^ g;
}
- }
-
- return h /* % M */;
+ }
+
+ return h;
}
-
-
-
-/***/