From 6e599264ad13e8fc105493d74d7c11d46f8739ed Mon Sep 17 00:00:00 2001 From: ng0 Date: Fri, 6 Sep 2019 22:46:29 +0000 Subject: first step to remove plibc --- src/fragmentation/test_fragmentation.c | 24 ++++++++++++------------ src/fragmentation/test_fragmentation_parallel.c | 18 +++++++++--------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'src/fragmentation') diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c index 0bf3b2ab1..a49f6d71a 100644 --- a/src/fragmentation/test_fragmentation.c +++ b/src/fragmentation/test_fragmentation.c @@ -98,7 +98,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) const char *buf; #if DETAILS - FPRINTF (stderr, "%s", "M! "); /* message complete, good! */ + fprintf (stderr, "%s", "M! "); /* message complete, good! */ #endif buf = (const char *) hdr; for (i = sizeof (struct GNUNET_MessageHeader); i < ntohs (hdr->size); i++) @@ -106,7 +106,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) total++; #if ! DETAILS if (0 == (total % (NUM_MSGS / 100))) - FPRINTF (stderr, "%s", "."); + fprintf (stderr, "%s", "."); #endif /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) @@ -131,27 +131,27 @@ proc_frac (void *cls, const struct GNUNET_MessageHeader *hdr) { frag_drops++; #if DETAILS - FPRINTF (stderr, "%s", "DF "); /* dropped Frag */ + fprintf (stderr, "%s", "DF "); /* dropped Frag */ #endif return; /* random drop */ } if (NULL == defrag) { - FPRINTF (stderr, "%s", "?E "); /* Error: frag after shutdown!? */ + fprintf (stderr, "%s", "?E "); /* Error: frag after shutdown!? */ return; } ret = GNUNET_DEFRAGMENT_process_fragment (defrag, hdr); if (ret == GNUNET_NO) { #if DETAILS - FPRINTF (stderr, "%s", "FF "); /* duplicate fragment */ + fprintf (stderr, "%s", "FF "); /* duplicate fragment */ #endif dups++; } else if (ret == GNUNET_OK) { #if DETAILS - FPRINTF (stderr, "%s", "F! "); /* good fragment */ + fprintf (stderr, "%s", "F! "); /* good fragment */ #endif fragc++; } @@ -181,7 +181,7 @@ next_transmission () if (i == NUM_MSGS) return; #if DETAILS - FPRINTF (stderr, "%s", "T! "); /* sending message */ + fprintf (stderr, "%s", "T! "); /* sending message */ #endif msg = (struct GNUNET_MessageHeader *) buf; msg->type = htons ((uint16_t) i); @@ -212,7 +212,7 @@ proc_acks (void *cls, { ack_drops++; #if DETAILS - FPRINTF (stderr, "%s", "DA "); /* dropped ACK */ + fprintf (stderr, "%s", "DA "); /* dropped ACK */ #endif return; /* random drop */ } @@ -224,7 +224,7 @@ proc_acks (void *cls, if (ret == GNUNET_OK) { #if DETAILS - FPRINTF (stderr, "%s", "GA "); /* good ACK */ + fprintf (stderr, "%s", "GA "); /* good ACK */ #endif next_transmission (); acks++; @@ -233,14 +233,14 @@ proc_acks (void *cls, if (ret == GNUNET_NO) { #if DETAILS - FPRINTF (stderr, "%s", "AA "); /* duplciate ACK */ + fprintf (stderr, "%s", "AA "); /* duplciate ACK */ #endif acks++; return; } } #if DETAILS - FPRINTF (stderr, "%s", "?A "); /* BAD: ack that nobody feels responsible for... */ + fprintf (stderr, "%s", "?A "); /* BAD: ack that nobody feels responsible for... */ #endif } @@ -293,7 +293,7 @@ main (int argc, char *argv[]) "test-fragmentation", "nohelp", options, &run, NULL); - FPRINTF (stderr, + fprintf (stderr, "\nHad %u good fragments, %u duplicate fragments, %u acks and %u simulated drops of acks\n", fragc, dups, diff --git a/src/fragmentation/test_fragmentation_parallel.c b/src/fragmentation/test_fragmentation_parallel.c index 5cde75c0b..d8e598484 100644 --- a/src/fragmentation/test_fragmentation_parallel.c +++ b/src/fragmentation/test_fragmentation_parallel.c @@ -90,7 +90,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) const char *buf; #if DETAILS - FPRINTF (stderr, "%s", "!"); /* message complete, good! */ + fprintf (stderr, "%s", "!"); /* message complete, good! */ #endif buf = (const char *) hdr; for (i = sizeof (struct GNUNET_MessageHeader); i < ntohs (hdr->size); i++) @@ -98,7 +98,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) total++; #if ! DETAILS if (0 == (total % (NUM_MSGS / 100))) - FPRINTF (stderr, "%s", "."); + fprintf (stderr, "%s", "."); #endif /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) @@ -131,7 +131,7 @@ proc_acks (void *cls, uint32_t msg_id, const struct GNUNET_MessageHeader *hdr) if (ret == GNUNET_OK) { #if DETAILS - FPRINTF (stderr, "%s", "@"); /* good ACK */ + fprintf (stderr, "%s", "@"); /* good ACK */ #endif GNUNET_FRAGMENT_context_destroy (frags[i], NULL, NULL); frags[i] = NULL; @@ -141,14 +141,14 @@ proc_acks (void *cls, uint32_t msg_id, const struct GNUNET_MessageHeader *hdr) if (ret == GNUNET_NO) { #if DETAILS - FPRINTF (stderr, "%s", "@"); /* good ACK */ + fprintf (stderr, "%s", "@"); /* good ACK */ #endif acks++; return; } } #if DETAILS - FPRINTF (stderr, "%s", "_"); /* BAD: ack that nobody feels responsible for... */ + fprintf (stderr, "%s", "_"); /* BAD: ack that nobody feels responsible for... */ #endif } @@ -170,21 +170,21 @@ proc_frac (void *cls, const struct GNUNET_MessageHeader *hdr) } if (NULL == defrag) { - FPRINTF (stderr, "%s", "E"); /* Error: frag after shutdown!? */ + fprintf (stderr, "%s", "E"); /* Error: frag after shutdown!? */ return; } ret = GNUNET_DEFRAGMENT_process_fragment (defrag, hdr); if (ret == GNUNET_NO) { #if DETAILS - FPRINTF (stderr, "%s", "?"); /* duplicate fragment */ + fprintf (stderr, "%s", "?"); /* duplicate fragment */ #endif dups++; } else if (ret == GNUNET_OK) { #if DETAILS - FPRINTF (stderr, "%s", "."); /* good fragment */ + fprintf (stderr, "%s", "."); /* good fragment */ #endif fragc++; } @@ -247,7 +247,7 @@ main (int argc, char *argv[]) 100); GNUNET_PROGRAM_run (5, argv_prog, "test-fragmentation", "nohelp", options, &run, NULL); - FPRINTF (stderr, + fprintf (stderr, "\nHad %u good fragments, %u duplicate fragments, %u acks and %u simulated drops of acks\n", fragc, dups, acks, ack_drops); return ret; -- cgit v1.2.3