diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-06-27 15:03:17 +0000 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-06-27 15:03:17 +0000 |
commit | 4450e34453501e9449de830d48e1421590181ef7 (patch) | |
tree | 9c82803af9d60b7636f346302bfd84c378b9cafb /src/consensus/gnunet-service-consensus.c | |
parent | 855dba1b482a8cb48e17da9a2f05442a9594d24f (diff) | |
download | gnunet-4450e34453501e9449de830d48e1421590181ef7.tar.gz gnunet-4450e34453501e9449de830d48e1421590181ef7.zip |
fix compiler warnings
Diffstat (limited to 'src/consensus/gnunet-service-consensus.c')
-rw-r--r-- | src/consensus/gnunet-service-consensus.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/consensus/gnunet-service-consensus.c b/src/consensus/gnunet-service-consensus.c index 99e7aca97..ad01a276b 100644 --- a/src/consensus/gnunet-service-consensus.c +++ b/src/consensus/gnunet-service-consensus.c | |||
@@ -1339,8 +1339,7 @@ commit_set (struct ConsensusSession *session, | |||
1339 | case EVILNESS_SLACK: | 1339 | case EVILNESS_SLACK: |
1340 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1340 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1341 | "P%u: evil peer: slacking\n", | 1341 | "P%u: evil peer: slacking\n", |
1342 | session->local_peer_idx, | 1342 | (unsigned int) session->local_peer_idx); |
1343 | evil.num); | ||
1344 | /* Do nothing. */ | 1343 | /* Do nothing. */ |
1345 | break; | 1344 | break; |
1346 | case EVILNESS_NONE: | 1345 | case EVILNESS_NONE: |
@@ -1671,7 +1670,7 @@ try_finish_step_early (struct Step *step) | |||
1671 | #ifdef GNUNET_EXTRA_LOGGING | 1670 | #ifdef GNUNET_EXTRA_LOGGING |
1672 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1671 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1673 | "Decreased pending_prereq to %u for step `%s'.\n", | 1672 | "Decreased pending_prereq to %u for step `%s'.\n", |
1674 | step->subordinates[i]->pending_prereq, | 1673 | (unsigned int) step->subordinates[i]->pending_prereq, |
1675 | step->subordinates[i]->debug_name); | 1674 | step->subordinates[i]->debug_name); |
1676 | 1675 | ||
1677 | #endif | 1676 | #endif |
@@ -1706,7 +1705,7 @@ finish_step (struct Step *step) | |||
1706 | #ifdef GNUNET_EXTRA_LOGGING | 1705 | #ifdef GNUNET_EXTRA_LOGGING |
1707 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1706 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1708 | "Decreased pending_prereq to %u for step `%s'.\n", | 1707 | "Decreased pending_prereq to %u for step `%s'.\n", |
1709 | step->subordinates[i]->pending_prereq, | 1708 | (unsigned int) step->subordinates[i]->pending_prereq, |
1710 | step->subordinates[i]->debug_name); | 1709 | step->subordinates[i]->debug_name); |
1711 | 1710 | ||
1712 | #endif | 1711 | #endif |
@@ -2699,7 +2698,7 @@ construct_task_graph_gradecast (struct ConsensusSession *session, | |||
2699 | arrange_peers (&p1, &p2, n); | 2698 | arrange_peers (&p1, &p2, n); |
2700 | task = ((struct TaskEntry) { | 2699 | task = ((struct TaskEntry) { |
2701 | .step = step, | 2700 | .step = step, |
2702 | .key = (struct TaskKey) { PHASE_KIND_GRADECAST_LEADER, p1, p2, rep, lead}, | 2701 | .key = (struct TaskKey) { PHASE_KIND_GRADECAST_LEADER, p1, p2, rep, lead }, |
2703 | .start = task_start_reconcile, | 2702 | .start = task_start_reconcile, |
2704 | .cancel = task_cancel_reconcile, | 2703 | .cancel = task_cancel_reconcile, |
2705 | }); | 2704 | }); |
@@ -2807,9 +2806,6 @@ construct_task_graph (struct ConsensusSession *session) | |||
2807 | 2806 | ||
2808 | uint16_t me = session->local_peer_idx; | 2807 | uint16_t me = session->local_peer_idx; |
2809 | 2808 | ||
2810 | uint16_t p1; | ||
2811 | uint16_t p2; | ||
2812 | |||
2813 | /* The task we're currently setting up. */ | 2809 | /* The task we're currently setting up. */ |
2814 | struct TaskEntry task; | 2810 | struct TaskEntry task; |
2815 | 2811 | ||
@@ -2841,6 +2837,9 @@ construct_task_graph (struct ConsensusSession *session) | |||
2841 | 2837 | ||
2842 | for (i = 0; i < n; i++) | 2838 | for (i = 0; i < n; i++) |
2843 | { | 2839 | { |
2840 | uint16_t p1; | ||
2841 | uint16_t p2; | ||
2842 | |||
2844 | p1 = me; | 2843 | p1 = me; |
2845 | p2 = i; | 2844 | p2 = i; |
2846 | arrange_peers (&p1, &p2, n); | 2845 | arrange_peers (&p1, &p2, n); |
@@ -2957,8 +2956,8 @@ initialize_session (struct ConsensusSession *session, | |||
2957 | session->conclude_deadline = GNUNET_TIME_absolute_ntoh (join_msg->deadline); | 2956 | session->conclude_deadline = GNUNET_TIME_absolute_ntoh (join_msg->deadline); |
2958 | session->conclude_start = GNUNET_TIME_absolute_ntoh (join_msg->start); | 2957 | session->conclude_start = GNUNET_TIME_absolute_ntoh (join_msg->start); |
2959 | 2958 | ||
2960 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "consensus with timeout %ums created\n", | 2959 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "consensus with timeout %llums created\n", |
2961 | (GNUNET_TIME_absolute_get_difference (session->conclude_start, session->conclude_deadline)).rel_value_us / 1000); | 2960 | (long long) (GNUNET_TIME_absolute_get_difference (session->conclude_start, session->conclude_deadline)).rel_value_us / 1000); |
2962 | 2961 | ||
2963 | session->local_peer_idx = get_peer_idx (&my_peer, session); | 2962 | session->local_peer_idx = get_peer_idx (&my_peer, session); |
2964 | GNUNET_assert (-1 != session->local_peer_idx); | 2963 | GNUNET_assert (-1 != session->local_peer_idx); |
@@ -3173,11 +3172,11 @@ client_conclude (void *cls, | |||
3173 | static void | 3172 | static void |
3174 | shutdown_task (void *cls) | 3173 | shutdown_task (void *cls) |
3175 | { | 3174 | { |
3175 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "shutting down\n"); | ||
3176 | while (NULL != sessions_head) | 3176 | while (NULL != sessions_head) |
3177 | destroy_session (sessions_head); | 3177 | destroy_session (sessions_head); |
3178 | 3178 | ||
3179 | GNUNET_STATISTICS_destroy (statistics, GNUNET_YES); | 3179 | GNUNET_STATISTICS_destroy (statistics, GNUNET_NO); |
3180 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "handled shutdown request\n"); | ||
3181 | } | 3180 | } |
3182 | 3181 | ||
3183 | 3182 | ||