From 6e03d509075d2cd38fabab6568b4c2bf2451505e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 24 Dec 2013 14:11:17 +0000 Subject: [PATCH] -fixing misc format strings --- src/arm/arm_api.c | 13 +- src/ats/gnunet-service-ats_addresses.c | 43 +-- src/ats/gnunet-service-ats_performance.c | 32 +- src/ats/gnunet-service-ats_scheduling.c | 7 +- src/ats/perf_ats_solver.c | 21 +- src/ats/test_ats_mlp_averaging.c | 6 +- src/ats/test_ats_simplistic_pref_aging.c | 276 +++++++++--------- src/ats/test_ats_solver_convergence.c | 30 +- ...st_ats_solver_request_and_delete_address.c | 8 +- src/util/scheduler.c | 1 + 10 files changed, 232 insertions(+), 205 deletions(-) diff --git a/src/arm/arm_api.c b/src/arm/arm_api.c index ee699739a..1b83c3106 100644 --- a/src/arm/arm_api.c +++ b/src/arm/arm_api.c @@ -474,10 +474,10 @@ client_notify_handler (void *cls, /** * Transmit the next message to the arm service. * - * @param cls closure with the 'struct GNUNET_ARM_Handle' - * @param size number of bytes available in buf + * @param cls closure with the `struct GNUNET_ARM_Handle` + * @param size number of bytes available in @a buf * @param buf where the callee should write the message - * @return number of bytes written to buf + * @return number of bytes written to @a buf */ static size_t transmit_arm_message (void *cls, size_t size, void *buf) @@ -491,8 +491,8 @@ transmit_arm_message (void *cls, size_t size, void *buf) notify_connection = GNUNET_NO; LOG (GNUNET_ERROR_TYPE_DEBUG, - "transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n", - buf, size, h->currently_down ? "unconnected" : "connected"); + "transmit_arm_message is running with %p buffer of size %lu. ARM is known to be %s\n", + buf, size, h->currently_down ? "unconnected" : "connected"); GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->reconnect_task); h->cth = NULL; if ((GNUNET_YES == h->currently_down) && (NULL != buf)) @@ -512,7 +512,8 @@ transmit_arm_message (void *cls, size_t size, void *buf) } if (NULL == (cm = h->control_pending_head)) { - LOG (GNUNET_ERROR_TYPE_DEBUG, "Queue is empty, not sending anything\n"); + LOG (GNUNET_ERROR_TYPE_DEBUG, + "Queue is empty, not sending anything\n"); msize = 0; goto end; } diff --git a/src/ats/gnunet-service-ats_addresses.c b/src/ats/gnunet-service-ats_addresses.c index 8e47ae74c..366010afb 100644 --- a/src/ats/gnunet-service-ats_addresses.c +++ b/src/ats/gnunet-service-ats_addresses.c @@ -1323,9 +1323,10 @@ GAS_addresses_handle_backoff_reset (struct GAS_Addresses_Handle *handle, } - static int -eval_count_active_it (void *cls, const struct GNUNET_PeerIdentity *id, void *obj) +eval_count_active_it (void *cls, + const struct GNUNET_PeerIdentity *id, + void *obj) { int *request_fulfilled = cls; struct ATS_Address *addr = obj; @@ -1343,7 +1344,8 @@ eval_count_active_it (void *cls, const struct GNUNET_PeerIdentity *id, void *obj /** * Summary context */ -struct SummaryContext { +struct SummaryContext +{ /** * Sum of the utilized inbound bandwidth per network */ @@ -1364,11 +1366,10 @@ struct SummaryContext { static int eval_sum_bw_used (void *cls, const struct GNUNET_PeerIdentity *id, void *obj) { + struct SummaryContext *ctx = cls; struct ATS_Address *addr = obj; int networks[GNUNET_ATS_NetworkTypeCount] = GNUNET_ATS_NetworkType; int net; - struct SummaryContext *ctx = cls; - int c; if (GNUNET_YES == addr->active) @@ -1384,22 +1385,25 @@ eval_sum_bw_used (void *cls, const struct GNUNET_PeerIdentity *id, void *obj) } } GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Active address in %s with (in/out) %lu/%lu Bps\n", - GNUNET_ATS_print_network_type (net), - ntohl (addr->assigned_bw_in.value__), - ntohl (addr->assigned_bw_out.value__)); + "Active address in %s with (in/out) %u/%u Bps\n", + GNUNET_ATS_print_network_type (net), + (unsigned int) ntohl (addr->assigned_bw_in.value__), + (unsigned int) ntohl (addr->assigned_bw_out.value__)); } return GNUNET_OK; } + /** * Summary context */ -struct RelativityContext { +struct RelativityContext +{ struct GAS_Addresses_Handle *ah; }; + static int find_active_address (void *cls, const struct GNUNET_PeerIdentity *id, void *obj) { @@ -2045,24 +2049,26 @@ bandwidth_changed_cb (void *cls, struct ATS_Address *address) } if (NULL == cur) { - GNUNET_log(GNUNET_ERROR_TYPE_INFO, "Nobody is interested in peer `%s' :(\n", - GNUNET_i2s (&address->peer)); + GNUNET_log(GNUNET_ERROR_TYPE_INFO, + "Nobody is interested in peer `%s' :(\n", + GNUNET_i2s (&address->peer)); return; } if ((0 == ntohl (address->assigned_bw_in.value__)) && (0 == ntohl (address->assigned_bw_out.value__))) { - GNUNET_log(GNUNET_ERROR_TYPE_INFO, - "Telling transport to disconnect peer `%s'\n", - GNUNET_i2s (&address->peer)); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Telling transport to disconnect peer `%s'\n", + GNUNET_i2s (&address->peer)); } else { GNUNET_log(GNUNET_ERROR_TYPE_INFO, - "Sending bandwidth update for peer `%s': %lu %lu\n", - GNUNET_i2s (&address->peer), address->assigned_bw_out.value__, - address->assigned_bw_out.value__); + "Sending bandwidth update for peer `%s': %u %u\n", + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (address->assigned_bw_out.value__), + (unsigned int) ntohl (address->assigned_bw_out.value__)); } /* *Notify scheduling clients about suggestion */ @@ -2071,6 +2077,7 @@ bandwidth_changed_cb (void *cls, struct ATS_Address *address) address->atsi_count, address->assigned_bw_out, address->assigned_bw_in); } + /** * Initialize address subsystem. The addresses subsystem manages the addresses * known and current performance information. It has a solver component diff --git a/src/ats/gnunet-service-ats_performance.c b/src/ats/gnunet-service-ats_performance.c index 6509dbe9d..7e9b4802e 100644 --- a/src/ats/gnunet-service-ats_performance.c +++ b/src/ats/gnunet-service-ats_performance.c @@ -261,11 +261,11 @@ peerinfo_it (void *cls, return; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Callback for peer `%s' plugin `%s' BW out %lu, BW in %lu \n", + "Callback for peer `%s' plugin `%s' BW out %u, BW in %u \n", GNUNET_i2s (id), plugin_name, - ntohl (bandwidth_out.value__), - ntohl (bandwidth_in.value__)); + (unsigned int) ntohl (bandwidth_out.value__), + (unsigned int) ntohl (bandwidth_in.value__)); GAS_performance_notify_client(pc, id, plugin_name, @@ -405,31 +405,31 @@ req_addr_peerinfo_it (void *cls, return; } GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Callback for %s peer `%s' plugin `%s' BW out %lu, BW in %lu \n", + "Callback for %s peer `%s' plugin `%s' BW out %u, BW in %u\n", (active == GNUNET_YES) ? "ACTIVE" : "INACTIVE", GNUNET_i2s (id), plugin_name, - ntohl (bandwidth_out.value__), - ntohl (bandwidth_in.value__)); + (unsigned int) ntohl (bandwidth_out.value__), + (unsigned int) ntohl (bandwidth_in.value__)); /* Transmit result */ if ((GNUNET_YES == ai->all) || (GNUNET_YES == active)) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Sending result for %s peer `%s' plugin `%s' BW out %lu, BW in %lu \n", + "Sending result for %s peer `%s' plugin `%s' BW out %u, BW in %u\n", (active == GNUNET_YES) ? "ACTIVE" : "INACTIVE", GNUNET_i2s (id), plugin_name, - ntohl (bandwidth_out.value__), - ntohl (bandwidth_in.value__)); + (unsigned int) ntohl (bandwidth_out.value__), + (unsigned int) ntohl (bandwidth_in.value__)); transmit_req_addr (cls, - id, - plugin_name, - plugin_addr, plugin_addr_len, - active, - atsi, - atsi_count, - bandwidth_out, bandwidth_in); + id, + plugin_name, + plugin_addr, plugin_addr_len, + active, + atsi, + atsi_count, + bandwidth_out, bandwidth_in); } } diff --git a/src/ats/gnunet-service-ats_scheduling.c b/src/ats/gnunet-service-ats_scheduling.c index 13aeb2f02..48fe536c1 100644 --- a/src/ats/gnunet-service-ats_scheduling.c +++ b/src/ats/gnunet-service-ats_scheduling.c @@ -146,9 +146,10 @@ GAS_scheduling_transmit_address_suggestion (const struct GNUNET_PeerIdentity strcpy (&addrp[plugin_addr_len], plugin_name); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "ATS sends quota for peer `%s': (in/out) %lu/%lu\n", - GNUNET_i2s (peer), ntohl (bandwidth_in.value__), - ntohl (bandwidth_out.value__)); + "ATS sends quota for peer `%s': (in/out) %u/%u\n", + GNUNET_i2s (peer), + (unsigned int) ntohl (bandwidth_in.value__), + (unsigned int) ntohl (bandwidth_out.value__)); GNUNET_SERVER_notification_context_unicast (nc, my_client, &msg->header, GNUNET_YES); diff --git a/src/ats/perf_ats_solver.c b/src/ats/perf_ats_solver.c index 92dfcc0c8..2221ea824 100644 --- a/src/ats/perf_ats_solver.c +++ b/src/ats/perf_ats_solver.c @@ -291,25 +291,26 @@ perf_update_address (struct ATS_Address *cur) } - static void -bandwidth_changed_cb (void *cls, struct ATS_Address *address) +bandwidth_changed_cb (void *cls, + struct ATS_Address *address) { - if (0 == ntohl(address->assigned_bw_out.value__) && - 0 == ntohl(address->assigned_bw_in.value__)) + if ( (0 == ntohl (address->assigned_bw_out.value__)) && + (0 == ntohl (address->assigned_bw_in.value__)) ) return; - GNUNET_log(GNUNET_ERROR_TYPE_DEBUG, - "Bandwidth changed addresses %s %p to %lu Bps out / %lu Bps in\n", - GNUNET_i2s (&address->peer), - address, - ntohl(address->assigned_bw_out.value__), - ntohl(address->assigned_bw_in.value__)); + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, + "Bandwidth changed addresses %s %p to %u Bps out / %u Bps in\n", + GNUNET_i2s (&address->peer), + address, + (unsigned int) ntohl (address->assigned_bw_out.value__), + (unsigned int) ntohl (address->assigned_bw_in.value__)); if (GNUNET_YES == ph.bulk_running) GNUNET_break (0); return; } + const double * get_preferences_cb (void *cls, const struct GNUNET_PeerIdentity *id) { diff --git a/src/ats/test_ats_mlp_averaging.c b/src/ats/test_ats_mlp_averaging.c index 4843e1114..45e9388dc 100644 --- a/src/ats/test_ats_mlp_averaging.c +++ b/src/ats/test_ats_mlp_averaging.c @@ -218,7 +218,10 @@ check (void *cls, char *const *args, const char *cfgfile, GNUNET_assert (GNUNET_OK == ctx.mlp_result); res[0] = GAS_mlp_get_preferred_address(mlp, addresses, &p[0]); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Preferred address `%s' outbound bandwidth: %lu Bps\n",res[0]->plugin, ntohl(res[0]->assigned_bw_out.value__)); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Preferred address `%s' outbound bandwidth: %u Bps\n", + res[0]->plugin, + (unsigned int) ntohl (res[0]->assigned_bw_out.value__)); /* Delete an address */ GNUNET_CONTAINER_multihashmap_remove (addresses, &addr[0].peer.hashPubKey, &addr[0]); @@ -233,7 +236,6 @@ check (void *cls, char *const *args, const char *cfgfile, GNUNET_STATISTICS_destroy(stats, GNUNET_NO); ret = 0; - return; } diff --git a/src/ats/test_ats_simplistic_pref_aging.c b/src/ats/test_ats_simplistic_pref_aging.c index a741ad6bb..f354ce1cc 100644 --- a/src/ats/test_ats_simplistic_pref_aging.c +++ b/src/ats/test_ats_simplistic_pref_aging.c @@ -166,153 +166,159 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, if (0 == stage) { - /* Callback for initial suggestion */ - if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id))) - { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: Callback for peer 0 `%s': (in/out) %lu/%lu\n", - stage, - GNUNET_i2s (&address->peer), - ntohl (bandwidth_in.value__), - ntohl (bandwidth_out.value__)); - sug_p0 = GNUNET_YES; - p0_last_bandwidth_out = ntohl(bandwidth_out.value__); - p0_last_bandwidth_in = ntohl(bandwidth_in.value__); - } - if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id))) - { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: Callback for peer 1 `%s': (in/out) %lu/%lu\n", - stage, - GNUNET_i2s (&address->peer), - ntohl (bandwidth_in.value__), - ntohl (bandwidth_out.value__)); - sug_p1 = GNUNET_YES; - p1_last_bandwidth_out = ntohl(bandwidth_out.value__); - p1_last_bandwidth_in = ntohl(bandwidth_in.value__); - } - if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1)) - { - /* Changing preference for peer 0 */ - stage ++; - GNUNET_ATS_performance_change_preference (perf_ats, &p[0].id, GNUNET_ATS_PREFERENCE_BANDWIDTH,(double) 1000, GNUNET_ATS_PREFERENCE_END); - sug_p0 = GNUNET_NO; - sug_p1 = GNUNET_NO; - return; - } - + /* Callback for initial suggestion */ + if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id))) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Stage %u: Callback for peer 0 `%s': (in/out) %u/%u\n", + stage, + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (bandwidth_in.value__), + (unsigned int) ntohl (bandwidth_out.value__)); + sug_p0 = GNUNET_YES; + p0_last_bandwidth_out = ntohl(bandwidth_out.value__); + p0_last_bandwidth_in = ntohl(bandwidth_in.value__); + } + if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id))) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Stage %u: Callback for peer 1 `%s': (in/out) %u/%u\n", + stage, + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (bandwidth_in.value__), + (unsigned int) ntohl (bandwidth_out.value__)); + sug_p1 = GNUNET_YES; + p1_last_bandwidth_out = ntohl(bandwidth_out.value__); + p1_last_bandwidth_in = ntohl(bandwidth_in.value__); + } + if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1)) + { + /* Changing preference for peer 0 */ + stage ++; + GNUNET_ATS_performance_change_preference (perf_ats, &p[0].id, GNUNET_ATS_PREFERENCE_BANDWIDTH,(double) 1000, GNUNET_ATS_PREFERENCE_END); + sug_p0 = GNUNET_NO; + sug_p1 = GNUNET_NO; + return; + } } if (1 == stage) { - /* Callback due to preference change */ - if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id))) - { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: Callback for peer 0 `%s': (in/out) %lu/%lu\n", - stage, - GNUNET_i2s (&address->peer), - ntohl (bandwidth_in.value__), - ntohl (bandwidth_out.value__)); - sug_p0 = GNUNET_YES; - - /* Peer 0 should get more bandwidth */ - if (cur_bandwidth_out <= p0_last_bandwidth_out) - GNUNET_break (0); - if (cur_bandwidth_in <= p0_last_bandwidth_in) - GNUNET_break (0); - p0_last_bandwidth_out = ntohl(bandwidth_out.value__); - p0_last_bandwidth_in = ntohl(bandwidth_in.value__); - } - if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id))) - { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: Callback for peer 1 `%s': (in/out) %lu/%lu\n", - stage, - GNUNET_i2s (&address->peer), - ntohl (bandwidth_in.value__), - ntohl (bandwidth_out.value__)); - sug_p1 = GNUNET_YES; - - /* Peer 1 should get less bandwidth */ - if (cur_bandwidth_out >= p1_last_bandwidth_out) - { - GNUNET_break (0); - goto error; - } - if (cur_bandwidth_in >= p1_last_bandwidth_in) - { - GNUNET_break (0); - goto error; - } - p1_last_bandwidth_out = ntohl(bandwidth_out.value__); - p1_last_bandwidth_in = ntohl(bandwidth_in.value__); - } - if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1)) - { - stage ++; - sug_p0 = GNUNET_NO; - sug_p1 = GNUNET_NO; - return; - } + /* Callback due to preference change */ + if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id))) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Stage %u: Callback for peer 0 `%s': (in/out) %u/%u\n", + stage, + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (bandwidth_in.value__), + (unsigned int) ntohl (bandwidth_out.value__)); + sug_p0 = GNUNET_YES; + + /* Peer 0 should get more bandwidth */ + if (cur_bandwidth_out <= p0_last_bandwidth_out) + GNUNET_break (0); + if (cur_bandwidth_in <= p0_last_bandwidth_in) + GNUNET_break (0); + p0_last_bandwidth_out = ntohl(bandwidth_out.value__); + p0_last_bandwidth_in = ntohl(bandwidth_in.value__); + } + if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id))) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Stage %u: Callback for peer 1 `%s': (in/out) %u/%u\n", + stage, + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (bandwidth_in.value__), + (unsigned int) ntohl (bandwidth_out.value__)); + sug_p1 = GNUNET_YES; + + /* Peer 1 should get less bandwidth */ + if (cur_bandwidth_out >= p1_last_bandwidth_out) + { + GNUNET_break (0); + goto error; + } + if (cur_bandwidth_in >= p1_last_bandwidth_in) + { + GNUNET_break (0); + goto error; + } + p1_last_bandwidth_out = ntohl(bandwidth_out.value__); + p1_last_bandwidth_in = ntohl(bandwidth_in.value__); + } + if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1)) + { + stage ++; + sug_p0 = GNUNET_NO; + sug_p1 = GNUNET_NO; + return; + } } if (2 == stage) { - /* Callback due to preference aging */ - if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id))) - { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: Callback for peer 0 `%s': (in/out) %lu/%lu\n", - stage, - GNUNET_i2s (&address->peer), - ntohl (bandwidth_in.value__), - ntohl (bandwidth_out.value__)); - sug_p0 = GNUNET_YES; - - /* Peer 0 should get less bandwidth */ - if (cur_bandwidth_out <= p0_last_bandwidth_out) - GNUNET_break (0); - if (cur_bandwidth_in <= p0_last_bandwidth_in) - GNUNET_break (0); - p0_last_bandwidth_out = ntohl(bandwidth_out.value__); - p0_last_bandwidth_in = ntohl(bandwidth_in.value__); - } - if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id))) - { - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Stage %u: Callback for peer 1 `%s': (in/out) %lu/%lu\n", - stage, - GNUNET_i2s (&address->peer), - ntohl (bandwidth_in.value__), - ntohl (bandwidth_out.value__)); - sug_p1 = GNUNET_YES; - /* Peer 1 should get more bandwidth */ - if (cur_bandwidth_out <= p1_last_bandwidth_out) - { - GNUNET_break (0); - goto error; - } - if (cur_bandwidth_in <= p1_last_bandwidth_in) - { - GNUNET_break (0); - goto error; - } - p0_last_bandwidth_out = ntohl(bandwidth_out.value__); - p0_last_bandwidth_in = ntohl(bandwidth_in.value__); - } - - if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1)) - { - /* Done ! */ - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n"); - stage ++; - ret = 0; - GNUNET_SCHEDULER_add_now (&end,NULL); - return; - } + /* Callback due to preference aging */ + if (0 == memcmp (&address->peer, &p[0].id, sizeof (p[0].id))) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Stage %u: Callback for peer 0 `%s': (in/out) %u/%u\n", + stage, + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (bandwidth_in.value__), + (unsigned int) ntohl (bandwidth_out.value__)); + sug_p0 = GNUNET_YES; + + /* Peer 0 should get less bandwidth */ + if (cur_bandwidth_out <= p0_last_bandwidth_out) + GNUNET_break (0); + if (cur_bandwidth_in <= p0_last_bandwidth_in) + GNUNET_break (0); + p0_last_bandwidth_out = ntohl(bandwidth_out.value__); + p0_last_bandwidth_in = ntohl(bandwidth_in.value__); + } + if (0 == memcmp (&address->peer, &p[1].id, sizeof (p[1].id))) + { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Stage %u: Callback for peer 1 `%s': (in/out) %u/%u\n", + stage, + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (bandwidth_in.value__), + (unsigned int) ntohl (bandwidth_out.value__)); + sug_p1 = GNUNET_YES; + /* Peer 1 should get more bandwidth */ + if (cur_bandwidth_out <= p1_last_bandwidth_out) + { + GNUNET_break (0); + goto error; + } + if (cur_bandwidth_in <= p1_last_bandwidth_in) + { + GNUNET_break (0); + goto error; + } + p0_last_bandwidth_out = ntohl(bandwidth_out.value__); + p0_last_bandwidth_in = ntohl(bandwidth_in.value__); + } + + if ((GNUNET_YES == sug_p0) && (GNUNET_YES == sug_p1)) + { + /* Done ! */ + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Done!\n"); + stage ++; + ret = 0; + GNUNET_SCHEDULER_add_now (&end,NULL); + return; + } } return; error: - /* Error ! */ - ret = 1; - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Error!\n"); - GNUNET_SCHEDULER_add_now (&end,NULL); + /* Error ! */ + ret = 1; + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Error!\n"); + GNUNET_SCHEDULER_add_now (&end,NULL); } + static void run (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg, diff --git a/src/ats/test_ats_solver_convergence.c b/src/ats/test_ats_solver_convergence.c index c223eda40..ff476a8c8 100755 --- a/src/ats/test_ats_solver_convergence.c +++ b/src/ats/test_ats_solver_convergence.c @@ -170,8 +170,11 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, time_delta = GNUNET_TIME_absolute_get_difference(time_start, GNUNET_TIME_absolute_get()); - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received suggestion for peer '%s': IN %lu - OUT %lu\n", - GNUNET_i2s (&address->peer), ntohl(bandwidth_in.value__)/1024, ntohl(bandwidth_out.value__)/1024); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Received suggestion for peer '%s': IN %u kb/s - OUT %u kb/s\n", + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (bandwidth_in.value__)/1024, + (unsigned int) ntohl (bandwidth_out.value__)/1024); if (write_data_file) { @@ -184,21 +187,24 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, GNUNET_DISK_PERM_USER_EXEC | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE); if (NULL == data_file_handle) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to file `%s'\n", data_file_name); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Cannot write data to file `%s'\n", + data_file_name); } else { if (GNUNET_SYSERR == GNUNET_DISK_file_write(data_file_handle, data, strlen(data))) - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Cannot write data to file `%s'\n", data_file_name); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Cannot write data to file `%s'\n", + data_file_name); if (GNUNET_SYSERR == GNUNET_DISK_file_close (data_file_handle)) - GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "Cannot close log file '%s'\n", - data_file_name); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Cannot close log file '%s'\n", + data_file_name); } GNUNET_free(data); } - - return; } @@ -207,13 +213,15 @@ stat_cb(void *cls, const char *subsystem, const char *name, uint64_t value, int is_persistent) { - - GNUNET_log (GNUNET_ERROR_TYPE_INFO, "ATS statistics: `%s' `%s' %llu\n", - subsystem,name, value); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "ATS statistics: `%s' `%s' %llu\n", + subsystem,name, + (unsigned long long) value); GNUNET_ATS_suggest_address (sched_ats, &p.id); return GNUNET_OK; } + static void run (void *cls, const struct GNUNET_CONFIGURATION_Handle *mycfg, struct GNUNET_TESTING_Peer *peer) diff --git a/src/ats/test_ats_solver_request_and_delete_address.c b/src/ats/test_ats_solver_request_and_delete_address.c index e0b879433..48ee8014c 100644 --- a/src/ats/test_ats_solver_request_and_delete_address.c +++ b/src/ats/test_ats_solver_request_and_delete_address.c @@ -159,10 +159,10 @@ address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address, /* Expecting disconnect */ GNUNET_log (GNUNET_ERROR_TYPE_INFO, - "Received sugggestion for peer `%s': %lu %lu\n", - GNUNET_i2s (&address->peer), - ntohl(bandwidth_in.value__), - ntohl(bandwidth_out.value__)); + "Received sugggestion for peer `%s': %u %u\n", + GNUNET_i2s (&address->peer), + (unsigned int) ntohl (bandwidth_in.value__), + (unsigned int) ntohl (bandwidth_out.value__)); if ((ntohl(bandwidth_in.value__) == 0) && (ntohl(bandwidth_out.value__) == 0)) diff --git a/src/util/scheduler.c b/src/util/scheduler.c index fb81bafb7..2a9623428 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c @@ -1555,6 +1555,7 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, task, task_cls); } + /** * Schedule a new task to be run with a specified delay or when the * specified file descriptor is ready. The delay can be -- 2.25.1