From 1e0f7e71c0f8fa00a675b6476fb1a8f74fbfaa07 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 9 Jun 2014 09:28:54 +0000 Subject: -fixing doxygen, indentation --- src/include/gnunet_transport_service.h | 7 ++++--- src/peerinfo-tool/gnunet-peerinfo.c | 19 +++++++++++++------ src/transport/transport_api_address_to_string.c | 11 +++++++---- 3 files changed, 24 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index a1b88c309..9e82a0dda 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h @@ -285,9 +285,10 @@ typedef void * @param cls closure * @param address NULL on error or end of iteration, * otherwise 0-terminated printable UTF-8 string - * @param res result of the address to string conversion: GNUNET_OK or GNUNET_SYSERR - * if GNUNET_OK: address contains address as string - * if GNUNET_SYSERR: address is invalid + * @param res result of the address to string conversion: + * if #GNUNET_OK: address was valid (conversion to + * string might still have failed) + * if #GNUNET_SYSERR: address is invalid */ typedef void (*GNUNET_TRANSPORT_AddressToStringCallback) (void *cls, diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index 9f2370731..b16ad9cbf 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -261,13 +261,17 @@ dump_pc (struct PrintContext *pc) * * @param cls closure * @param address NULL on error, otherwise 0-terminated printable UTF-8 string + * @param res result of the address to string conversion: + * if #GNUNET_OK: address was valid (conversion to + * string might still have failed) + * if #GNUNET_SYSERR: address is invalid */ static void process_resolved_address (void *cls, const char *address, int res) { - struct AddressRecord * ar = cls; + struct AddressRecord *ar = cls; struct PrintContext *pc = ar->pc; if (NULL != address) @@ -276,7 +280,6 @@ process_resolved_address (void *cls, ar->result = GNUNET_strdup (address); return; } - ar->atsc = NULL; if (GNUNET_SYSERR == res) { @@ -328,6 +331,7 @@ print_address (void *cls, { struct PrintContext *pc = cls; struct AddressRecord *ar; + GNUNET_assert (0 < pc->off); ar = &pc->address_list[--pc->off]; ar->pc = pc; @@ -376,7 +380,8 @@ print_peer_info (void *cls, friend_only = GNUNET_NO; if (NULL != hello) friend_only = GNUNET_HELLO_is_friend_only (hello); - if ((GNUNET_YES == be_quiet) || (NULL == hello)) + if ( (GNUNET_YES == be_quiet) || + (NULL == hello) ) { printf ("%s%s\n", (GNUNET_YES == friend_only) ? "F2F: " : "", @@ -400,8 +405,10 @@ print_peer_info (void *cls, } pc->address_list_size = pc->off; pc->address_list = GNUNET_malloc (sizeof (struct AddressRecord) * pc->off); - GNUNET_HELLO_iterate_addresses (hello, GNUNET_NO, - &print_address, pc); + GNUNET_HELLO_iterate_addresses (hello, + GNUNET_NO, + &print_address, + pc); } /* ************************* DUMP Hello ************************** */ @@ -427,7 +434,7 @@ count_addr (void *cls, /** - * Write Hello of my peer to a file. + * Write HELLO of my peer to a file. * * @param cls the `struct GetUriContext *` * @param peer identity of the peer (unused) diff --git a/src/transport/transport_api_address_to_string.c b/src/transport/transport_api_address_to_string.c index a56616ea8..d881f9a08 100644 --- a/src/transport/transport_api_address_to_string.c +++ b/src/transport/transport_api_address_to_string.c @@ -55,12 +55,13 @@ struct GNUNET_TRANSPORT_AddressToStringContext /** * Function called with responses from the service. * - * @param cls our 'struct GNUNET_TRANSPORT_AddressToStringContext*' + * @param cls our `struct GNUNET_TRANSPORT_AddressToStringContext *` * @param msg NULL on timeout or error, otherwise presumably a * message with the human-readable address */ static void -address_response_processor (void *cls, const struct GNUNET_MessageHeader *msg) +address_response_processor (void *cls, + const struct GNUNET_MessageHeader *msg) { struct GNUNET_TRANSPORT_AddressToStringContext *alucb = cls; struct AddressToStringResultMessage *atsm; @@ -70,9 +71,11 @@ address_response_processor (void *cls, const struct GNUNET_MessageHeader *msg) uint32_t addr_len; char *empty_str = ""; - if (msg == NULL) + if (NULL == msg) { - alucb->cb (alucb->cb_cls, NULL, GNUNET_OK); + alucb->cb (alucb->cb_cls, + NULL, + GNUNET_OK); GNUNET_CLIENT_disconnect (alucb->client); GNUNET_free (alucb); return; -- cgit v1.2.3