-remove trailing whitespace
[oweals/gnunet.git] / src / core / gnunet-service-core_typemap.c
index d3214ea67ce478ca2494eb85c82faab85d9ae4a6..c9774ddecdf288e0787893de3645c9e719d6191e 100644 (file)
@@ -114,13 +114,13 @@ GSC_TYPEMAP_get_from_message (const struct GNUNET_MessageHeader *msg)
       GNUNET_break_op (0);
       return NULL;
     }
-    ret = GNUNET_malloc (sizeof (struct GSC_TypeMap));
+    ret = GNUNET_new (struct GSC_TypeMap);
     memcpy (ret, &msg[1], sizeof (struct GSC_TypeMap));
     return ret;
   case GNUNET_MESSAGE_TYPE_CORE_COMPRESSED_TYPE_MAP:
     GNUNET_STATISTICS_update (GSC_stats, gettext_noop ("# type maps received"),
                               1, GNUNET_NO);
-    ret = GNUNET_malloc (sizeof (struct GSC_TypeMap));
+    ret = GNUNET_new (struct GSC_TypeMap);
     dlen = sizeof (struct GSC_TypeMap);
     if ((Z_OK !=
          uncompress ((Bytef *) ret, &dlen, (const Bytef *) &msg[1],
@@ -205,7 +205,7 @@ GSC_TYPEMAP_remove (const uint16_t * types, unsigned int tlen)
  * Test if any of the types from the types array is in the
  * given type map.
  *
- * @param map map to test
+ * @param tmap map to test
  * @param types array of types
  * @param tcnt number of entries in types
  * @return GNUNET_YES if a type is in the map, GNUNET_NO if not
@@ -230,7 +230,7 @@ GSC_TYPEMAP_test_match (const struct GSC_TypeMap *tmap, const uint16_t * types,
 /**
  * Add additional types to a given typemap.
  *
- * @param map map to extend (not changed)
+ * @param tmap map to extend (not changed)
  * @param types array of types to add
  * @param tcnt number of entries in types
  * @return updated type map (fresh copy)
@@ -242,7 +242,7 @@ GSC_TYPEMAP_extend (const struct GSC_TypeMap *tmap, const uint16_t * types,
   struct GSC_TypeMap *ret;
   unsigned int i;
 
-  ret = GNUNET_malloc (sizeof (struct GSC_TypeMap));
+  ret = GNUNET_new (struct GSC_TypeMap);
   if (NULL != tmap)
     memcpy (ret, tmap, sizeof (struct GSC_TypeMap));
   for (i = 0; i < tcnt; i++)
@@ -254,19 +254,19 @@ GSC_TYPEMAP_extend (const struct GSC_TypeMap *tmap, const uint16_t * types,
 /**
  * Create an empty type map.
  *
- * @param map a type map
+ * @return an empty type map
  */
 struct GSC_TypeMap *
 GSC_TYPEMAP_create ()
 {
-  return GNUNET_malloc (sizeof (struct GSC_TypeMap));
+  return GNUNET_new (struct GSC_TypeMap);
 }
 
 
 /**
  * Free the given type map.
  *
- * @param map a type map
+ * @param tmap a type map
  */
 void
 GSC_TYPEMAP_destroy (struct GSC_TypeMap *tmap)