diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-05-06 15:20:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-05-06 15:20:10 +0000 |
commit | 8e325aefdaab6aae4567762bd639dfa1db3c4f15 (patch) | |
tree | e18e0515ffab51e8871dbf371750b21382691bdc /src/cadet/test_cadet.c | |
parent | 221996eb735384bb5478819e4358d2c648a16d7b (diff) | |
download | gnunet-8e325aefdaab6aae4567762bd639dfa1db3c4f15.tar.gz gnunet-8e325aefdaab6aae4567762bd639dfa1db3c4f15.zip |
fix compiler warnings
Diffstat (limited to 'src/cadet/test_cadet.c')
-rw-r--r-- | src/cadet/test_cadet.c | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/src/cadet/test_cadet.c b/src/cadet/test_cadet.c index b3ded1bdf..8c8d7223e 100644 --- a/src/cadet/test_cadet.c +++ b/src/cadet/test_cadet.c | |||
@@ -363,21 +363,28 @@ stats_cont (void *cls, struct GNUNET_TESTBED_Operation *op, const char *emsg) | |||
363 | * @param subsystem name of subsystem that created the statistic | 363 | * @param subsystem name of subsystem that created the statistic |
364 | * @param name the name of the datum | 364 | * @param name the name of the datum |
365 | * @param value the current value | 365 | * @param value the current value |
366 | * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not | 366 | * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if not |
367 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration | 367 | * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration |
368 | */ | 368 | */ |
369 | static int | 369 | static int |
370 | stats_iterator (void *cls, const struct GNUNET_TESTBED_Peer *peer, | 370 | stats_iterator (void *cls, |
371 | const char *subsystem, const char *name, | 371 | const struct GNUNET_TESTBED_Peer *peer, |
372 | uint64_t value, int is_persistent) | 372 | const char *subsystem, |
373 | const char *name, | ||
374 | uint64_t value, | ||
375 | int is_persistent) | ||
373 | { | 376 | { |
374 | static const char *s_sent = "# keepalives sent"; | 377 | static const char *s_sent = "# keepalives sent"; |
375 | static const char *s_recv = "# keepalives received"; | 378 | static const char *s_recv = "# keepalives received"; |
376 | uint32_t i; | 379 | uint32_t i; |
377 | 380 | ||
378 | i = GNUNET_TESTBED_get_index (peer); | 381 | i = GNUNET_TESTBED_get_index (peer); |
379 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, "STATS PEER %u - %s [%s]: %llu\n", | 382 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
380 | i, subsystem, name, value); | 383 | "STATS PEER %u - %s [%s]: %llu\n", |
384 | i, | ||
385 | subsystem, | ||
386 | name, | ||
387 | (unsigned long long) value); | ||
381 | if (0 == strncmp (s_sent, name, strlen (s_sent)) && 0 == i) | 388 | if (0 == strncmp (s_sent, name, strlen (s_sent)) && 0 == i) |
382 | ka_sent = value; | 389 | ka_sent = value; |
383 | 390 | ||
@@ -401,7 +408,7 @@ gather_stats_and_exit (void *cls) | |||
401 | disconnect_task = NULL; | 408 | disconnect_task = NULL; |
402 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 409 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
403 | "gathering statistics from line %d\n", | 410 | "gathering statistics from line %d\n", |
404 | l); | 411 | (int) l); |
405 | if (NULL != ch) | 412 | if (NULL != ch) |
406 | { | 413 | { |
407 | if (NULL != th) | 414 | if (NULL != th) |
@@ -497,7 +504,9 @@ data_task (void *cls) | |||
497 | else | 504 | else |
498 | { | 505 | { |
499 | i++; | 506 | i++; |
500 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "in %u ms\n", i); | 507 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
508 | "in %llu ms\n", | ||
509 | (unsigned long long) i); | ||
501 | data_job = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, | 510 | data_job = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, |
502 | i), | 511 | i), |
503 | &data_task, (void *) i); | 512 | &data_task, (void *) i); |
@@ -535,7 +544,10 @@ tmt_rdy (void *cls, size_t size, void *buf) | |||
535 | { | 544 | { |
536 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 545 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
537 | "size %u, buf %p, data_sent %u, ack_received %u\n", | 546 | "size %u, buf %p, data_sent %u, ack_received %u\n", |
538 | size, buf, data_sent, ack_received); | 547 | (unsigned int) size, |
548 | buf, | ||
549 | data_sent, | ||
550 | ack_received); | ||
539 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok %u, ok goal %u\n", ok, ok_goal); | 551 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ok %u, ok goal %u\n", ok, ok_goal); |
540 | GNUNET_break (ok >= ok_goal - 2); | 552 | GNUNET_break (ok >= ok_goal - 2); |
541 | 553 | ||
@@ -559,8 +571,10 @@ tmt_rdy (void *cls, size_t size, void *buf) | |||
559 | else | 571 | else |
560 | data_sent++; | 572 | data_sent++; |
561 | counter++; | 573 | counter++; |
562 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " Sent message %d size %u\n", | 574 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
563 | counter, msg_size); | 575 | " Sent message %u size %u\n", |
576 | counter, | ||
577 | (unsigned int) msg_size); | ||
564 | if (data_sent < TOTAL_PACKETS && SPEED == test) | 578 | if (data_sent < TOTAL_PACKETS && SPEED == test) |
565 | { | 579 | { |
566 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Scheduling message %d\n", | 580 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " Scheduling message %d\n", |
@@ -751,7 +765,8 @@ incoming_channel (void *cls, struct GNUNET_CADET_Channel *channel, | |||
751 | { | 765 | { |
752 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 766 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
753 | "Incoming channel from %s to peer %d\n", | 767 | "Incoming channel from %s to peer %d\n", |
754 | GNUNET_i2s (initiator), (long) cls); | 768 | GNUNET_i2s (initiator), |
769 | (int) (long) cls); | ||
755 | ok++; | 770 | ok++; |
756 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); | 771 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); |
757 | if ((long) cls == peers_requested - 1) | 772 | if ((long) cls == peers_requested - 1) |
@@ -807,7 +822,8 @@ channel_cleaner (void *cls, const struct GNUNET_CADET_Channel *channel, | |||
807 | } | 822 | } |
808 | else | 823 | else |
809 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 824 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
810 | "Unknown peer! %d\n", i); | 825 | "Unknown peer! %d\n", |
826 | (int) i); | ||
811 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); | 827 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, " ok: %d\n", ok); |
812 | 828 | ||
813 | if (NULL != disconnect_task) | 829 | if (NULL != disconnect_task) |