aboutsummaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-06 14:44:08 +0000
committerChristian Grothoff <christian@grothoff.org>2016-05-06 14:44:08 +0000
commite8cf81fdb3fdaef59b49da8f6e952a3225ab326e (patch)
tree4e5f75d44a9121b32895fdfc5a4177052a7d923d /src/cadet
parentae8cb91d9961899075a892a3110204bc139c2eb6 (diff)
downloadgnunet-e8cf81fdb3fdaef59b49da8f6e952a3225ab326e.tar.gz
gnunet-e8cf81fdb3fdaef59b49da8f6e952a3225ab326e.zip
fixing compiler warnings
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/cadet_api.c21
-rw-r--r--src/cadet/gnunet-cadet-profiler.c52
-rw-r--r--src/cadet/gnunet-cadet.c8
3 files changed, 58 insertions, 23 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index d5b0688e6..960f4788c 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -1105,7 +1105,10 @@ process_get_peer (struct GNUNET_CADET_Handle *h,
1105 if (msize != esize) 1105 if (msize != esize)
1106 { 1106 {
1107 GNUNET_break_op (0); 1107 GNUNET_break_op (0);
1108 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "m:%u, e: %u\n", msize, esize); 1108 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1109 "m:%u, e: %u\n",
1110 (unsigned int) msize,
1111 (unsigned int) esize);
1109 h->info_cb.peer_cb (h->info_cls, NULL, 0, 0, 0, NULL); 1112 h->info_cb.peer_cb (h->info_cls, NULL, 0, 0, 0, NULL);
1110 goto clean_cls; 1113 goto clean_cls;
1111 } 1114 }
@@ -1212,11 +1215,17 @@ process_get_tunnel (struct GNUNET_CADET_Handle *h,
1212 if (msize != esize) 1215 if (msize != esize)
1213 { 1216 {
1214 GNUNET_break_op (0); 1217 GNUNET_break_op (0);
1215 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "m:%u, e: %u (%u ch, %u conn)\n", 1218 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1216 msize, esize, ch_n, c_n); 1219 "m:%u, e: %u (%u ch, %u conn)\n",
1217 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u (%u ch, %u conn)\n", 1220 (unsigned int) msize,
1218 sizeof (struct GNUNET_CADET_LocalInfoTunnel), 1221 (unsigned int) esize,
1219 sizeof (CADET_ChannelNumber), sizeof (struct GNUNET_HashCode)); 1222 ch_n,
1223 c_n);
1224 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1225 "%u (%u ch, %u conn)\n",
1226 (unsigned int) sizeof (struct GNUNET_CADET_LocalInfoTunnel),
1227 (unsigned int) sizeof (CADET_ChannelNumber),
1228 (unsigned int) sizeof (struct GNUNET_HashCode));
1220 h->info_cb.tunnel_cb (h->info_cls, NULL, 0, 0, NULL, NULL, 0, 0); 1229 h->info_cb.tunnel_cb (h->info_cls, NULL, 0, 0, NULL, NULL, 0, 0);
1221 goto clean_cls; 1230 goto clean_cls;
1222 } 1231 }
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c
index b2a07cb0c..aa095d190 100644
--- a/src/cadet/gnunet-cadet-profiler.c
+++ b/src/cadet/gnunet-cadet-profiler.c
@@ -453,8 +453,10 @@ stats_iterator (void *cls,
453 uint32_t i; 453 uint32_t i;
454 454
455 i = GNUNET_TESTBED_get_index (peer); 455 i = GNUNET_TESTBED_get_index (peer);
456 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " STATS %u - %s [%s]: %llu\n", 456 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
457 i, subsystem, name, value); 457 " STATS %u - %s [%s]: %llu\n",
458 i, subsystem, name,
459 (unsigned long long) value);
458 460
459 return GNUNET_OK; 461 return GNUNET_OK;
460} 462}
@@ -569,7 +571,9 @@ adjust_running_peers (unsigned int target)
569static void 571static void
570next_rnd (void *cls) 572next_rnd (void *cls)
571{ 573{
572 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "ROUND %ld\n", current_round); 574 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
575 "ROUND %u\n",
576 current_round);
573 if (0.0 == rounds[current_round]) 577 if (0.0 == rounds[current_round])
574 { 578 {
575 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Finishing\n"); 579 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Finishing\n");
@@ -680,7 +684,7 @@ pong (struct GNUNET_CADET_Channel *channel,
680static size_t 684static size_t
681tmt_rdy_ping (void *cls, size_t size, void *buf) 685tmt_rdy_ping (void *cls, size_t size, void *buf)
682{ 686{
683 struct CadetPeer *peer = (struct CadetPeer *) cls; 687 struct CadetPeer *peer = cls;
684 struct CadetPingMessage *msg = buf; 688 struct CadetPingMessage *msg = buf;
685 689
686 peer->ping_ntr = NULL; 690 peer->ping_ntr = NULL;
@@ -691,11 +695,16 @@ tmt_rdy_ping (void *cls, size_t size, void *buf)
691 GNUNET_break (GNUNET_YES == test_finished); 695 GNUNET_break (GNUNET_YES == test_finished);
692 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 696 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
693 "size %u, buf %p, data_sent %u, data_received %u\n", 697 "size %u, buf %p, data_sent %u, data_received %u\n",
694 size, buf, peer->data_sent, peer->data_received); 698 (unsigned int) size,
699 buf,
700 peer->data_sent,
701 peer->data_received);
695 702
696 return 0; 703 return 0;
697 } 704 }
698 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sending: msg %d\n", peer->data_sent); 705 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
706 "Sending: msg %d\n",
707 peer->data_sent);
699 msg->header.size = htons (size); 708 msg->header.size = htons (size);
700 msg->header.type = htons (PING); 709 msg->header.type = htons (PING);
701 msg->counter = htonl (peer->data_sent++); 710 msg->counter = htonl (peer->data_sent++);
@@ -726,7 +735,9 @@ ping_handler (void *cls, struct GNUNET_CADET_Channel *channel,
726{ 735{
727 long n = (long) cls; 736 long n = (long) cls;
728 737
729 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "%u got PING\n", n); 738 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
739 "%u got PING\n",
740 (unsigned int) n);
730 GNUNET_CADET_receive_done (channel); 741 GNUNET_CADET_receive_done (channel);
731 if (GNUNET_NO == test_finished) 742 if (GNUNET_NO == test_finished)
732 pong (channel, (struct CadetPingMessage *) message); 743 pong (channel, (struct CadetPingMessage *) message);
@@ -814,8 +825,11 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
814 GNUNET_assert (NULL != peer); 825 GNUNET_assert (NULL != peer);
815 if (NULL == peers[n].incoming) 826 if (NULL == peers[n].incoming)
816 { 827 {
817 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "WARMUP %3u: %u <= %u\n", 828 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
818 peers_warmup, n, get_index (peer)); 829 "WARMUP %3u: %u <= %u\n",
830 peers_warmup,
831 (unsigned int) n,
832 get_index (peer));
819 peers_warmup++; 833 peers_warmup++;
820 if (peers_warmup < peers_total) 834 if (peers_warmup < peers_total)
821 return NULL; 835 return NULL;
@@ -829,8 +843,11 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel,
829 } 843 }
830 GNUNET_assert (peer == peers[n].incoming); 844 GNUNET_assert (peer == peers[n].incoming);
831 GNUNET_assert (peer->dest == &peers[n]); 845 GNUNET_assert (peer->dest == &peers[n]);
832 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%u <= %u %p\n", 846 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
833 n, get_index (peer), channel); 847 "%u <= %u %p\n",
848 (unsigned int) n,
849 get_index (peer),
850 channel);
834 peers[n].incoming_ch = channel; 851 peers[n].incoming_ch = channel;
835 852
836 return NULL; 853 return NULL;
@@ -911,8 +928,11 @@ start_test (void *cls)
911 GNUNET_CADET_TEST_cleanup (test_ctx); 928 GNUNET_CADET_TEST_cleanup (test_ctx);
912 return; 929 return;
913 } 930 }
914 GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%u => %u %p\n", 931 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
915 i, get_index (peers[i].dest), peers[i].ch); 932 "%lu => %u %p\n",
933 i,
934 get_index (peers[i].dest),
935 peers[i].ch);
916 peers[i].ping_task = GNUNET_SCHEDULER_add_delayed (delay_ms_rnd (2000), 936 peers[i].ping_task = GNUNET_SCHEDULER_add_delayed (delay_ms_rnd (2000),
917 &ping, &peers[i]); 937 &ping, &peers[i]);
918 } 938 }
@@ -981,8 +1001,10 @@ peer_id_cb (void *cls,
981 return; 1001 return;
982 } 1002 }
983 peers[n].id = *(pinfo->result.id); 1003 peers[n].id = *(pinfo->result.id);
984 GNUNET_log (GNUNET_ERROR_TYPE_INFO, " %u id: %s\n", 1004 GNUNET_log (GNUNET_ERROR_TYPE_INFO,
985 n, GNUNET_i2s (&peers[n].id)); 1005 "%ld id: %s\n",
1006 n,
1007 GNUNET_i2s (&peers[n].id));
986 GNUNET_break (GNUNET_OK == 1008 GNUNET_break (GNUNET_OK ==
987 GNUNET_CONTAINER_multipeermap_put (ids, &peers[n].id, &peers[n], 1009 GNUNET_CONTAINER_multipeermap_put (ids, &peers[n].id, &peers[n],
988 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)); 1010 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index 6453392d8..f24975203 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -266,7 +266,9 @@ data_ready (void *cls, size_t size, void *buf)
266 } 266 }
267 267
268 total_size = data_size + sizeof (struct GNUNET_MessageHeader); 268 total_size = data_size + sizeof (struct GNUNET_MessageHeader);
269 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "sending %u bytes\n", data_size); 269 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
270 "sending %u bytes\n",
271 (unsigned int) data_size);
270 GNUNET_assert (size >= total_size); 272 GNUNET_assert (size >= total_size);
271 273
272 msg = buf; 274 msg = buf;
@@ -297,7 +299,9 @@ read_stdio (void *cls)
297 static char buf[60000]; 299 static char buf[60000];
298 300
299 data_size = read (0, buf, 60000); 301 data_size = read (0, buf, 60000);
300 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "stdio read %u bytes\n", data_size); 302 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
303 "stdio read %u bytes\n",
304 (unsigned int) data_size);
301 if (data_size < 1) 305 if (data_size < 1)
302 { 306 {
303 GNUNET_SCHEDULER_shutdown(); 307 GNUNET_SCHEDULER_shutdown();