Update plibc header
[oweals/gnunet.git] / src / util / container_multihashmap32.c
index da727d710d6e128ae80610c532f2bd8cfb71dae7..afb0e3653a27ca50ad317f0476ffdb5b988caa40 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -26,9 +26,7 @@
  */
 
 #include "platform.h"
-#include "gnunet_common.h"
-#include "gnunet_container_lib.h"
-#include "gnunet_crypto_lib.h"
+#include "gnunet_util_lib.h"
 
 #define LOG(kind,...) GNUNET_log_from (kind, "util", __VA_ARGS__)
 
@@ -90,7 +88,7 @@ GNUNET_CONTAINER_multihashmap32_create (unsigned int len)
   struct GNUNET_CONTAINER_MultiHashMap32 *ret;
 
   GNUNET_assert (len > 0);
-  ret = GNUNET_malloc (sizeof (struct GNUNET_CONTAINER_MultiHashMap32));
+  ret = GNUNET_new (struct GNUNET_CONTAINER_MultiHashMap32);
   ret->map = GNUNET_malloc (len * sizeof (struct MapEntry *));
   ret->map_length = len;
   return ret;
@@ -235,7 +233,7 @@ GNUNET_CONTAINER_multihashmap32_iterate (const struct
 int
 GNUNET_CONTAINER_multihashmap32_remove (struct GNUNET_CONTAINER_MultiHashMap32
                                         *map,
-                                        uint32_t key, void *value)
+                                        uint32_t key, const void *value)
 {
   struct MapEntry *e;
   struct MapEntry *p;
@@ -352,7 +350,7 @@ GNUNET_CONTAINER_multihashmap32_contains (const struct
 int
 GNUNET_CONTAINER_multihashmap32_contains_value (const struct
                                                 GNUNET_CONTAINER_MultiHashMap32
-                                                *map, 
+                                                *map,
                                                 uint32_t key,
                                                 const void *value)
 {
@@ -448,7 +446,7 @@ GNUNET_CONTAINER_multihashmap32_put (struct GNUNET_CONTAINER_MultiHashMap32
     grow (map);
     i = idx_of (map, key);
   }
-  e = GNUNET_malloc (sizeof (struct MapEntry));
+  e = GNUNET_new (struct MapEntry);
   e->key = key;
   e->value = value;
   e->next = map->map[i];
@@ -472,7 +470,7 @@ int
 GNUNET_CONTAINER_multihashmap32_get_multiple (const struct
                                               GNUNET_CONTAINER_MultiHashMap32
                                               *map, uint32_t key,
-                                              GNUNET_CONTAINER_HashMapIterator32 
+                                              GNUNET_CONTAINER_HashMapIterator32
                                               it, void *it_cls)
 {
   int count;