gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: Remove unnecessary (and per


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: Remove unnecessary (and perilous) function pointer cast.
Date: Wed, 24 Oct 2018 12:54:12 +0200

This is an automated email from the git hooks/post-receive script.

marcello-stanisci pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new bebdf68c0 Remove unnecessary (and perilous) function pointer cast.
bebdf68c0 is described below

commit bebdf68c0680860c619cb95c16d014f27c55de14
Author: Marcello Stanisci <address@hidden>
AuthorDate: Wed Oct 24 12:52:58 2018 +0200

    Remove unnecessary (and perilous) function pointer cast.
---
 src/curl/curl_reschedule.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src/curl/curl_reschedule.c b/src/curl/curl_reschedule.c
index 0b5b85687..cc3c1db95 100644
--- a/src/curl/curl_reschedule.c
+++ b/src/curl/curl_reschedule.c
@@ -77,6 +77,18 @@ GNUNET_CURL_gnunet_rc_create_with_parser (struct 
GNUNET_CURL_Context *ctx,
   return rctx;
 }
 
+
+/**
+ * Just a wrapper to avoid casting of function pointers.
+ *
+ * @param response the (JSON) response to clean.
+ */
+static void
+clean_result (void *response)
+{
+  json_decref (response);
+}
+
 /**
  * Initialize reschedule context.
  *
@@ -90,8 +102,8 @@ GNUNET_CURL_gnunet_rc_create (struct GNUNET_CURL_Context 
*ctx)
 
   rc = GNUNET_new (struct GNUNET_CURL_RescheduleContext);
   rc->ctx = ctx;
-  rc->parser = (GNUNET_CURL_RawParser) &download_get_result;
-  rc->cleaner = (GNUNET_CURL_ResponseCleaner) &json_decref;
+  rc->parser = &download_get_result;
+  rc->cleaner = &clean_result;
   return rc;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]