From 1f3219c222bb206e02a793e6c7d48ccc3045d604 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 5 Jul 2016 12:41:49 +0000 Subject: [PATCH] indentation, moving API towards MQ-style --- src/dv/dv_api.c | 9 +++----- src/dv/gnunet-service-dv.c | 5 +++-- src/dv/plugin_transport_dv.c | 6 ++---- src/include/gnunet_dv_service.h | 37 ++++++++++++++++++--------------- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c index e3ba995c3..d74453376 100644 --- a/src/dv/dv_api.c +++ b/src/dv/dv_api.c @@ -308,7 +308,7 @@ cleanup_send_cb (void *cls, while (NULL != (th = peer->head)) { GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, th); - th->cb (th->cb_cls, GNUNET_SYSERR); + th->cb (th->cb_cls); GNUNET_free (th); } GNUNET_free (peer); @@ -416,7 +416,7 @@ handle_message_receipt (void *cls, GNUNET_CONTAINER_DLL_remove (sh->th_head, sh->th_tail, th); - th->cb (th->cb_cls, GNUNET_SYSERR); + th->cb (th->cb_cls); GNUNET_free (th); } } @@ -473,10 +473,7 @@ handle_message_receipt (void *cls, GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, th); - th->cb (th->cb_cls, - (ntohs (ack->header.type) == GNUNET_MESSAGE_TYPE_DV_SEND_ACK) - ? GNUNET_OK - : GNUNET_SYSERR); + th->cb (th->cb_cls); GNUNET_free (th); break; } diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index fd51a8562..af6ddb3d9 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c @@ -230,7 +230,7 @@ struct DirectNeighbor * ID of the task we use to (periodically) update our consensus * with this peer. Used if we are the initiating peer. */ - struct GNUNET_SCHEDULER_Task * initiate_task; + struct GNUNET_SCHEDULER_Task *initiate_task; /** * At what offset are we, with respect to inserting our own routes @@ -1905,7 +1905,8 @@ handle_dv_route_message (void *cls, * @param message the actual message */ static void -handle_dv_send_message (void *cls, struct GNUNET_SERVER_Client *client, +handle_dv_send_message (void *cls, + struct GNUNET_SERVER_Client *client, const struct GNUNET_MessageHeader *message) { struct Route *route; diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c index aa94bed31..7293d9fb8 100644 --- a/src/dv/plugin_transport_dv.c +++ b/src/dv/plugin_transport_dv.c @@ -519,11 +519,9 @@ handle_dv_disconnect (void *cls, * Clean up the pending request, and call continuations. * * @param cls closure - * @param ok #GNUNET_OK on success, #GNUNET_SYSERR on error */ static void -send_finished (void *cls, - int ok) +send_finished (void *cls) { struct PendingRequest *pr = cls; struct GNUNET_ATS_Session *session = pr->session; @@ -535,7 +533,7 @@ send_finished (void *cls, if (NULL != pr->transmit_cont) pr->transmit_cont (pr->transmit_cont_cls, &session->sender, - ok, + GNUNET_OK, pr->size, 0); GNUNET_free (pr); } diff --git a/src/include/gnunet_dv_service.h b/src/include/gnunet_dv_service.h index 248e373dc..f58311f74 100644 --- a/src/include/gnunet_dv_service.h +++ b/src/include/gnunet_dv_service.h @@ -45,10 +45,11 @@ * @param distance distance to the peer * @param network the peer is located in */ -typedef void (*GNUNET_DV_ConnectCallback)(void *cls, - const struct GNUNET_PeerIdentity *peer, - uint32_t distance, - enum GNUNET_ATS_Network_Type network); +typedef void +(*GNUNET_DV_ConnectCallback)(void *cls, + const struct GNUNET_PeerIdentity *peer, + uint32_t distance, + enum GNUNET_ATS_Network_Type network); /** @@ -60,10 +61,11 @@ typedef void (*GNUNET_DV_ConnectCallback)(void *cls, * @param distance new distance to the peer * @param network this network will be used to reach the next hop */ -typedef void (*GNUNET_DV_DistanceChangedCallback)(void *cls, - const struct GNUNET_PeerIdentity *peer, - uint32_t distance, - enum GNUNET_ATS_Network_Type network); +typedef void +(*GNUNET_DV_DistanceChangedCallback)(void *cls, + const struct GNUNET_PeerIdentity *peer, + uint32_t distance, + enum GNUNET_ATS_Network_Type network); /** @@ -73,8 +75,9 @@ typedef void (*GNUNET_DV_DistanceChangedCallback)(void *cls, * @param cls closure * @param peer peer that disconnected */ -typedef void (*GNUNET_DV_DisconnectCallback)(void *cls, - const struct GNUNET_PeerIdentity *peer); +typedef void +(*GNUNET_DV_DisconnectCallback)(void *cls, + const struct GNUNET_PeerIdentity *peer); /** @@ -86,10 +89,11 @@ typedef void (*GNUNET_DV_DisconnectCallback)(void *cls, * @param distance how far did the message travel * @param msg actual message payload */ -typedef void (*GNUNET_DV_MessageReceivedCallback)(void *cls, - const struct GNUNET_PeerIdentity *sender, - uint32_t distance, - const struct GNUNET_MessageHeader *msg); +typedef void +(*GNUNET_DV_MessageReceivedCallback)(void *cls, + const struct GNUNET_PeerIdentity *sender, + uint32_t distance, + const struct GNUNET_MessageHeader *msg); /** @@ -97,10 +101,9 @@ typedef void (*GNUNET_DV_MessageReceivedCallback)(void *cls, * message has been successful. * * @param cls closure - * @param ok GNUNET_OK on success, GNUNET_SYSERR on error */ -typedef void (*GNUNET_DV_MessageSentCallback)(void *cls, - int ok); +typedef void +(*GNUNET_DV_MessageSentCallback)(void *cls); /** -- 2.25.1