fix compiler warnings
authorFlorian Dold <florian.dold@gmail.com>
Mon, 27 Jun 2016 15:03:17 +0000 (15:03 +0000)
committerFlorian Dold <florian.dold@gmail.com>
Mon, 27 Jun 2016 15:03:17 +0000 (15:03 +0000)
src/consensus/gnunet-consensus-profiler.c
src/consensus/gnunet-service-consensus.c
src/consensus/test_consensus.conf
src/secretsharing/gnunet-secretsharing-profiler.c

index 4af7740e79b4abc4411908dad32f472565d9343c..290263d9535ad1b62c801d9ed408d723954ce28c 100644 (file)
@@ -98,7 +98,7 @@ controller_cb (void *cls,
 
 
 static void
-statistics_done_db (void *cls,
+statistics_done_cb (void *cls,
                     struct
                     GNUNET_TESTBED_Operation
                     *op,
@@ -108,6 +108,7 @@ statistics_done_db (void *cls,
   GNUNET_TESTBED_operation_done (op);
   if (NULL != statistics_file)
     fclose (statistics_file);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "got statistics, shutting down\n");
   GNUNET_SCHEDULER_shutdown ();
 }
 
@@ -162,7 +163,7 @@ destroy (void *cls)
       statistics_file = fopen (statistics_filename, "w");
     GNUNET_TESTBED_get_statistics (num_peers, peers, NULL, NULL,
                                    statistics_cb,
-                                   statistics_done_db,
+                                   statistics_done_cb,
                                    NULL);
   }
 }
@@ -182,7 +183,7 @@ conclude_cb (void *cls)
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
               "consensus %d done\n",
-              chp - consensus_handles);
+              (int) (chp - consensus_handles));
   GNUNET_SCHEDULER_add_now (destroy, *chp);
 }
 
@@ -349,6 +350,8 @@ static void
 disconnect_adapter(void *cls, void *op_result)
 {
   /* FIXME: what to do here? */
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+              "disconnect adapter called\n");
 }
 
 
index 99e7aca978a6c8199f71703aad61203ad3bcced0..ad01a276bb60f2f6818998a8add3d16d8f9e31f2 100644 (file)
@@ -1339,8 +1339,7 @@ commit_set (struct ConsensusSession *session,
       case EVILNESS_SLACK:
         GNUNET_log (GNUNET_ERROR_TYPE_INFO,
                     "P%u: evil peer: slacking\n",
-                    session->local_peer_idx,
-                    evil.num);
+                    (unsigned int) session->local_peer_idx);
         /* Do nothing. */
         break;
       case EVILNESS_NONE:
@@ -1671,7 +1670,7 @@ try_finish_step_early (struct Step *step)
 #ifdef GNUNET_EXTRA_LOGGING
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Decreased pending_prereq to %u for step `%s'.\n",
-                step->subordinates[i]->pending_prereq,
+                (unsigned int) step->subordinates[i]->pending_prereq,
                 step->subordinates[i]->debug_name);
 
 #endif
@@ -1706,7 +1705,7 @@ finish_step (struct Step *step)
 #ifdef GNUNET_EXTRA_LOGGING
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "Decreased pending_prereq to %u for step `%s'.\n",
-                step->subordinates[i]->pending_prereq,
+                (unsigned int) step->subordinates[i]->pending_prereq,
                 step->subordinates[i]->debug_name);
 
 #endif
@@ -2699,7 +2698,7 @@ construct_task_graph_gradecast (struct ConsensusSession *session,
     arrange_peers (&p1, &p2, n);
     task = ((struct TaskEntry) {
       .step = step,
-      .key = (struct TaskKey) { PHASE_KIND_GRADECAST_LEADER, p1, p2, rep, lead},
+      .key = (struct TaskKey) { PHASE_KIND_GRADECAST_LEADER, p1, p2, rep, lead },
       .start = task_start_reconcile,
       .cancel = task_cancel_reconcile,
     });
@@ -2807,9 +2806,6 @@ construct_task_graph (struct ConsensusSession *session)
 
   uint16_t me = session->local_peer_idx;
 
-  uint16_t p1;
-  uint16_t p2;
-
   /* The task we're currently setting up. */
   struct TaskEntry task;
 
@@ -2841,6 +2837,9 @@ construct_task_graph (struct ConsensusSession *session)
 
   for (i = 0; i < n; i++)
   {
+    uint16_t p1;
+    uint16_t p2;
+
     p1 = me;
     p2 = i;
     arrange_peers (&p1, &p2, n);
@@ -2957,8 +2956,8 @@ initialize_session (struct ConsensusSession *session,
   session->conclude_deadline = GNUNET_TIME_absolute_ntoh (join_msg->deadline);
   session->conclude_start = GNUNET_TIME_absolute_ntoh (join_msg->start);
 
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "consensus with timeout %ums created\n",
-              (GNUNET_TIME_absolute_get_difference (session->conclude_start, session->conclude_deadline)).rel_value_us / 1000);
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "consensus with timeout %llums created\n",
+              (long long) (GNUNET_TIME_absolute_get_difference (session->conclude_start, session->conclude_deadline)).rel_value_us / 1000);
 
   session->local_peer_idx = get_peer_idx (&my_peer, session);
   GNUNET_assert (-1 != session->local_peer_idx);
@@ -3173,11 +3172,11 @@ client_conclude (void *cls,
 static void
 shutdown_task (void *cls)
 {
+  GNUNET_log (GNUNET_ERROR_TYPE_INFO, "shutting down\n");
   while (NULL != sessions_head)
     destroy_session (sessions_head);
 
-  GNUNET_STATISTICS_destroy (statistics, GNUNET_YES);
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "handled shutdown request\n");
+  GNUNET_STATISTICS_destroy (statistics, GNUNET_NO);
 }
 
 
index a780599b6ce049c325d2c085ee75c58ace664714..8f144fa5e916348f56d885ff4b7f3a06b3fca694 100644 (file)
@@ -12,7 +12,7 @@ BINARY = gnunet-service-evil-consensus
 
 
 [arm]
-RESOURCE_DIAGNOSTICS = resource.log.${PEERID}
+RESOURCE_DIAGNOSTICS = resource.log.${PEERID:-master}
 
 [core]
 FORECESTART = YES
index 34f959d1ae1284ce004bfd2145ae79630d00e19b..3ff5d7fdd3dc97034ecc1187d0bd9a8b65145542 100644 (file)
@@ -304,7 +304,7 @@ secret_ready_cb (void *cls,
                  struct GNUNET_SECRETSHARING_Share *my_share,
                  struct GNUNET_SECRETSHARING_PublicKey *public_key,
                  unsigned int num_ready_peers,
-                 struct GNUNET_PeerIdentity *ready_peers)
+                 const struct GNUNET_PeerIdentity *ready_peers)
 {
   struct GNUNET_SECRETSHARING_Session **sp = cls;
   unsigned int n = sp - session_handles;