aboutsummaryrefslogtreecommitdiff
path: root/src/consensus
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2016-06-27 15:03:17 +0000
committerFlorian Dold <florian.dold@gmail.com>2016-06-27 15:03:17 +0000
commit4450e34453501e9449de830d48e1421590181ef7 (patch)
tree9c82803af9d60b7636f346302bfd84c378b9cafb /src/consensus
parent855dba1b482a8cb48e17da9a2f05442a9594d24f (diff)
downloadgnunet-4450e34453501e9449de830d48e1421590181ef7.tar.gz
gnunet-4450e34453501e9449de830d48e1421590181ef7.zip
fix compiler warnings
Diffstat (limited to 'src/consensus')
-rw-r--r--src/consensus/gnunet-consensus-profiler.c9
-rw-r--r--src/consensus/gnunet-service-consensus.c23
-rw-r--r--src/consensus/test_consensus.conf2
3 files changed, 18 insertions, 16 deletions
diff --git a/src/consensus/gnunet-consensus-profiler.c b/src/consensus/gnunet-consensus-profiler.c
index 4af7740e7..290263d95 100644
--- a/src/consensus/gnunet-consensus-profiler.c
+++ b/src/consensus/gnunet-consensus-profiler.c
@@ -98,7 +98,7 @@ controller_cb (void *cls,
98 98
99 99
100static void 100static void
101statistics_done_db (void *cls, 101statistics_done_cb (void *cls,
102 struct 102 struct
103 GNUNET_TESTBED_Operation 103 GNUNET_TESTBED_Operation
104 *op, 104 *op,
@@ -108,6 +108,7 @@ statistics_done_db (void *cls,
108 GNUNET_TESTBED_operation_done (op); 108 GNUNET_TESTBED_operation_done (op);
109 if (NULL != statistics_file) 109 if (NULL != statistics_file)
110 fclose (statistics_file); 110 fclose (statistics_file);
111 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "got statistics, shutting down\n");
111 GNUNET_SCHEDULER_shutdown (); 112 GNUNET_SCHEDULER_shutdown ();
112} 113}
113 114
@@ -162,7 +163,7 @@ destroy (void *cls)
162 statistics_file = fopen (statistics_filename, "w"); 163 statistics_file = fopen (statistics_filename, "w");
163 GNUNET_TESTBED_get_statistics (num_peers, peers, NULL, NULL, 164 GNUNET_TESTBED_get_statistics (num_peers, peers, NULL, NULL,
164 statistics_cb, 165 statistics_cb,
165 statistics_done_db, 166 statistics_done_cb,
166 NULL); 167 NULL);
167 } 168 }
168} 169}
@@ -182,7 +183,7 @@ conclude_cb (void *cls)
182 183
183 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 184 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
184 "consensus %d done\n", 185 "consensus %d done\n",
185 chp - consensus_handles); 186 (int) (chp - consensus_handles));
186 GNUNET_SCHEDULER_add_now (destroy, *chp); 187 GNUNET_SCHEDULER_add_now (destroy, *chp);
187} 188}
188 189
@@ -349,6 +350,8 @@ static void
349disconnect_adapter(void *cls, void *op_result) 350disconnect_adapter(void *cls, void *op_result)
350{ 351{
351 /* FIXME: what to do here? */ 352 /* FIXME: what to do here? */
353 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
354 "disconnect adapter called\n");
352} 355}
353 356
354 357
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,
3173static void 3172static void
3174shutdown_task (void *cls) 3173shutdown_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
diff --git a/src/consensus/test_consensus.conf b/src/consensus/test_consensus.conf
index a780599b6..8f144fa5e 100644
--- a/src/consensus/test_consensus.conf
+++ b/src/consensus/test_consensus.conf
@@ -12,7 +12,7 @@ BINARY = gnunet-service-evil-consensus
12 12
13 13
14[arm] 14[arm]
15RESOURCE_DIAGNOSTICS = resource.log.${PEERID} 15RESOURCE_DIAGNOSTICS = resource.log.${PEERID:-master}
16 16
17[core] 17[core]
18FORECESTART = YES 18FORECESTART = YES