fixing issue pointed out by amatus
[oweals/gnunet.git] / src / datacache / datacache.c
index 6e9b0770878d0f5f723f07c629a90d9d7c1d2933..d2aa2616a826f3ad0645dd67d4248387e1d8ab99 100644 (file)
@@ -100,7 +100,7 @@ struct GNUNET_DATACACHE_Handle
 static void 
 env_delete_notify (void *cls,
                   const GNUNET_HashCode *key,
-                  uint32_t size)
+                  size_t size)
 {
   struct GNUNET_DATACACHE_Handle * h = cls;
   GNUNET_assert (h->utilization >= size);
@@ -191,7 +191,6 @@ GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched,
       GNUNET_DATACACHE_destroy (ret);
       return NULL;
     }
-  GNUNET_assert (ret->api->get != NULL);
   return ret;
 }
 
@@ -238,14 +237,13 @@ void GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h)
 int 
 GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h,
                      const GNUNET_HashCode * key,
-                     uint32_t size,
+                     size_t size,
                      const char *data,
                      enum GNUNET_BLOCK_Type type,
                      struct GNUNET_TIME_Absolute discard_time)
 {
   uint32_t used;
 
-  GNUNET_assert (h->api->get != NULL);
   used = h->api->put (h->api->cls,
                      key,
                      size,
@@ -287,7 +285,6 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
                      GNUNET_DATACACHE_Iterator iter,
                      void *iter_cls)
 {
-  GNUNET_assert (h->api->get != NULL);
   GNUNET_STATISTICS_update (h->stats,
                            gettext_noop ("# requests received"),
                            1,
@@ -301,7 +298,6 @@ GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h,
                                GNUNET_NO);
       return 0; /* can not be present */
     } 
-  GNUNET_assert (h->api->get != NULL);
   return h->api->get (h->api->cls,
                      key,
                      type,