From 416c2f5a713b93ba689a8cd1e038682a53e6bc17 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 30 Dec 2011 22:42:04 +0000 Subject: -LRN: use FPRINTF -- #2051 --- src/arm/gnunet-arm.c | 22 ++++---- src/arm/test_exponential_backoff.c | 8 +-- src/arm/test_gnunet_service_manager.c | 6 +- src/ats-test/test_transport_ats_multiple_peers.c | 16 +++--- src/block/test_block.c | 2 +- src/chat/gnunet-chat.c | 46 ++++++++-------- src/core/gnunet-core-list-connections.c | 8 +-- src/core/test_core_api.c | 2 +- src/core/test_core_api_reliability.c | 4 +- src/core/test_core_api_start_only.c | 4 +- src/core/test_core_quota_compliance.c | 4 +- src/datacache/perf_datacache.c | 17 +++--- src/datacache/test_datacache.c | 6 +- src/datacache/test_datacache_quota.c | 13 ++--- src/datastore/perf_datastore_api.c | 10 ++-- src/datastore/perf_plugin_datastore.c | 14 ++--- src/datastore/test_datastore_api.c | 12 ++-- src/datastore/test_datastore_api_management.c | 6 +- src/datastore/test_plugin_datastore.c | 16 +++--- src/dht/gnunet-dht-get.c | 10 ++-- src/dht/gnunet-dht-put.c | 10 ++-- src/dht/test_dht_api.c | 4 +- src/dht/test_dht_multipeer.c | 36 ++++++------ src/dht/test_dht_twopeer.c | 12 ++-- src/dht/test_dht_twopeer_path_tracking.c | 12 ++-- src/dv/test_transport_api_dv.c | 16 +++--- src/fragmentation/test_fragmentation.c | 18 +++--- src/fs/gnunet-directory.c | 2 +- src/fs/gnunet-download.c | 20 +++---- src/fs/gnunet-fs.c | 4 +- src/fs/gnunet-pseudonym.c | 14 ++--- src/fs/gnunet-publish.c | 44 +++++++-------- src/fs/gnunet-search.c | 12 ++-- src/fs/gnunet-unindex.c | 12 ++-- src/fs/perf_gnunet_service_fs_p2p.c | 4 +- src/fs/perf_gnunet_service_fs_p2p_trust.c | 4 +- src/fs/test_fs_directory.c | 4 +- src/fs/test_fs_download.c | 4 +- src/fs/test_fs_download_indexed.c | 4 +- src/fs/test_fs_download_persistence.c | 4 +- src/fs/test_fs_download_recursive.c | 14 ++--- src/fs/test_fs_file_information.c | 4 +- src/fs/test_fs_getopt.c | 2 +- src/fs/test_fs_list_indexed.c | 2 +- src/fs/test_fs_namespace.c | 22 ++++---- src/fs/test_fs_publish.c | 4 +- src/fs/test_fs_publish_persistence.c | 2 +- src/fs/test_fs_search.c | 6 +- src/fs/test_fs_search_persistence.c | 6 +- src/fs/test_fs_search_ranking.c | 2 +- src/fs/test_fs_unindex.c | 4 +- src/fs/test_fs_unindex_persistence.c | 4 +- src/fs/test_fs_uri.c | 6 +- src/fs/test_gnunet_service_fs_migration.c | 4 +- src/fs/test_gnunet_service_fs_p2p.c | 2 +- src/hello/test_hello.c | 26 ++++----- .../test_gnunet_daemon_hostlist_reconnect.c | 6 +- src/mesh/mesh_tunnel_tree.c | 16 +++--- src/nat/gnunet-nat-server.c | 2 +- src/nse/gnunet-nse-profiler.c | 4 +- src/nse/test_nse_api.c | 4 +- src/nse/test_nse_multipeer.c | 6 +- src/peerinfo-tool/gnunet-peerinfo.c | 10 ++-- src/peerinfo/perf_peerinfo_api.c | 8 +-- src/statistics/gnunet-statistics.c | 2 +- src/testing/test_testing_large_topology.c | 62 ++++++++++----------- src/testing/test_testing_reconnect.c | 8 +-- src/testing/test_testing_topology.c | 64 +++++++++++----------- src/testing/test_testing_topology_blacklist.c | 8 +-- src/testing/testing_group.c | 16 +++--- src/testing/testing_peergroup.c | 8 +-- src/topology/test_gnunet_daemon_topology.c | 2 +- .../gnunet-transport-connect-running-peers.c | 4 +- src/transport/gnunet-transport.c | 28 +++++----- src/transport/test_quota_compliance.c | 10 ++-- src/transport/test_transport_api.c | 2 +- .../test_transport_api_bidirectional_connect.c | 2 +- src/transport/test_transport_api_disconnect.c | 2 +- src/transport/test_transport_api_limited_sockets.c | 2 +- src/transport/test_transport_api_reliability.c | 8 +-- src/transport/test_transport_api_restart_1peer.c | 2 +- src/transport/test_transport_api_restart_2peers.c | 2 +- src/transport/test_transport_api_timeout.c | 6 +- src/transport/test_transport_api_unreliability.c | 8 +-- .../test_transport_api_unreliability_constant.c | 10 ++-- src/transport/test_transport_startonly.c | 6 +- src/util/common_logging.c | 2 +- src/util/configuration.c | 6 +- src/util/crypto_random.c | 2 +- src/util/getopt.c | 28 +++++----- src/util/getopt_helpers.c | 4 +- src/util/plugin.c | 2 +- src/util/test_common_allocation.c | 2 +- src/util/test_common_logging.c | 8 +-- src/util/test_common_logging_dummy.c | 2 +- src/util/test_common_logging_runtime_loglevels.c | 6 +- src/util/test_configuration.c | 12 ++-- src/util/test_crypto_aes_weak.c | 2 +- src/util/test_crypto_ksk.c | 30 +++++----- src/util/test_crypto_random.c | 2 +- src/util/test_crypto_rsa.c | 34 ++++++------ src/util/test_disk.c | 10 ++-- src/util/test_os_start_process.c | 4 +- src/util/test_peer.c | 4 +- src/util/test_resolver_api.c | 6 +- src/util/test_scheduler_delay.c | 12 ++-- src/util/test_service.c | 2 +- src/util/test_strings.c | 2 +- 108 files changed, 537 insertions(+), 539 deletions(-) (limited to 'src') diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index 13b1fdc17..65700ee11 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c @@ -146,47 +146,47 @@ confirm_cb (void *cls, switch (result) { case GNUNET_ARM_PROCESS_UNKNOWN: - fprintf (stderr, _("Service `%s' is unknown to ARM.\n"), service); + FPRINTF (stderr, _("Service `%s' is unknown to ARM.\n"), service); ret = 1; break; case GNUNET_ARM_PROCESS_DOWN: if (quiet != GNUNET_YES) - fprintf (stdout, _("Service `%s' has been stopped.\n"), service); + FPRINTF (stdout, _("Service `%s' has been stopped.\n"), service); break; case GNUNET_ARM_PROCESS_ALREADY_RUNNING: - fprintf (stderr, _("Service `%s' was already running.\n"), service); + FPRINTF (stderr, _("Service `%s' was already running.\n"), service); ret = 1; break; case GNUNET_ARM_PROCESS_STARTING: if (quiet != GNUNET_YES) - fprintf (stdout, _("Service `%s' has been started.\n"), service); + FPRINTF (stdout, _("Service `%s' has been started.\n"), service); break; case GNUNET_ARM_PROCESS_ALREADY_STOPPING: - fprintf (stderr, _("Service `%s' was already being stopped.\n"), service); + FPRINTF (stderr, _("Service `%s' was already being stopped.\n"), service); ret = 1; break; case GNUNET_ARM_PROCESS_ALREADY_DOWN: - fprintf (stderr, _("Service `%s' was already not running.\n"), service); + FPRINTF (stderr, _("Service `%s' was already not running.\n"), service); ret = 1; break; case GNUNET_ARM_PROCESS_SHUTDOWN: - fprintf (stderr, _("Request ignored as ARM is shutting down.\n")); + FPRINTF (stderr, "%s", _("Request ignored as ARM is shutting down.\n")); ret = 1; break; case GNUNET_ARM_PROCESS_COMMUNICATION_ERROR: - fprintf (stderr, _("Error communicating with ARM service.\n")); + FPRINTF (stderr, "%s", _("Error communicating with ARM service.\n")); ret = 1; break; case GNUNET_ARM_PROCESS_COMMUNICATION_TIMEOUT: - fprintf (stderr, _("Timeout communicating with ARM service.\n")); + FPRINTF (stderr, "%s", _("Timeout communicating with ARM service.\n")); ret = 1; break; case GNUNET_ARM_PROCESS_FAILURE: - fprintf (stderr, _("Operation failed.\n")); + FPRINTF (stderr, "%s", _("Operation failed.\n")); ret = 1; break; default: - fprintf (stderr, _("Unknown response code from ARM.\n")); + FPRINTF (stderr, "%s", _("Unknown response code from ARM.\n")); break; } GNUNET_SCHEDULER_add_continuation (&cps_loop, NULL, diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index 029ed145a..df0efb7f5 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c @@ -303,15 +303,15 @@ do_nothing_restarted_notify_task (void *cls, #if LOG_BACKOFF if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0) { - fprintf (killLogFilePtr, "%d.Reason is shutdown!\n", trialCount); + FPRINTF (killLogFilePtr, "%d.Reason is shutdown!\n", trialCount); } else if ((tc->reason & GNUNET_SCHEDULER_REASON_TIMEOUT) != 0) { - fprintf (killLogFilePtr, "%d.Reason is timeout!\n", trialCount); + FPRINTF (killLogFilePtr, "%d.Reason is timeout!\n", trialCount); } else if ((tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE) != 0) { - fprintf (killLogFilePtr, "%d.Service is running!\n", trialCount); + FPRINTF (killLogFilePtr, "%d.Service is running!\n", trialCount); } #endif GNUNET_SCHEDULER_add_now (&kill_task, &a); @@ -345,7 +345,7 @@ kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc) waitedFor = GNUNET_TIME_absolute_get_duration (startedWaitingAt); #if LOG_BACKOFF - fprintf (killLogFilePtr, "Waited for: %llu ms\n", + FPRINTF (killLogFilePtr, "Waited for: %llu ms\n", (unsigned long long) waitedFor.rel_value); #endif } diff --git a/src/arm/test_gnunet_service_manager.c b/src/arm/test_gnunet_service_manager.c index 2be86e79f..dd12bbd31 100644 --- a/src/arm/test_gnunet_service_manager.c +++ b/src/arm/test_gnunet_service_manager.c @@ -161,13 +161,13 @@ main (int argc, char *argv[]) { GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK, "gethostname"); - fprintf (stderr, - "Failed to determine my own hostname, testcase not run.\n"); + FPRINTF (stderr, + "Failed to determine my own hostname, testcase not run.\n", NULL); return 0; } if (NULL == gethostbyname (hostname)) { - fprintf (stderr, + FPRINTF (stderr, "Failed to resolve my hostname `%s', testcase not run.\n", hostname); return 0; diff --git a/src/ats-test/test_transport_ats_multiple_peers.c b/src/ats-test/test_transport_ats_multiple_peers.c index e9d0baf25..7425ff45d 100644 --- a/src/ats-test/test_transport_ats_multiple_peers.c +++ b/src/ats-test/test_transport_ats_multiple_peers.c @@ -225,7 +225,7 @@ evaluate_measurements () stddev[0] /= c_new; stddev[0] = sqrt (stddev[0]); if (!machine_parsable) - fprintf (stderr, "new, %i measurements, average: %f stddev: %f\n", c_new, + FPRINTF (stderr, "new, %i measurements, average: %f stddev: %f\n", c_new, average[0], stddev[0]); average[1] = 0.0; @@ -245,7 +245,7 @@ evaluate_measurements () stddev[1] /= c_modified; stddev[1] = sqrt (stddev[1]); if (!machine_parsable) - fprintf (stderr, "modified, %i measurements, average: %f stddev: %f\n", + FPRINTF (stderr, "modified, %i measurements, average: %f stddev: %f\n", c_modified, average[1], stddev[1]); average[2] = 0.0; @@ -265,11 +265,11 @@ evaluate_measurements () stddev[2] = sqrt (stddev[2]); if (!machine_parsable) - fprintf (stderr, "unmodified, %i measurements, average: %f stddev: %f\n", + FPRINTF (stderr, "unmodified, %i measurements, average: %f stddev: %f\n", c_unmodified, average[2], stddev[2]); if (machine_parsable) - fprintf (stderr, + FPRINTF (stderr, "peers,%i,mechs,%llu," "new,%i,%f,%f," "mod,%i,%f,%f," "unmod,%i,%f,%f\n", peers - 1, (unsigned long long) results_unmodified[0].mechs, c_new, @@ -337,7 +337,7 @@ stats_cb (void *cls, const char *subsystem, const char *name, uint64_t value, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All %llu peers connected\n", value); #if !VERBOSE if (!machine_parsable) - fprintf (stderr, "%i", count); + FPRINTF (stderr, "%i", count); #endif } @@ -395,7 +395,7 @@ stats_cb (void *cls, const char *subsystem, const char *name, uint64_t value, } count++; #if VERBOSE - fprintf (stderr, "(new: %i / modified: %i / unmodified: %i) of %i \n", + FPRINTF (stderr, "(new: %i / modified: %i / unmodified: %i) of %i \n", c_new, c_modified, c_unmodified, MEASUREMENTS); #endif if ((c_modified >= MEASUREMENTS) && (c_new >= MEASUREMENTS) && @@ -403,7 +403,7 @@ stats_cb (void *cls, const char *subsystem, const char *name, uint64_t value, { #if !VERBOSE if (!machine_parsable) - fprintf (stdout, "\n"); + FPRINTF (stdout, "\n"); #endif if (stats_task != GNUNET_SCHEDULER_NO_TASK) { @@ -418,7 +418,7 @@ stats_cb (void *cls, const char *subsystem, const char *name, uint64_t value, current.timestamp = value; #if !VERBOSE if (!machine_parsable) - fprintf (stderr, "..%i", count); + FPRINTF (stderr, "..%i", count); #endif return GNUNET_OK; } diff --git a/src/block/test_block.c b/src/block/test_block.c index d1d3edb96..927029ed8 100644 --- a/src/block/test_block.c +++ b/src/block/test_block.c @@ -72,6 +72,6 @@ main (int argc, char *argv[]) GNUNET_BLOCK_context_destroy (ctx); GNUNET_CONFIGURATION_destroy (cfg); if (ret != 0) - fprintf (stderr, "Tests failed: %d\n", ret); + FPRINTF (stderr, "Tests failed: %d\n", ret); return ret; } diff --git a/src/chat/gnunet-chat.c b/src/chat/gnunet-chat.c index 53884a299..af4eb53f3 100644 --- a/src/chat/gnunet-chat.c +++ b/src/chat/gnunet-chat.c @@ -89,7 +89,7 @@ do_help (const char *args, const void *xtra); static int join_cb (void *cls) { - fprintf (stdout, _("Joined\n")); + FPRINTF (stdout, "%s", _("Joined\n")); return GNUNET_OK; } @@ -163,7 +163,7 @@ receive_cb (void *cls, struct GNUNET_CHAT_Room *room, break; } time = GNUNET_STRINGS_absolute_time_to_string (timestamp); - fprintf (stdout, fmt, time, nick, message); + FPRINTF (stdout, fmt, time, nick, message); GNUNET_free (nick); GNUNET_free (time); return GNUNET_OK; @@ -190,7 +190,7 @@ confirmation_cb (void *cls, struct GNUNET_CHAT_Room *room, char *nick; nick = GNUNET_PSEUDONYM_id_to_name (cfg, receiver); - fprintf (stdout, _("'%s' acknowledged message #%d\n"), nick, orig_seq_number); + FPRINTF (stdout, _("'%s' acknowledged message #%d\n"), nick, orig_seq_number); return GNUNET_OK; } @@ -219,7 +219,7 @@ member_list_cb (void *cls, const struct GNUNET_CONTAINER_MetaData *member_info, sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &id); nick = GNUNET_PSEUDONYM_id_to_name (cfg, &id); - fprintf (stdout, + FPRINTF (stdout, member_info != NULL ? _("`%s' entered the room\n") : _("`%s' left the room\n"), nick); @@ -281,11 +281,11 @@ do_join (const char *arg, const void *xtra) &confirmation_cb, NULL, &me); if (NULL == room) { - fprintf (stdout, _("Could not change username\n")); + FPRINTF (stdout, "%s", _("Could not change username\n")); return GNUNET_SYSERR; } my_name = GNUNET_PSEUDONYM_id_to_name (cfg, &me); - fprintf (stdout, _("Joining room `%s' as user `%s'...\n"), room_name, + FPRINTF (stdout, _("Joining room `%s' as user `%s'...\n"), room_name, my_name); GNUNET_free (my_name); return GNUNET_OK; @@ -313,11 +313,11 @@ do_nick (const char *msg, const void *xtra) &confirmation_cb, NULL, &me); if (NULL == room) { - fprintf (stdout, _("Could not change username\n")); + FPRINTF (stdout, "%s", _("Could not change username\n")); return GNUNET_SYSERR; } my_name = GNUNET_PSEUDONYM_id_to_name (cfg, &me); - fprintf (stdout, _("Changed username to `%s'\n"), my_name); + FPRINTF (stdout, _("Changed username to `%s'\n"), my_name); GNUNET_free (my_name); return GNUNET_OK; } @@ -330,7 +330,7 @@ do_names (const char *msg, const void *xtra) struct UserList *pos; GNUNET_HashCode pid; - fprintf (stdout, _("Users in room `%s': "), room_name); + FPRINTF (stdout, _("Users in room `%s': "), room_name); pos = users; while (NULL != pos) { @@ -338,11 +338,11 @@ do_names (const char *msg, const void *xtra) sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded), &pid); name = GNUNET_PSEUDONYM_id_to_name (cfg, &pid); - fprintf (stdout, "`%s' ", name); + FPRINTF (stdout, "`%s' ", name); GNUNET_free (name); pos = pos->next; } - fprintf (stdout, "\n"); + FPRINTF (stdout, "%s", "\n"); return GNUNET_OK; } @@ -368,7 +368,7 @@ do_send_pm (const char *msg, const void *xtra) if (NULL == strstr (msg, " ")) { - fprintf (stderr, _("Syntax: /msg USERNAME MESSAGE")); + FPRINTF (stderr, "%s", _("Syntax: /msg USERNAME MESSAGE")); return GNUNET_OK; } user = GNUNET_strdup (msg); @@ -376,7 +376,7 @@ do_send_pm (const char *msg, const void *xtra) msg += strlen (user) + 1; if (GNUNET_OK != GNUNET_PSEUDONYM_name_to_id (cfg, user, &uid)) { - fprintf (stderr, _("Unknown user `%s'\n"), user); + FPRINTF (stderr, _("Unknown user `%s'\n"), user); GNUNET_free (user); return GNUNET_OK; } @@ -392,7 +392,7 @@ do_send_pm (const char *msg, const void *xtra) } if (NULL == pos) { - fprintf (stderr, _("User `%s' is currently not in the room!\n"), user); + FPRINTF (stderr, _("User `%s' is currently not in the room!\n"), user); GNUNET_free (user); return GNUNET_OK; } @@ -445,7 +445,7 @@ do_quit (const char *args, const void *xtra) static int do_unknown (const char *msg, const void *xtra) { - fprintf (stderr, _("Unknown command `%s'\n"), msg); + FPRINTF (stderr, _("Unknown command `%s'\n"), msg); return GNUNET_OK; } @@ -510,20 +510,20 @@ do_help (const char *args, const void *xtra) { if (0 == strncasecmp (&args[1], &commands[i].command[1], strlen (args) - 1)) { - fprintf (stdout, "%s\n", gettext (commands[i].helptext)); + FPRINTF (stdout, "%s\n", gettext (commands[i].helptext)); return GNUNET_OK; } i++; } i = 0; - fprintf (stdout, "Available commands:"); + FPRINTF (stdout, "%s", "Available commands:"); while (commands[i].Action != &do_help) { - fprintf (stdout, " %s", gettext (commands[i].command)); + FPRINTF (stdout, " %s", gettext (commands[i].command)); i++; } - fprintf (stdout, "\n"); - fprintf (stdout, "%s\n", gettext (commands[i].helptext)); + FPRINTF (stdout, "%s", "\n"); + FPRINTF (stdout, "%s\n", gettext (commands[i].helptext)); return GNUNET_OK; } @@ -602,7 +602,7 @@ run (void *cls, char *const *args, const char *cfgfile, /* check arguments */ if (NULL == nickname) { - fprintf (stderr, _("You must specify a nickname\n")); + FPRINTF (stderr, "%s", _("You must specify a nickname\n")); ret = -1; return; } @@ -618,7 +618,7 @@ run (void *cls, char *const *args, const char *cfgfile, &confirmation_cb, NULL, &me); if (NULL == room) { - fprintf (stderr, _("Failed to join room `%s'\n"), room_name); + FPRINTF (stderr, _("Failed to join room `%s'\n"), room_name); GNUNET_free (room_name); GNUNET_free (nickname); GNUNET_CONTAINER_meta_data_destroy (meta); @@ -626,7 +626,7 @@ run (void *cls, char *const *args, const char *cfgfile, return; } my_name = GNUNET_PSEUDONYM_id_to_name (cfg, &me); - fprintf (stdout, _("Joining room `%s' as user `%s'...\n"), room_name, + FPRINTF (stdout, _("Joining room `%s' as user `%s'...\n"), room_name, my_name); GNUNET_free (my_name); handle_cmd_task = diff --git a/src/core/gnunet-core-list-connections.c b/src/core/gnunet-core-list-connections.c index c93f50981..fcd076564 100644 --- a/src/core/gnunet-core-list-connections.c +++ b/src/core/gnunet-core-list-connections.c @@ -115,7 +115,7 @@ process_resolved_address (void *cls, const struct GNUNET_PeerIdentity *peer, /* * new_address = GNUNET_malloc (sizeof (struct AddressStringList)); * #if VERBOSE - * fprintf (stderr, "Received address %s\n", address); + * FPRINTF (stderr, "Received address %s\n", address); * #endif * * new_address->address_string = GNUNET_strdup ("FIXME"); @@ -138,7 +138,7 @@ connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer, if (peer != NULL) /* Not yet finished */ { #if VERBOSE - fprintf (stderr, "Learned about peer %s\n", GNUNET_i2s (peer)); + FPRINTF (stderr, "Learned about peer %s\n", GNUNET_i2s (peer)); peer_count++; #endif pc = GNUNET_malloc (sizeof (struct PrintContext)); @@ -150,7 +150,7 @@ connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer, #if VERBOSE else { - fprintf (stderr, "Counted %u total connected peers.\n", peer_count); + FPRINTF (stderr, "Counted %u total connected peers.\n", peer_count); } #endif } @@ -172,7 +172,7 @@ run (void *cls, char *const *args, const char *cfgfile, cfg = c; if (args[0] != NULL) { - fprintf (stderr, _("Invalid command line argument `%s'\n"), args[0]); + FPRINTF (stderr, _("Invalid command line argument `%s'\n"), args[0]); return; } diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c index e63fc9f9d..df29d52a1 100644 --- a/src/core/test_core_api.c +++ b/src/core/test_core_api.c @@ -112,7 +112,7 @@ static void terminate_task_error (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { #if VERBOSE - fprintf (stderr, "ENDING ANGRILY %u\n", ok); + FPRINTF (stderr, "ENDING ANGRILY %u\n", ok); #endif GNUNET_break (0); if (NULL != p1.ch) diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index b2079ba35..434886d42 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -134,7 +134,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_TRANSPORT_disconnect (p2.th); p2.th = NULL; delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value; - fprintf (stderr, "\nThroughput was %llu kb/s\n", + FPRINTF (stderr, "\nThroughput was %llu kb/s\n", total_bytes * 1000 / 1024 / delta); GAUGER ("CORE", "Core throughput/s", total_bytes * 1000 / 1024 / delta, "kb/s"); @@ -353,7 +353,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, #endif n++; if (0 == (n % (TOTAL_MSGS / 100))) - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (n == TOTAL_MSGS) { GNUNET_SCHEDULER_cancel (err_task); diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c index b06b97899..75ba73ce3 100644 --- a/src/core/test_core_api_start_only.c +++ b/src/core/test_core_api_start_only.c @@ -58,7 +58,7 @@ static GNUNET_SCHEDULER_TaskIdentifier timeout_task_id; static int ok; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif @@ -162,7 +162,7 @@ setup_peer (struct PeerContext *p, const char *cfgname) static void timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - fprintf (stderr, "Timeout.\n"); + FPRINTF (stderr, "%s", "Timeout.\n"); if (p1.ch != NULL) { GNUNET_CORE_disconnect (p1.ch); diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index adfa93f1f..c45863f0d 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -227,7 +227,7 @@ measurement_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) enum GNUNET_ErrorType kind = GNUNET_ERROR_TYPE_DEBUG; measure_task = GNUNET_SCHEDULER_NO_TASK; - fprintf (stdout, "\n"); + FPRINTF (stdout, "%s", "\n"); running = GNUNET_NO; delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value; @@ -498,7 +498,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, #endif n++; if (0 == (n % 10)) - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (running == GNUNET_YES) diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c index 6fc0a7217..0f4fea419 100644 --- a/src/datacache/perf_datacache.c +++ b/src/datacache/perf_datacache.c @@ -71,8 +71,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (h == NULL) { - fprintf (stderr, - "Failed to initialize datacache. Database likely not setup, skipping test.\n"); + FPRINTF (stderr, "%s", "Failed to initialize datacache. Database likely not setup, skipping test.\n"); return; } exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS); @@ -81,15 +80,15 @@ run (void *cls, char *const *args, const char *cfgfile, for (i = 0; i < ITERATIONS; i++) { if (0 == i % (ITERATIONS / 80)) - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n); ASSERT (GNUNET_OK == GNUNET_DATACACHE_put (h, &k, sizeof (GNUNET_HashCode), (const char *) &n, 1 + i % 16, exp)); k = n; } - fprintf (stderr, "\n"); - fprintf (stdout, "Stored %u items in %llums\n", ITERATIONS, + FPRINTF (stderr, "%s", "\n"); + FPRINTF (stdout, "Stored %u items in %llums\n", ITERATIONS, (unsigned long long) GNUNET_TIME_absolute_get_duration (start).rel_value); GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name); @@ -101,13 +100,13 @@ run (void *cls, char *const *args, const char *cfgfile, for (i = 0; i < ITERATIONS; i++) { if (0 == i % (ITERATIONS / 80)) - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n); GNUNET_DATACACHE_get (h, &k, 1 + i % 16, &checkIt, &n); k = n; } - fprintf (stderr, "\n"); - fprintf (stdout, + FPRINTF (stderr, "%s", "\n"); + FPRINTF (stdout, "Found %u/%u items in %llums (%u were deleted during storage processing)\n", found, ITERATIONS, (unsigned long long) @@ -169,7 +168,7 @@ main (int argc, char *argv[]) GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv, "perf-datacache", "nohelp", options, &run, NULL); if (ok != 0) - fprintf (stderr, "Missed some perfcases: %d\n", ok); + FPRINTF (stderr, "Missed some perfcases: %d\n", ok); return ok; } diff --git a/src/datacache/test_datacache.c b/src/datacache/test_datacache.c index 6c70807c1..ff3640b6f 100644 --- a/src/datacache/test_datacache.c +++ b/src/datacache/test_datacache.c @@ -71,8 +71,8 @@ run (void *cls, char *const *args, const char *cfgfile, h = GNUNET_DATACACHE_create (cfg, "testcache"); if (h == NULL) { - fprintf (stderr, - "Failed to initialize datacache. Database likely not setup, skipping test.\n"); + FPRINTF (stderr, + "Failed to initialize datacache. Database likely not setup, skipping test.\n", NULL); return; } exp = GNUNET_TIME_absolute_get (); @@ -154,7 +154,7 @@ main (int argc, char *argv[]) GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv, "test-datacache", "nohelp", options, &run, NULL); if (ok != 0) - fprintf (stderr, "Missed some testcases: %d\n", ok); + FPRINTF (stderr, "Missed some testcases: %d\n", ok); return ok; } diff --git a/src/datacache/test_datacache_quota.c b/src/datacache/test_datacache_quota.c index d3681da8e..468972c9e 100644 --- a/src/datacache/test_datacache_quota.c +++ b/src/datacache/test_datacache_quota.c @@ -60,8 +60,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (h == NULL) { - fprintf (stderr, - "Failed to initialize datacache. Database likely not setup, skipping test.\n"); + FPRINTF (stderr, "%s", "Failed to initialize datacache. Database likely not setup, skipping test.\n"); return; } exp = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_HOURS); @@ -69,7 +68,7 @@ run (void *cls, char *const *args, const char *cfgfile, memset (&k, 0, sizeof (GNUNET_HashCode)); for (i = 0; i < 10; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n); for (j = i; j < sizeof (buf); j += 10) { @@ -80,11 +79,11 @@ run (void *cls, char *const *args, const char *cfgfile, } k = n; } - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); memset (&k, 0, sizeof (GNUNET_HashCode)); for (i = 0; i < 10; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); GNUNET_CRYPTO_hash (&k, sizeof (GNUNET_HashCode), &n); if (i < 2) ASSERT (0 == GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL)); @@ -92,7 +91,7 @@ run (void *cls, char *const *args, const char *cfgfile, ASSERT (0 < GNUNET_DATACACHE_get (h, &k, 1 + i, NULL, NULL)); k = n; } - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); GNUNET_DATACACHE_destroy (h); return; FAILURE: @@ -145,7 +144,7 @@ main (int argc, char *argv[]) GNUNET_PROGRAM_run ((sizeof (xargv) / sizeof (char *)) - 1, xargv, "test-datacache-quota", "nohelp", options, &run, NULL); if (ok != 0) - fprintf (stderr, "Missed some testcases: %d\n", ok); + FPRINTF (stderr, "Missed some testcases: %d\n", ok); return ok; } diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index 372a61f7d..106d40684 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c @@ -123,7 +123,7 @@ check_success (void *cls, int success, struct GNUNET_TIME_Absolute min_expiratio return; } #if REPORT_ID - fprintf (stderr, "I"); + FPRINTF (stderr, "%s", "I"); #endif stored_bytes += crc->size; stored_ops++; @@ -166,7 +166,7 @@ remove_next (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, return; } #if REPORT_ID - fprintf (stderr, "D"); + FPRINTF (stderr, "%s", "D"); #endif GNUNET_assert (GNUNET_OK == success); GNUNET_SCHEDULER_add_now (&run_continuation, crc); @@ -284,7 +284,7 @@ run_tests (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, c if (success != GNUNET_YES) { - fprintf (stderr, + FPRINTF (stderr, "Test 'put' operation failed with error `%s' database likely not setup, skipping test.", msg); GNUNET_free (crc); @@ -314,7 +314,7 @@ run (void *cls, char *const *args, const char *cfgfile, (GNUNET_TIME_UNIT_SECONDS), 0, 1, GNUNET_TIME_UNIT_MINUTES, &run_tests, crc)) { - fprintf (stderr, "Test 'put' operation failed.\n"); + FPRINTF (stderr, "%s", "Test 'put' operation failed.\n"); ok = 1; GNUNET_free (crc); } @@ -396,7 +396,7 @@ main (int argc, char *argv[]) if (pos != plugin_name) pos[0] = '.'; #if REPORT_ID - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); #endif GNUNET_DISK_directory_remove (dir_name); return ret; diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 8f552c4eb..6106b11cb 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c @@ -135,7 +135,7 @@ putValue (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), &msg)) { - fprintf (stderr, "ERROR: `%s'\n", msg); + FPRINTF (stderr, "ERROR: `%s'\n", msg); GNUNET_free_non_null (msg); return; } @@ -165,7 +165,7 @@ iterate_zeros (void *cls, const GNUNET_HashCode * key, uint32_t size, hits[i / 8] |= (1 << (i % 8)); #if VERBOSE - fprintf (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n", + FPRINTF (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu\n", type, priority, size, (unsigned long long) expiration.abs_value); #endif crc->cnt++; @@ -344,7 +344,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) crc->phase = RP_ERROR; } #if VERBOSE - fprintf (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt); + FPRINTF (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt); #endif switch (crc->phase) { @@ -422,7 +422,7 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg) GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name); if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env))) { - fprintf (stderr, "Failed to load plugin `%s'!\n", name); + FPRINTF (stderr, "Failed to load plugin `%s'!\n", name); return NULL; } GNUNET_free (libname); @@ -441,8 +441,8 @@ run (void *cls, char *const *args, const char *cfgfile, api = load_plugin (c); if (api == NULL) { - fprintf (stderr, - "Could not initialize plugin, assuming database not configured. Test not run!\n"); + FPRINTF (stderr, + "Could not initialize plugin, assuming database not configured. Test not run!\n", NULL); return; } crc = GNUNET_malloc (sizeof (struct CpsRunContext)); @@ -478,7 +478,7 @@ check () GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, "perf-plugin-datastore", "nohelp", options, &run, NULL); if (ok != 0) - fprintf (stderr, "Missed some testcases: %u\n", ok); + FPRINTF (stderr, "Missed some testcases: %u\n", ok); return ok; } diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index 942e0a11e..df6d3af62 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c @@ -193,10 +193,10 @@ check_value (void *cls, const GNUNET_HashCode * key, size_t size, return; } #if 0 - fprintf (stderr, "Check value got `%s' of size %u, type %d, expire %llu\n", + FPRINTF (stderr, "Check value got `%s' of size %u, type %d, expire %llu\n", GNUNET_h2s (key), (unsigned int) size, type, (unsigned long long) expiration.abs_value); - fprintf (stderr, + FPRINTF (stderr, "Check value iteration %d wants size %u, type %d, expire %llu\n", i, (unsigned int) get_size (i), get_type (i), (unsigned long long) get_expiration (i).abs_value); @@ -461,11 +461,11 @@ run_tests (void *cls, int32_t success, struct GNUNET_TIME_Absolute min_expiratio GNUNET_SCHEDULER_REASON_PREREQ_DONE); return; case GNUNET_NO: - fprintf (stderr, "Test 'put' operation failed, key already exists (!?)\n"); + FPRINTF (stderr, "%s", "Test 'put' operation failed, key already exists (!?)\n"); GNUNET_free (crc); return; case GNUNET_SYSERR: - fprintf (stderr, + FPRINTF (stderr, "Test 'put' operation failed with error `%s' database likely not setup, skipping test.\n", msg); GNUNET_free (crc); @@ -495,7 +495,7 @@ run (void *cls, char *const *args, const char *cfgfile, (GNUNET_TIME_UNIT_SECONDS), 0, 1, GNUNET_TIME_UNIT_MINUTES, &run_tests, crc)) { - fprintf (stderr, "Test 'put' operation failed.\n"); + FPRINTF (stderr, "%s", "Test 'put' operation failed.\n"); ok = 1; GNUNET_free (crc); } @@ -548,7 +548,7 @@ check () proc = NULL; #endif if (ok != 0) - fprintf (stderr, "Missed some testcases: %u\n", ok); + FPRINTF (stderr, "Missed some testcases: %u\n", ok); return ok; } diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c index 3cb8ed94a..20a405d07 100644 --- a/src/datastore/test_datastore_api_management.c +++ b/src/datastore/test_datastore_api_management.c @@ -252,7 +252,7 @@ run_tests (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, c if (success != GNUNET_YES) { - fprintf (stderr, + FPRINTF (stderr, "Test 'put' operation failed with error `%s' database likely not setup, skipping test.", msg); GNUNET_free (crc); @@ -282,7 +282,7 @@ run (void *cls, char *const *args, const char *cfgfile, (GNUNET_TIME_UNIT_SECONDS), 0, 1, GNUNET_TIME_UNIT_MINUTES, &run_tests, crc)) { - fprintf (stderr, "Test 'put' operation failed.\n"); + FPRINTF (stderr, "%s", "Test 'put' operation failed.\n"); GNUNET_free (crc); ok = 1; } @@ -331,7 +331,7 @@ check () GNUNET_OS_process_close (proc); proc = NULL; if (ok != 0) - fprintf (stderr, "Missed some testcases: %u\n", ok); + FPRINTF (stderr, "Missed some testcases: %u\n", ok); return ok; } diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c index 3504945ae..ca894ff33 100644 --- a/src/datastore/test_plugin_datastore.c +++ b/src/datastore/test_plugin_datastore.c @@ -118,7 +118,7 @@ put_value (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) msg = NULL; prio = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 100); #if VERBOSE - fprintf (stderr, "putting type %u, anon %u under key %s\n", i + 1, i, + FPRINTF (stderr, "putting type %u, anon %u under key %s\n", i + 1, i, GNUNET_h2s (&key)); #endif if (GNUNET_OK != api->put (api->cls, &key, size, value, i + 1 /* type */ , @@ -131,7 +131,7 @@ put_value (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, 1000))), &msg)) { - fprintf (stderr, "ERROR: `%s'\n", msg); + FPRINTF (stderr, "ERROR: `%s'\n", msg); GNUNET_free_non_null (msg); return; } @@ -160,7 +160,7 @@ iterate_one_shot (void *cls, const GNUNET_HashCode * key, uint32_t size, guid = uid; crc->phase++; #if VERBOSE - fprintf (stderr, + FPRINTF (stderr, "Found result type=%u, priority=%u, size=%u, expire=%llu, key %s\n", type, priority, size, (unsigned long long) expiration.abs_value, GNUNET_h2s (key)); @@ -230,7 +230,7 @@ test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) crc->phase = RP_ERROR; } #if VERBOSE - fprintf (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt); + FPRINTF (stderr, "In phase %d, iteration %u\n", crc->phase, crc->cnt); #endif switch (crc->phase) { @@ -324,7 +324,7 @@ load_plugin (const struct GNUNET_CONFIGURATION_Handle *cfg) GNUNET_asprintf (&libname, "libgnunet_plugin_datastore_%s", name); if (NULL == (ret = GNUNET_PLUGIN_load (libname, &env))) { - fprintf (stderr, "Failed to load plugin `%s'!\n", name); + FPRINTF (stderr, "Failed to load plugin `%s'!\n", name); return NULL; } GNUNET_free (libname); @@ -343,8 +343,8 @@ run (void *cls, char *const *args, const char *cfgfile, api = load_plugin (c); if (api == NULL) { - fprintf (stderr, - "Could not initialize plugin, assuming database not configured. Test not run!\n"); + FPRINTF (stderr, + "Could not initialize plugin, assuming database not configured. Test not run!\n", NULL); return; } crc = GNUNET_malloc (sizeof (struct CpsRunContext)); @@ -378,7 +378,7 @@ check () GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, "test-plugin-datastore", "nohelp", options, &run, NULL); if (ok != 0) - fprintf (stderr, "Missed some testcases: %u\n", ok); + FPRINTF (stderr, "Missed some testcases: %u\n", ok); return ok; } diff --git a/src/dht/gnunet-dht-get.c b/src/dht/gnunet-dht-get.c index 763ff8e6f..6ad4b30f8 100644 --- a/src/dht/gnunet-dht-get.c +++ b/src/dht/gnunet-dht-get.c @@ -129,7 +129,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, unsigned int put_path_length, enum GNUNET_BLOCK_Type type, size_t size, const void *data) { - fprintf (stdout, "Result %d, type %d:\n%.*s\n", result_count, type, + FPRINTF (stdout, "Result %d, type %d:\n%.*s\n", result_count, type, (unsigned int) size, (char *) data); result_count++; } @@ -155,7 +155,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (query_key == NULL) { if (verbose) - fprintf (stderr, "Must provide key for DHT GET!\n"); + FPRINTF (stderr, "%s", "Must provide key for DHT GET!\n"); ret = 1; return; } @@ -165,12 +165,12 @@ run (void *cls, char *const *args, const char *cfgfile, if (dht_handle == NULL) { if (verbose) - fprintf (stderr, "Couldn't connect to DHT service!\n"); + FPRINTF (stderr, "%s", "Couldn't connect to DHT service!\n"); ret = 1; return; } else if (verbose) - fprintf (stderr, "Connected to DHT service!\n"); + FPRINTF (stderr, "%s", "Connected to DHT service!\n"); if (query_type == GNUNET_BLOCK_TYPE_ANY) /* Type of data not set */ query_type = GNUNET_BLOCK_TYPE_TEST; @@ -182,7 +182,7 @@ run (void *cls, char *const *args, const char *cfgfile, absolute_timeout = GNUNET_TIME_relative_to_absolute (timeout); if (verbose) - fprintf (stderr, "Issuing GET request for %s!\n", query_key); + FPRINTF (stderr, "Issuing GET request for %s!\n", query_key); GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (absolute_timeout), &cleanup_task, NULL); get_handle = diff --git a/src/dht/gnunet-dht-put.c b/src/dht/gnunet-dht-put.c index 079a8866e..ef5ae5ea7 100644 --- a/src/dht/gnunet-dht-put.c +++ b/src/dht/gnunet-dht-put.c @@ -97,7 +97,7 @@ void message_sent_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { if (verbose) - fprintf (stderr, _("PUT request sent!\n")); + FPRINTF (stderr, "%s", _("PUT request sent!\n")); GNUNET_SCHEDULER_add_now (&shutdown_task, NULL); } @@ -121,7 +121,7 @@ run (void *cls, char *const *args, const char *cfgfile, if ((query_key == NULL) || (data == NULL)) { - fprintf (stderr, _("Must provide KEY and DATA for DHT put!\n")); + FPRINTF (stderr, "%s", _("Must provide KEY and DATA for DHT put!\n")); ret = 1; return; } @@ -129,12 +129,12 @@ run (void *cls, char *const *args, const char *cfgfile, dht_handle = GNUNET_DHT_connect (cfg, 1); if (dht_handle == NULL) { - fprintf (stderr, _("Could not connect to %s service!\n"), "DHT"); + FPRINTF (stderr, _("Could not connect to %s service!\n"), "DHT"); ret = 1; return; } else if (verbose) - fprintf (stderr, _("Connected to %s service!\n"), "DHT"); + FPRINTF (stderr, _("Connected to %s service!\n"), "DHT"); if (query_type == GNUNET_BLOCK_TYPE_ANY) /* Type of data not set */ query_type = GNUNET_BLOCK_TYPE_TEST; @@ -149,7 +149,7 @@ run (void *cls, char *const *args, const char *cfgfile, expiration_seconds)); if (verbose) - fprintf (stderr, _("Issuing put request for `%s' with data `%s'!\n"), + FPRINTF (stderr, _("Issuing put request for `%s' with data `%s'!\n"), query_key, data); GNUNET_DHT_put (dht_handle, &key, replication, GNUNET_DHT_RO_NONE, query_type, strlen (data), data, expiration, timeout, &message_sent_cont, diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index e636c08ba..4ec2f2ae9 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c @@ -97,7 +97,7 @@ static int ok; static GNUNET_SCHEDULER_TaskIdentifier die_task; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif @@ -133,7 +133,7 @@ end_badly () { /* do work here */ #if VERBOSE - fprintf (stderr, "Ending on an unhappy note.\n"); + FPRINTF (stderr, "%s", "Ending on an unhappy note.\n"); #endif if ((retry_context.peer_ctx != NULL) && diff --git a/src/dht/test_dht_multipeer.c b/src/dht/test_dht_multipeer.c index 1a4fbaf13..8aba2743d 100644 --- a/src/dht/test_dht_multipeer.c +++ b/src/dht/test_dht_multipeer.c @@ -220,7 +220,7 @@ shutdown_callback (void *cls, const char *emsg) { if (emsg != NULL) { - fprintf (stderr, "Failed to shutdown testing topology: %s\n", emsg); + FPRINTF (stderr, "Failed to shutdown testing topology: %s\n", emsg); if (ok == 0) ok = 2; } @@ -311,7 +311,7 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, struct StatMaster *sm = cls; stats[sm->value].total += value; - fprintf (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, + FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, name, (unsigned long long) value); return GNUNET_OK; } @@ -369,7 +369,7 @@ stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) i = 0; while (stats[i].name != NULL) { - fprintf (stderr, "Total : %12s/%50s = %12llu\n", stats[i].subsystem, + FPRINTF (stderr, "Total : %12s/%50s = %12llu\n", stats[i].subsystem, stats[i].name, (unsigned long long) stats[i].total); i++; } @@ -439,7 +439,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct TestGetContext *test_get; die_task = GNUNET_SCHEDULER_NO_TASK; - fprintf (stderr, "Failing test with error: `%s'!\n", emsg); + FPRINTF (stderr, "Failing test with error: `%s'!\n", emsg); while (NULL != (test_put = all_puts_head)) { if (test_put->task != GNUNET_SCHEDULER_NO_TASK) @@ -484,7 +484,7 @@ get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (test_get->succeeded != GNUNET_YES) { gets_failed++; - fprintf (stderr, "Get from peer %s for key %s failed!\n", + FPRINTF (stderr, "Get from peer %s for key %s failed!\n", GNUNET_i2s (&test_get->daemon->id), GNUNET_h2s (&search_key)); } GNUNET_assert (test_get->get_handle != NULL); @@ -500,7 +500,7 @@ get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if ((gets_failed > 10) && (outstanding_gets == 0)) { /* Had more than 10% failures */ - fprintf (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed, + FPRINTF (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed, gets_failed); GNUNET_SCHEDULER_cancel (die_task); ok = 1; @@ -510,7 +510,7 @@ get_stop_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } if ((gets_completed + gets_failed == num_peers * num_peers) && (outstanding_gets == 0)) /* All gets successful */ { - fprintf (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed, + FPRINTF (stderr, "%llu gets succeeded, %llu gets failed!\n", gets_completed, gets_failed); GNUNET_SCHEDULER_cancel (die_task); ok = 0; @@ -552,19 +552,19 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, { unsigned int i; - fprintf (stderr, "PUT (%u) Path: ", test_get->uid); + FPRINTF (stderr, "PUT (%u) Path: ", test_get->uid); for (i = 0; i < put_path_length; i++) - fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i])); - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i])); + FPRINTF (stderr, "%s", "\n"); } if (get_path != NULL) { unsigned int i; - fprintf (stderr, "GET (%u) Path: ", test_get->uid); + FPRINTF (stderr, "GET (%u) Path: ", test_get->uid); for (i = 0; i < get_path_length; i++) - fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i])); - fprintf (stderr, "%s%s\n", get_path_length > 0 ? "->" : "", + FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i])); + FPRINTF (stderr, "%s%s\n", get_path_length > 0 ? "->" : "", GNUNET_i2s (&test_get->daemon->id)); } #endif @@ -572,7 +572,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, if ((0 != memcmp (&search_key, key, sizeof (GNUNET_HashCode))) || (0 != memcmp (original_data, data, sizeof (original_data)))) { - fprintf (stderr, "Key or data is not the same as was inserted!\n"); + FPRINTF (stderr, "%s", "Key or data is not the same as was inserted!\n"); return; } gets_completed++; @@ -639,7 +639,7 @@ start_gets (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct TestGetContext *test_get; #if VERBOSE - fprintf (stderr, "Issuing %llu GETs\n", + FPRINTF (stderr, "Issuing %llu GETs\n", (unsigned long long) (num_peers * num_peers)); #endif for (i = 0; i < num_peers; i++) @@ -697,7 +697,7 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_assert (test_put->dht_handle != NULL); outstanding_puts++; #if VERBOSE > 2 - fprintf (stderr, "PUT %u at `%s'\n", test_put->uid, + FPRINTF (stderr, "PUT %u at `%s'\n", test_put->uid, GNUNET_i2s (&test_put->daemon->id)); #endif GNUNET_DHT_put (test_put->dht_handle, &key, 1, route_option, @@ -725,7 +725,7 @@ run_dht_test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, "from setup puts/gets"); - fprintf (stderr, "Issuing %llu PUTs (one per peer)\n", + FPRINTF (stderr, "Issuing %llu PUTs (one per peer)\n", (unsigned long long) (num_peers * num_peers)); for (i = 0; i < num_peers * num_peers; i++) { @@ -750,7 +750,7 @@ startup_done (void *cls, const char *emsg) { if (emsg != NULL) { - fprintf (stderr, "Failed to setup topology: %s\n", emsg); + FPRINTF (stderr, "Failed to setup topology: %s\n", emsg); die_task = GNUNET_SCHEDULER_add_now (&end_badly, "topology setup failed"); return; } diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index 04198b48b..2adfda0ef 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c @@ -138,7 +138,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { const char *emsg = cls; - fprintf (stderr, "Error: %s\n", emsg); + FPRINTF (stderr, "Error: %s\n", emsg); if (curr_get_ctx.retry_task != GNUNET_SCHEDULER_NO_TASK) { GNUNET_SCHEDULER_cancel (curr_get_ctx.retry_task); @@ -183,7 +183,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, if (0 != memcmp (&get_context->peer->hashPubKey, key, sizeof (GNUNET_HashCode))) { - fprintf (stderr, "??\n"); + FPRINTF (stderr, "%s", "??\n"); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Key returned is not the same key as was searched for!\n"); GNUNET_SCHEDULER_cancel (die_task); @@ -192,7 +192,7 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, "key mismatch in get response!\n"); return; } - fprintf (stderr, "!\n"); + FPRINTF (stderr, "%s", "!\n"); if (get_context->retry_task != GNUNET_SCHEDULER_NO_TASK) { GNUNET_SCHEDULER_cancel (get_context->retry_task); @@ -234,7 +234,7 @@ get_stop_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) get_context->get_attempts); else { - fprintf (stderr, "?\n"); + FPRINTF (stderr, "%s", "?\n"); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Too many attempts failed, ending test!\n", get_context->get_attempts); @@ -244,7 +244,7 @@ get_stop_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) "GET attempt failed, ending test!\n"); return; } - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); get_context->get_attempts++; get_context->retry_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply @@ -381,7 +381,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, { if (emsg != NULL) { - fprintf (stderr, "Failed to start daemon: `%s'\n", emsg); + FPRINTF (stderr, "Failed to start daemon: `%s'\n", emsg); return; } GNUNET_assert (id != NULL); diff --git a/src/dht/test_dht_twopeer_path_tracking.c b/src/dht/test_dht_twopeer_path_tracking.c index 61a3df0a4..c30a3f327 100644 --- a/src/dht/test_dht_twopeer_path_tracking.c +++ b/src/dht/test_dht_twopeer_path_tracking.c @@ -219,17 +219,17 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, #if VERBOSE if (put_path != NULL) { - fprintf (stderr, "PUT Path: "); + FPRINTF (stderr, "%s", "PUT Path: "); for (i = 0; i < put_path_length; i++) - fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i])); - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&put_path[i])); + FPRINTF (stderr, "%s", "\n"); } if (get_path != NULL) { - fprintf (stderr, "GET Path: "); + FPRINTF (stderr, "%s", "GET Path: "); for (i = 0; i < get_path_length; i++) - fprintf (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i])); - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s%s", i == 0 ? "" : "->", GNUNET_i2s (&get_path[i])); + FPRINTF (stderr, "%s", "\n"); } #endif diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index 2e4962964..435bb2a60 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c @@ -274,8 +274,8 @@ finish_testing (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) #endif if (dotOutFile != NULL) { - fprintf (dotOutFile, "}"); fclose (dotOutFile); + FPRINTF (dotOutFile, "%s", "}"); } ok = 0; @@ -382,7 +382,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (dotOutFile != NULL) { - fprintf (dotOutFile, "}"); + FPRINTF (dotOutFile, "%s", "}"); fclose (dotOutFile); } } @@ -896,18 +896,18 @@ all_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer, if (dotOutFile != NULL) { if (distance == 1) - fprintf (dotOutFile, "\tn%s -- n%s;\n", d->shortname, second_shortname); + FPRINTF (dotOutFile, "\tn%s -- n%s;\n", d->shortname, second_shortname); else if (distance == 2) - fprintf (dotOutFile, "\tn%s -- n%s [color=blue];\n", d->shortname, + FPRINTF (dotOutFile, "\tn%s -- n%s [color=blue];\n", d->shortname, second_shortname); else if (distance == 3) - fprintf (dotOutFile, "\tn%s -- n%s [color=red];\n", d->shortname, + FPRINTF (dotOutFile, "\tn%s -- n%s [color=red];\n", d->shortname, second_shortname); else if (distance == 4) - fprintf (dotOutFile, "\tn%s -- n%s [color=green];\n", d->shortname, + FPRINTF (dotOutFile, "\tn%s -- n%s [color=green];\n", d->shortname, second_shortname); else - fprintf (dotOutFile, "\tn%s -- n%s [color=brown];\n", d->shortname, + FPRINTF (dotOutFile, "\tn%s -- n%s [color=brown];\n", d->shortname, second_shortname); } GNUNET_free (second_shortname); @@ -1067,7 +1067,7 @@ run (void *cls, char *const *args, const char *cfgfile, dotOutFile = fopen (dotOutFileName, "w"); if (dotOutFile != NULL) { - fprintf (dotOutFile, "strict graph G {\n"); + FPRINTF (dotOutFile, "%s", "strict graph G {\n"); } #if VERBOSE diff --git a/src/fragmentation/test_fragmentation.c b/src/fragmentation/test_fragmentation.c index 1f7a1776a..cbfb8efe4 100644 --- a/src/fragmentation/test_fragmentation.c +++ b/src/fragmentation/test_fragmentation.c @@ -91,7 +91,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) const char *buf; #if DETAILS - fprintf (stderr, "!"); /* 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++) @@ -99,7 +99,7 @@ proc_msgs (void *cls, const struct GNUNET_MessageHeader *hdr) total++; #if ! DETAILS if (0 == (total % (NUM_MSGS / 100))) - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); #endif /* tolerate 10% loss, i.e. due to duplicate fragment IDs */ if ((total >= NUM_MSGS - (NUM_MSGS / 10)) && (ret != 0)) @@ -132,7 +132,7 @@ proc_acks (void *cls, uint32_t msg_id, const struct GNUNET_MessageHeader *hdr) if (ret == GNUNET_OK) { #if DETAILS - fprintf (stderr, "@"); /* good ACK */ + FPRINTF (stderr, "%s", "@"); /* good ACK */ #endif GNUNET_FRAGMENT_context_destroy (frags[i]); frags[i] = NULL; @@ -142,14 +142,14 @@ proc_acks (void *cls, uint32_t msg_id, const struct GNUNET_MessageHeader *hdr) if (ret == GNUNET_NO) { #if DETAILS - fprintf (stderr, "@"); /* good ACK */ + FPRINTF (stderr, "%s", "@"); /* good ACK */ #endif acks++; return; } } #if DETAILS - fprintf (stderr, "_"); /* BAD: ack that nobody feels responsible for... */ + FPRINTF (stderr, "%s", "_"); /* BAD: ack that nobody feels responsible for... */ #endif } @@ -171,21 +171,21 @@ proc_frac (void *cls, const struct GNUNET_MessageHeader *hdr) } if (NULL == defrag) { - fprintf (stderr, "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, "?"); /* duplicate fragment */ + FPRINTF (stderr, "%s", "?"); /* duplicate fragment */ #endif dups++; } else if (ret == GNUNET_OK) { #if DETAILS - fprintf (stderr, "."); /* good fragment */ + FPRINTF (stderr, "%s", "."); /* good fragment */ #endif fragc++; } @@ -254,7 +254,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; diff --git a/src/fs/gnunet-directory.c b/src/fs/gnunet-directory.c index f2b99f48d..adb071e8d 100644 --- a/src/fs/gnunet-directory.c +++ b/src/fs/gnunet-directory.c @@ -129,7 +129,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (NULL == args[0]) { - fprintf (stderr, _("You must specify a filename to inspect.")); + FPRINTF (stderr, "%s", _("You must specify a filename to inspect.")); ret = 1; return; } diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index f38805c2b..9e4a8c2f7 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c @@ -97,7 +97,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) { case GNUNET_FS_STATUS_DOWNLOAD_START: if (verbose > 1) - fprintf (stderr, _("Starting download `%s'.\n"), + FPRINTF (stderr, _("Starting download `%s'.\n"), info->value.download.filename); break; case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: @@ -108,7 +108,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) 1000LL / (info->value.download. duration.rel_value + 1)); - fprintf (stdout, + FPRINTF (stdout, _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), info->value.download.filename, (unsigned long long) info->value.download.completed, @@ -118,7 +118,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) } break; case GNUNET_FS_STATUS_DOWNLOAD_ERROR: - fprintf (stderr, _("Error downloading: %s.\n"), + FPRINTF (stderr, _("Error downloading: %s.\n"), info->value.download.specifics.error.message); GNUNET_SCHEDULER_shutdown (); break; @@ -126,7 +126,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / (info->value.download. duration.rel_value + 1)); - fprintf (stdout, _("Downloading `%s' done (%s/s).\n"), + FPRINTF (stdout, _("Downloading `%s' done (%s/s).\n"), info->value.download.filename, s); GNUNET_free (s); if (info->value.download.dc == dc) @@ -141,7 +141,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) case GNUNET_FS_STATUS_DOWNLOAD_INACTIVE: break; default: - fprintf (stderr, _("Unexpected status: %d\n"), info->status); + FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); break; } return NULL; @@ -166,27 +166,27 @@ run (void *cls, char *const *args, const char *cfgfile, if (NULL == args[0]) { - fprintf (stderr, _("You need to specify a URI argument.\n")); + FPRINTF (stderr, "%s", _("You need to specify a URI argument.\n")); return; } uri = GNUNET_FS_uri_parse (args[0], &emsg); if (NULL == uri) { - fprintf (stderr, _("Failed to parse URI: %s\n"), emsg); + FPRINTF (stderr, _("Failed to parse URI: %s\n"), emsg); GNUNET_free (emsg); ret = 1; return; } if ((!GNUNET_FS_uri_test_chk (uri)) && (!GNUNET_FS_uri_test_loc (uri))) { - fprintf (stderr, _("Only CHK or LOC URIs supported.\n")); + FPRINTF (stderr, "%s", _("Only CHK or LOC URIs supported.\n")); ret = 1; GNUNET_FS_uri_destroy (uri); return; } if (NULL == filename) { - fprintf (stderr, _("Target filename must be specified.\n")); + FPRINTF (stderr, "%s", _("Target filename must be specified.\n")); ret = 1; GNUNET_FS_uri_destroy (uri); return; @@ -200,7 +200,7 @@ run (void *cls, char *const *args, const char *cfgfile, request_parallelism, GNUNET_FS_OPTIONS_END); if (NULL == ctx) { - fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); + FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); GNUNET_FS_uri_destroy (uri); ret = 1; return; diff --git a/src/fs/gnunet-fs.c b/src/fs/gnunet-fs.c index dc86ce984..8cf08ec28 100644 --- a/src/fs/gnunet-fs.c +++ b/src/fs/gnunet-fs.c @@ -72,9 +72,9 @@ static int print_indexed (void *cls, const char *filename, const GNUNET_HashCode * file_id) { if (verbose) - fprintf (stdout, "%s: %s\n", GNUNET_h2s (file_id), filename); + FPRINTF (stdout, "%s: %s\n", GNUNET_h2s (file_id), filename); else - fprintf (stdout, "%s\n", filename); + FPRINTF (stdout, "%s\n", filename); return GNUNET_OK; } diff --git a/src/fs/gnunet-pseudonym.c b/src/fs/gnunet-pseudonym.c index ce0d24506..412ddd2b0 100644 --- a/src/fs/gnunet-pseudonym.c +++ b/src/fs/gnunet-pseudonym.c @@ -100,7 +100,7 @@ ns_printer (void *cls, const char *name, const GNUNET_HashCode * id) struct GNUNET_CRYPTO_HashAsciiEncoded enc; GNUNET_CRYPTO_hash_to_enc (id, &enc); - fprintf (stdout, "%s (%s)\n", name, (const char *) &enc); + FPRINTF (stdout, "%s (%s)\n", name, (const char *) &enc); } @@ -116,9 +116,9 @@ pseudo_printer (void *cls, const GNUNET_HashCode * pseudonym, GNUNET_break (0); return GNUNET_OK; } - fprintf (stdout, "%s (%d):\n", id, rating); + FPRINTF (stdout, "%s (%d):\n", id, rating); GNUNET_CONTAINER_meta_data_iterate (md, &EXTRACTOR_meta_data_print, stdout); - fprintf (stdout, "\n"); + FPRINTF (stdout, "%s", "\n"); GNUNET_free (id); return GNUNET_OK; } @@ -133,7 +133,7 @@ post_advertising (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) if (emsg != NULL) { - fprintf (stderr, "%s", emsg); + FPRINTF (stderr, "%s", emsg); ret = 1; } if (ns != NULL) @@ -237,16 +237,16 @@ run (void *cls, char *const *args, const char *cfgfile, else { if (ksk_uri != NULL) - fprintf (stderr, _("Option `%s' ignored\n"), "-k"); + FPRINTF (stderr, _("Option `%s' ignored\n"), "-k"); } } } else { if (root_identifier != NULL) - fprintf (stderr, _("Option `%s' ignored\n"), "-r"); + FPRINTF (stderr, _("Option `%s' ignored\n"), "-r"); if (ksk_uri != NULL) - fprintf (stderr, _("Option `%s' ignored\n"), "-k"); + FPRINTF (stderr, _("Option `%s' ignored\n"), "-k"); } post_advertising (NULL, NULL, NULL); diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index ffcdefdc6..dd3bf6810 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c @@ -115,7 +115,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) if (verbose) { s = GNUNET_STRINGS_relative_time_to_string (info->value.publish.eta); - fprintf (stdout, _("Publishing `%s' at %llu/%llu (%s remaining)\n"), + FPRINTF (stdout, _("Publishing `%s' at %llu/%llu (%s remaining)\n"), info->value.publish.filename, (unsigned long long) info->value.publish.completed, (unsigned long long) info->value.publish.size, s); @@ -123,7 +123,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) } break; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, _("Error publishing: %s.\n"), + FPRINTF (stderr, _("Error publishing: %s.\n"), info->value.publish.specifics.error.message); if (kill_task != GNUNET_SCHEDULER_NO_TASK) { @@ -134,11 +134,11 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: - fprintf (stdout, _("Publishing `%s' done.\n"), + FPRINTF (stdout, _("Publishing `%s' done.\n"), info->value.publish.filename); s = GNUNET_FS_uri_to_string (info->value.publish.specifics. completed.chk_uri); - fprintf (stdout, _("URI is `%s'.\n"), s); + FPRINTF (stdout, _("URI is `%s'.\n"), s); GNUNET_free (s); if (info->value.publish.pctx == NULL) { @@ -157,10 +157,10 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) case GNUNET_FS_STATUS_UNINDEX_PROGRESS: return NULL; case GNUNET_FS_STATUS_UNINDEX_COMPLETED: - fprintf (stderr, _("Cleanup after abort complete.\n")); + FPRINTF (stderr, "%s", _("Cleanup after abort complete.\n")); return NULL; default: - fprintf (stderr, _("Unexpected status: %d\n"), info->status); + FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); return NULL; } return ""; /* non-null */ @@ -190,7 +190,7 @@ meta_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, return 0; if (type == EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME) return 0; - fprintf (stdout, "\t%s - %s\n", EXTRACTOR_metatype_to_string (type), data); + FPRINTF (stdout, "\t%s - %s\n", EXTRACTOR_metatype_to_string (type), data); return 0; } @@ -206,7 +206,7 @@ meta_printer (void *cls, const char *plugin_name, enum EXTRACTOR_MetaType type, static int keyword_printer (void *cls, const char *keyword, int is_mandatory) { - fprintf (stdout, "\t%s\n", keyword); + FPRINTF (stdout, "\t%s\n", keyword); return GNUNET_OK; } @@ -269,14 +269,14 @@ publish_inspector (void *cls, struct GNUNET_FS_FileInformation *fi, fn = GNUNET_CONTAINER_meta_data_get_by_type (m, EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); fs = GNUNET_STRINGS_byte_size_fancy (length); - fprintf (stdout, _("Meta data for file `%s' (%s)\n"), fn, fs); + FPRINTF (stdout, _("Meta data for file `%s' (%s)\n"), fn, fs); GNUNET_CONTAINER_meta_data_iterate (m, &meta_printer, NULL); - fprintf (stdout, _("Keywords for file `%s' (%s)\n"), fn, fs); + FPRINTF (stdout, _("Keywords for file `%s' (%s)\n"), fn, fs); GNUNET_free (fn); GNUNET_free (fs); if (NULL != *uri) GNUNET_FS_uri_ksk_get_keywords (*uri, &keyword_printer, NULL); - fprintf (stdout, "\n"); + FPRINTF (stdout, "%s", "\n"); } if (GNUNET_YES == GNUNET_FS_meta_data_test_for_directory (m)) GNUNET_FS_file_information_inspect (fi, &publish_inspector, fi); @@ -293,7 +293,7 @@ uri_sks_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri, { if (emsg != NULL) { - fprintf (stderr, "%s\n", emsg); + FPRINTF (stderr, "%s\n", emsg); ret = 1; } GNUNET_FS_uri_destroy (uri); @@ -314,7 +314,7 @@ uri_ksk_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri, if (emsg != NULL) { - fprintf (stderr, "%s\n", emsg); + FPRINTF (stderr, "%s\n", emsg); ret = 1; } if (pseudonym != NULL) @@ -322,7 +322,7 @@ uri_ksk_continuation (void *cls, const struct GNUNET_FS_Uri *ksk_uri, ns = GNUNET_FS_namespace_create (ctx, pseudonym); if (ns == NULL) { - fprintf (stderr, _("Failed to create namespace `%s'\n"), pseudonym); + FPRINTF (stderr, _("Failed to create namespace `%s'\n"), pseudonym); ret = 1; } else @@ -385,7 +385,7 @@ run (void *cls, char *const *args, const char *cfgfile, { if (NULL == this_id) { - fprintf (stderr, _("Option `%s' is required when using option `%s'.\n"), + FPRINTF (stderr, _("Option `%s' is required when using option `%s'.\n"), "-t", "-P"); ret = -1; return; @@ -395,14 +395,14 @@ run (void *cls, char *const *args, const char *cfgfile, { /* ordinary insertion checks */ if (NULL != next_id) { - fprintf (stderr, _("Option `%s' makes no sense without option `%s'.\n"), + FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"), "-N", "-P"); ret = -1; return; } if (NULL != this_id) { - fprintf (stderr, _("Option `%s' makes no sense without option `%s'.\n"), + FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"), "-t", "-P"); ret = -1; return; @@ -414,7 +414,7 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); if (NULL == ctx) { - fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); + FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); ret = 1; return; } @@ -424,7 +424,7 @@ run (void *cls, char *const *args, const char *cfgfile, namespace = GNUNET_FS_namespace_create (ctx, pseudonym); if (NULL == namespace) { - fprintf (stderr, _("Could not create namespace `%s'\n"), pseudonym); + FPRINTF (stderr, _("Could not create namespace `%s'\n"), pseudonym); GNUNET_FS_stop (ctx); ret = 1; return; @@ -436,7 +436,7 @@ run (void *cls, char *const *args, const char *cfgfile, uri = GNUNET_FS_uri_parse (uri_string, &emsg); if (uri == NULL) { - fprintf (stderr, _("Failed to parse URI: %s\n"), emsg); + FPRINTF (stderr, _("Failed to parse URI: %s\n"), emsg); GNUNET_free (emsg); if (namespace != NULL) GNUNET_FS_namespace_delete (namespace, GNUNET_NO); @@ -494,7 +494,7 @@ run (void *cls, char *const *args, const char *cfgfile, EXTRACTOR_plugin_remove_all (plugins); if (fi == NULL) { - fprintf (stderr, _("Could not publish `%s': %s\n"), args[0], emsg); + FPRINTF (stderr, _("Could not publish `%s': %s\n"), args[0], emsg); GNUNET_free (emsg); if (namespace != NULL) GNUNET_FS_namespace_delete (namespace, GNUNET_NO); @@ -517,7 +517,7 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_FS_PUBLISH_OPTION_NONE); if (NULL == pc) { - fprintf (stderr, _("Could not start publishing.\n")); + FPRINTF (stderr, "%s", _("Could not start publishing.\n")); GNUNET_FS_stop (ctx); ret = 1; return; diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index 3a30f6c2b..c221a30f8 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c @@ -107,7 +107,7 @@ clean_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE)) { - fprintf (stderr, + FPRINTF (stderr, _("Failed to write directory with search results to `%s'\n"), output_filename); } @@ -178,7 +178,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) /* ignore */ break; case GNUNET_FS_STATUS_SEARCH_ERROR: - fprintf (stderr, _("Error searching: %s.\n"), + FPRINTF (stderr, _("Error searching: %s.\n"), info->value.search.specifics.error.message); GNUNET_SCHEDULER_shutdown (); break; @@ -187,7 +187,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; default: - fprintf (stderr, _("Unexpected status: %d\n"), info->status); + FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); break; } return NULL; @@ -228,7 +228,7 @@ run (void *cls, char *const *args, const char *cfgfile, uri = GNUNET_FS_uri_ksk_create_from_args (argc, (const char **) args); if (NULL == uri) { - fprintf (stderr, _("Could not create keyword URI from arguments.\n")); + FPRINTF (stderr, "%s", _("Could not create keyword URI from arguments.\n")); ret = 1; return; } @@ -238,7 +238,7 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); if (NULL == ctx) { - fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); + FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); GNUNET_FS_uri_destroy (uri); ret = 1; return; @@ -252,7 +252,7 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_FS_uri_destroy (uri); if (NULL == sc) { - fprintf (stderr, _("Could not start searching.\n")); + FPRINTF (stderr, "%s", _("Could not start searching.\n")); GNUNET_FS_stop (ctx); ret = 1; return; diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c index 25560ca10..3e8308df2 100644 --- a/src/fs/gnunet-unindex.c +++ b/src/fs/gnunet-unindex.c @@ -86,19 +86,19 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) if (verbose) { s = GNUNET_STRINGS_relative_time_to_string (info->value.unindex.eta); - fprintf (stdout, _("Unindexing at %llu/%llu (%s remaining)\n"), + FPRINTF (stdout, _("Unindexing at %llu/%llu (%s remaining)\n"), (unsigned long long) info->value.unindex.completed, (unsigned long long) info->value.unindex.size, s); GNUNET_free (s); } break; case GNUNET_FS_STATUS_UNINDEX_ERROR: - fprintf (stderr, _("Error unindexing: %s.\n"), + FPRINTF (stderr, _("Error unindexing: %s.\n"), info->value.unindex.specifics.error.message); GNUNET_SCHEDULER_shutdown (); break; case GNUNET_FS_STATUS_UNINDEX_COMPLETED: - fprintf (stdout, _("Unindexing done.\n")); + FPRINTF (stdout, "%s", _("Unindexing done.\n")); GNUNET_SCHEDULER_shutdown (); break; case GNUNET_FS_STATUS_UNINDEX_STOPPED: @@ -106,7 +106,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; default: - fprintf (stderr, _("Unexpected status: %d\n"), info->status); + FPRINTF (stderr, _("Unexpected status: %d\n"), info->status); break; } return NULL; @@ -138,14 +138,14 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END); if (NULL == ctx) { - fprintf (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); + FPRINTF (stderr, _("Could not initialize `%s' subsystem.\n"), "FS"); ret = 1; return; } uc = GNUNET_FS_unindex_start (ctx, args[0], NULL); if (NULL == uc) { - fprintf (stderr, _("Could not start unindex operation.\n")); + FPRINTF (stderr, "%s", _("Could not start unindex operation.\n")); GNUNET_FS_stop (ctx); return; } diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index bb8c8d8c2..6b9b1abd5 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c @@ -120,7 +120,7 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, { struct StatMaster *sm = cls; - fprintf (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, + FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, name, (unsigned long long) value); return GNUNET_OK; } @@ -199,7 +199,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * 1000LL / del.rel_value); - fprintf (stdout, "Download speed was %s/s\n", fancy); + FPRINTF (stdout, "Download speed was %s/s\n", fancy); GNUNET_free (fancy); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", (unsigned long long) FILESIZE); diff --git a/src/fs/perf_gnunet_service_fs_p2p_trust.c b/src/fs/perf_gnunet_service_fs_p2p_trust.c index 9f5a36b7e..94b7648f8 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_trust.c +++ b/src/fs/perf_gnunet_service_fs_p2p_trust.c @@ -153,7 +153,7 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, { struct StatMaster *sm = cls; - fprintf (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, + FPRINTF (stderr, "Peer %2u: %12s/%50s = %12llu\n", sm->daemon, subsystem, name, (unsigned long long) value); return GNUNET_OK; } @@ -234,7 +234,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * 1000LL / del.rel_value); - fprintf (stderr, "Download speed of type `%s' was %s/s\n", type, fancy); + FPRINTF (stderr, "Download speed of type `%s' was %s/s\n", type, fancy); GNUNET_free (fancy); if (NUM_DAEMONS != ++download_counter) return; /* more downloads to come */ diff --git a/src/fs/test_fs_directory.c b/src/fs/test_fs_directory.c index 81012e764..96ad29cb4 100644 --- a/src/fs/test_fs_directory.c +++ b/src/fs/test_fs_directory.c @@ -59,7 +59,7 @@ processor (void *cls, const char *filename, const struct GNUNET_FS_Uri *uri, return; } } - fprintf (stderr, "Error at %s:%d\n", __FILE__, __LINE__); + FPRINTF (stderr, "Error at %s:%d\n", __FILE__, __LINE__); } static int @@ -131,7 +131,7 @@ testDirectory (unsigned int i) GNUNET_FS_directory_builder_finish (db, &dlen, (void **) &data); s = GNUNET_STRINGS_relative_time_to_string (GNUNET_TIME_absolute_get_duration (start)); - fprintf (stdout, + FPRINTF (stdout, "Creating directory with %u entires and total size %llu took %s\n", i, (unsigned long long) dlen, s); GNUNET_free (s); diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 19ef6e76a..93ad0cbba 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c @@ -190,14 +190,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); GNUNET_break (0); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_DOWNLOAD_ERROR: - fprintf (stderr, "Error downloading file: %s\n", + FPRINTF (stderr, "Error downloading file: %s\n", event->value.download.specifics.error.message); GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); break; diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c index 3f932f783..6592f6efa 100644 --- a/src/fs/test_fs_download_indexed.c +++ b/src/fs/test_fs_download_indexed.c @@ -191,14 +191,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); GNUNET_break (0); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_DOWNLOAD_ERROR: - fprintf (stderr, "Error downloading file: %s\n", + FPRINTF (stderr, "Error downloading file: %s\n", event->value.download.specifics.error.message); GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); break; diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c index 9bc37235e..1e1ed22f8 100644 --- a/src/fs/test_fs_download_persistence.c +++ b/src/fs/test_fs_download_persistence.c @@ -211,14 +211,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); GNUNET_break (0); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_DOWNLOAD_ERROR: - fprintf (stderr, "Error downloading file: %s\n", + FPRINTF (stderr, "Error downloading file: %s\n", event->value.download.specifics.error.message); GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); break; diff --git a/src/fs/test_fs_download_recursive.c b/src/fs/test_fs_download_recursive.c index cede523ec..29d15c492 100644 --- a/src/fs/test_fs_download_recursive.c +++ b/src/fs/test_fs_download_recursive.c @@ -213,14 +213,14 @@ eventCallback (void *cls, const GNUNET_FSUI_Event * event) #endif break; case GNUNET_FSUI_unindex_error: - fprintf (stderr, "Error unindexing: %s\n", + FPRINTF (stderr, "Error unindexing: %s\n", event->data.UnindexError.message); break; case GNUNET_FSUI_upload_error: - fprintf (stderr, "Error uploading: %s\n", event->data.UploadError.message); + FPRINTF (stderr, "Error uploading: %s\n", event->data.UploadError.message); break; case GNUNET_FSUI_download_error: - fprintf (stderr, "Error downloading: %s\n", + FPRINTF (stderr, "Error downloading: %s\n", event->data.DownloadError.message); break; case GNUNET_FSUI_download_aborted: @@ -277,7 +277,7 @@ main (int argc, char *argv[]) GNUNET_GC_free (cfg); return -1; } - fprintf (stderr, "Setup...\n"); + FPRINTF (stderr, "%s", "Setup...\n"); #if START_DAEMON GNUNET_disk_directory_remove (NULL, "/tmp/gnunet-fsui-recursive_download_test/"); @@ -297,7 +297,7 @@ main (int argc, char *argv[]) kuri = GNUNET_ECRS_keyword_command_line_to_uri (ectx, 2, (const char **) keywords); - fprintf (stderr, "Uploading...\n"); + FPRINTF (stderr, "%s", "Uploading...\n"); waitForEvent = GNUNET_FSUI_upload_completed; upload = GNUNET_FSUI_upload_start (ctx, fn, @@ -322,7 +322,7 @@ main (int argc, char *argv[]) upload = NULL; CHECK (upURI != NULL); - fprintf (stderr, "Downloading...\n"); + FPRINTF (stderr, "%s", "Downloading...\n"); waitForEvent = GNUNET_FSUI_download_completed; fn43 = makeName (43); download = @@ -341,7 +341,7 @@ main (int argc, char *argv[]) break; } FAILURE: - fprintf (stderr, "Cleanup...\n"); + FPRINTF (stderr, "%s", "Cleanup...\n"); if (meta != NULL) GNUNET_meta_data_destroy (meta); if (ctx != NULL) diff --git a/src/fs/test_fs_file_information.c b/src/fs/test_fs_file_information.c index a459c565f..34ac3285e 100644 --- a/src/fs/test_fs_file_information.c +++ b/src/fs/test_fs_file_information.c @@ -151,8 +151,8 @@ testThumbnail () EXTRACTOR_OPTION_DEFAULT_POLICY); if (ex == NULL) { - fprintf (stderr, - "Test incomplete, have no GTK thumbnail extractor available.\n"); + FPRINTF (stderr, + "Test incomplete, have no GTK thumbnail extractor available.\n", NULL); return 0; /* can not test, no thumbnailer */ } ex = EXTRACTOR_plugin_add_config (ex, "mime", diff --git a/src/fs/test_fs_getopt.c b/src/fs/test_fs_getopt.c index 2b0a9fca8..571346f2c 100644 --- a/src/fs/test_fs_getopt.c +++ b/src/fs/test_fs_getopt.c @@ -35,6 +35,6 @@ main (int argc, char *argv[]) "WARNING", #endif NULL); - fprintf (stderr, "WARNING: testcase not yet written.\n"); + FPRINTF (stderr, "%s", "WARNING: testcase not yet written.\n"); return 0; /* testcase passed */ } diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c index 870f51a4a..8a847ba2b 100644 --- a/src/fs/test_fs_list_indexed.c +++ b/src/fs/test_fs_list_indexed.c @@ -131,7 +131,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) break; case GNUNET_FS_STATUS_PUBLISH_ERROR: ret = event->value.publish.cctx; - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); err = 1; if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index b1221eb82..df9a310b9 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c @@ -139,7 +139,7 @@ abort_sks_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) static void do_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { - fprintf (stderr, "Operation timed out\n"); + FPRINTF (stderr, "%s", "Operation timed out\n"); kill_task = GNUNET_SCHEDULER_NO_TASK; abort_sks_search_task (NULL, tc); abort_ksk_search_task (NULL, tc); @@ -158,7 +158,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) if (!GNUNET_FS_uri_test_equal (sks_expect_uri, event->value.search.specifics.result.uri)) { - fprintf (stderr, "Wrong result for sks search!\n"); + FPRINTF (stderr, "%s", "Wrong result for sks search!\n"); err = 1; } /* give system 1ms to initiate update search! */ @@ -170,7 +170,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) if (!GNUNET_FS_uri_test_equal (ksk_expect_uri, event->value.search.specifics.result.uri)) { - fprintf (stderr, "Wrong result for ksk search!\n"); + FPRINTF (stderr, "%s", "Wrong result for ksk search!\n"); err = 1; } GNUNET_SCHEDULER_add_continuation (&abort_ksk_search_task, NULL, @@ -178,12 +178,12 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) } else { - fprintf (stderr, "Unexpected search result received!\n"); + FPRINTF (stderr, "%s", "Unexpected search result received!\n"); GNUNET_break (0); } break; case GNUNET_FS_STATUS_SEARCH_ERROR: - fprintf (stderr, "Error searching file: %s\n", + FPRINTF (stderr, "Error searching file: %s\n", event->value.search.specifics.error.message); if (sks_search == event->value.search.sc) GNUNET_SCHEDULER_add_continuation (&abort_sks_search_task, NULL, @@ -210,7 +210,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) case GNUNET_FS_STATUS_SEARCH_STOPPED: return NULL; default: - fprintf (stderr, "Unexpected event: %d\n", event->status); + FPRINTF (stderr, "Unexpected event: %d\n", event->status); break; } return event->value.search.cctx; @@ -227,7 +227,7 @@ publish_cont (void *cls, const struct GNUNET_FS_Uri *ksk_uri, const char *emsg) if (NULL != emsg) { - fprintf (stderr, "Error publishing: %s\n", emsg); + FPRINTF (stderr, "Error publishing: %s\n", emsg); err = 1; GNUNET_FS_stop (fs); return; @@ -237,7 +237,7 @@ publish_cont (void *cls, const struct GNUNET_FS_Uri *ksk_uri, const char *emsg) sks_uri = GNUNET_FS_uri_parse (sbuf, &msg); if (msg != NULL) { - fprintf (stderr, "failed to parse URI `%s': %s\n", sbuf, msg); + FPRINTF (stderr, "failed to parse URI `%s': %s\n", sbuf, msg); err = 1; GNUNET_FS_stop (fs); GNUNET_free (msg); @@ -287,7 +287,7 @@ adv_cont (void *cls, const struct GNUNET_FS_Uri *uri, const char *emsg) if (NULL != emsg) { - fprintf (stderr, "Error publishing: %s\n", emsg); + FPRINTF (stderr, "Error publishing: %s\n", emsg); err = 1; GNUNET_FS_stop (fs); return; @@ -336,7 +336,7 @@ testNamespace () GNUNET_FS_namespace_list (fs, &ns_iterator, &ok); if (GNUNET_NO == ok) { - fprintf (stderr, "namespace_list failed to find namespace!\n"); + FPRINTF (stderr, "%s", "namespace_list failed to find namespace!\n"); GNUNET_FS_namespace_delete (ns, GNUNET_YES); GNUNET_FS_stop (fs); err = 1; @@ -399,7 +399,7 @@ main (int argc, char *argv[]) stop_arm (&p1); if (GNUNET_YES != update_started) { - fprintf (stderr, "Update search never started!\n"); + FPRINTF (stderr, "%s", "Update search never started!\n"); err = 1; } GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-namespace/"); diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c index 81ec3dd7f..051b84f68 100644 --- a/src/fs/test_fs_publish.c +++ b/src/fs/test_fs_publish.c @@ -118,12 +118,12 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) break; case GNUNET_FS_STATUS_PUBLISH_ERROR: ret = event->value.publish.cctx; - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); err = 1; if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) { - fprintf (stderr, "Scheduling abort task for error on `%s'\n", + FPRINTF (stderr, "Scheduling abort task for error on `%s'\n", (const char *) event->value.publish.cctx); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index 145ef0ca9..4d569849f 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c @@ -184,7 +184,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) break; case GNUNET_FS_STATUS_PUBLISH_ERROR: ret = event->value.publish.cctx; - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); err = 1; GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c index 9d9825e2f..ffbcd19de 100644 --- a/src/fs/test_fs_search.c +++ b/src/fs/test_fs_search.c @@ -122,14 +122,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); GNUNET_break (0); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_SEARCH_ERROR: - fprintf (stderr, "Error searching file: %s\n", + FPRINTF (stderr, "Error searching file: %s\n", event->value.search.specifics.error.message); GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); @@ -161,7 +161,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; default: - fprintf (stderr, "Unexpected event: %d\n", event->status); + FPRINTF (stderr, "Unexpected event: %d\n", event->status); break; } return NULL; diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c index 74ba9659a..e511b6910 100644 --- a/src/fs/test_fs_search_persistence.c +++ b/src/fs/test_fs_search_persistence.c @@ -170,14 +170,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); GNUNET_break (0); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_SEARCH_ERROR: - fprintf (stderr, "Error searching file: %s\n", + FPRINTF (stderr, "Error searching file: %s\n", event->value.search.specifics.error.message); GNUNET_SCHEDULER_add_continuation (&abort_search_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); @@ -223,7 +223,7 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) search = NULL; break; default: - fprintf (stderr, "Unexpected event: %d\n", event->status); + FPRINTF (stderr, "Unexpected event: %d\n", event->status); break; } return NULL; diff --git a/src/fs/test_fs_search_ranking.c b/src/fs/test_fs_search_ranking.c index 6da936342..383447485 100644 --- a/src/fs/test_fs_search_ranking.c +++ b/src/fs/test_fs_search_ranking.c @@ -189,7 +189,7 @@ main (int argc, char *argv[]) prog++; if (prog == 10000) { - fprintf (stderr, "Upload failed to complete -- last event: %u\n", + FPRINTF (stderr, "Upload failed to complete -- last event: %u\n", lastEvent); } CHECK (prog < 10000); diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 9b21cd651..14d93fb5e 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c @@ -135,14 +135,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); GNUNET_break (0); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_UNINDEX_ERROR: - fprintf (stderr, "Error unindexing file: %s\n", + FPRINTF (stderr, "Error unindexing file: %s\n", event->value.unindex.specifics.error.message); GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index 0529aacfa..e5ad9b260 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c @@ -196,14 +196,14 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) unindex = event->value.unindex.uc; return "unindex"; case GNUNET_FS_STATUS_PUBLISH_ERROR: - fprintf (stderr, "Error publishing file: %s\n", + FPRINTF (stderr, "Error publishing file: %s\n", event->value.publish.specifics.error.message); GNUNET_break (0); GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; case GNUNET_FS_STATUS_UNINDEX_ERROR: - fprintf (stderr, "Error unindexing file: %s\n", + FPRINTF (stderr, "Error unindexing file: %s\n", event->value.unindex.specifics.error.message); GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); diff --git a/src/fs/test_fs_uri.c b/src/fs/test_fs_uri.c index 72744351b..b7a58ec0f 100644 --- a/src/fs/test_fs_uri.c +++ b/src/fs/test_fs_uri.c @@ -94,7 +94,7 @@ testLocation () cfg = GNUNET_CONFIGURATION_create (); if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, "test_fs_uri_data.conf")) { - fprintf (stderr, "Failed to parse configuration file\n"); + FPRINTF (stderr, "%s", "Failed to parse configuration file\n"); GNUNET_FS_uri_destroy (baseURI); GNUNET_CONFIGURATION_destroy (cfg); return 1; @@ -316,11 +316,11 @@ main (int argc, char *argv[]) failureCount += testLocation (); for (i = 0; i < 255; i++) { - /* fprintf (stderr, "."); */ + /* FPRINTF (stderr, "%s", "."); */ failureCount += testNamespace (i); failureCount += testFile (i); } - /* fprintf (stderr, "\n"); */ + /* FPRINTF (stderr, "%s", "\n"); */ GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs-uri"); if (failureCount != 0) return 1; diff --git a/src/fs/test_gnunet_service_fs_migration.c b/src/fs/test_gnunet_service_fs_migration.c index 91caf103f..70fadd8d0 100644 --- a/src/fs/test_gnunet_service_fs_migration.c +++ b/src/fs/test_gnunet_service_fs_migration.c @@ -74,7 +74,7 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * 1000LL / del.rel_value); - fprintf (stdout, "Download speed was %s/s\n", fancy); + FPRINTF (stdout, "Download speed was %s/s\n", fancy); GNUNET_free (fancy); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", (unsigned long long) FILESIZE); @@ -166,7 +166,7 @@ do_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { if (0 == (tc->reason & GNUNET_SCHEDULER_REASON_PREREQ_DONE)) { - fprintf (stderr, "Daemons failed to start!\n"); + FPRINTF (stderr, "%s", "Daemons failed to start!\n"); GNUNET_break (0); ok = 1; return; diff --git a/src/fs/test_gnunet_service_fs_p2p.c b/src/fs/test_gnunet_service_fs_p2p.c index 434dd3ce5..fb07d34b5 100644 --- a/src/fs/test_gnunet_service_fs_p2p.c +++ b/src/fs/test_gnunet_service_fs_p2p.c @@ -70,7 +70,7 @@ do_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) fancy = GNUNET_STRINGS_byte_size_fancy (((unsigned long long) FILESIZE) * 1000LL / del.rel_value); - fprintf (stdout, "Download speed was %s/s\n", fancy); + FPRINTF (stdout, "Download speed was %s/s\n", fancy); GNUNET_free (fancy); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Finished download, shutting down\n", (unsigned long long) FILESIZE); diff --git a/src/hello/test_hello.c b/src/hello/test_hello.c index eb15668f4..c645252ff 100644 --- a/src/hello/test_hello.c +++ b/src/hello/test_hello.c @@ -38,7 +38,7 @@ my_addr_gen (void *cls, size_t max, void *buf) struct GNUNET_HELLO_Address address; #if DEBUG - fprintf (stderr, "DEBUG: my_addr_gen called with i = %d\n", *i); + FPRINTF (stderr, "DEBUG: my_addr_gen called with i = %d\n", *i); #endif if (0 == *i) return 0; @@ -61,7 +61,7 @@ check_addr (void *cls, const struct GNUNET_HELLO_Address *address, unsigned int *i = cls; #if DEBUG - fprintf (stderr, "DEBUG: check_addr called with i = %d and addrlen = %u\n", + FPRINTF (stderr, "DEBUG: check_addr called with i = %d and addrlen = %u\n", *i, address->address_length); #endif GNUNET_assert (address->address_length > 0); @@ -82,7 +82,7 @@ remove_some (void *cls, const struct GNUNET_HELLO_Address *address, unsigned int *i = cls; #if DEBUG - fprintf (stderr, "DEBUG: remove_some called with i = %d and addrlen = %u\n", + FPRINTF (stderr, "DEBUG: remove_some called with i = %d and addrlen = %u\n", *i, address->address_length); #endif GNUNET_assert (address->address_length > 0); @@ -110,7 +110,7 @@ main (int argc, char *argv[]) startup_time = GNUNET_TIME_absolute_get (); memset (&publicKey, 42, sizeof (publicKey)); #if VERBOSE - fprintf (stderr, "Testing HELLO creation (without addresses)...\n"); + FPRINTF (stderr, "%s", "Testing HELLO creation (without addresses)...\n"); #endif i = 0; msg1 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); @@ -118,14 +118,14 @@ main (int argc, char *argv[]) GNUNET_assert (0 < GNUNET_HELLO_size (msg1)); #if VERBOSE - fprintf (stderr, "Testing address iteration (empty set)...\n"); + FPRINTF (stderr, "%s", "Testing address iteration (empty set)...\n"); #endif GNUNET_assert (NULL == GNUNET_HELLO_iterate_addresses (msg1, GNUNET_NO, &check_addr, &i)); #if VERBOSE - fprintf (stderr, "Testing HELLO creation (with one address)...\n"); + FPRINTF (stderr, "%s", "Testing HELLO creation (with one address)...\n"); #endif i = 1; msg2 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); @@ -133,7 +133,7 @@ main (int argc, char *argv[]) GNUNET_assert (GNUNET_HELLO_size (msg1) < GNUNET_HELLO_size (msg2)); #if VERBOSE - fprintf (stderr, "Testing address iteration (one address)...\n"); + FPRINTF (stderr, "%s", "Testing address iteration (one address)...\n"); #endif i = 1; GNUNET_assert (NULL == @@ -142,14 +142,14 @@ main (int argc, char *argv[]) GNUNET_assert (i == 0); #if VERBOSE - fprintf (stderr, "Testing get_key from HELLO...\n"); + FPRINTF (stderr, "%s", "Testing get_key from HELLO...\n"); #endif GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_key (msg2, &pk)); GNUNET_assert (0 == memcmp (&publicKey, &pk, sizeof (pk))); GNUNET_free (msg1); #if VERBOSE - fprintf (stderr, "Testing HELLO creation (with two addresses)...\n"); + FPRINTF (stderr, "%s", "Testing HELLO creation (with two addresses)...\n"); #endif i = 2; msg3 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); @@ -157,7 +157,7 @@ main (int argc, char *argv[]) GNUNET_assert (GNUNET_HELLO_size (msg2) < GNUNET_HELLO_size (msg3)); #if VERBOSE - fprintf (stderr, "Testing address iteration (two addresses)...\n"); + FPRINTF (stderr, "%s", "Testing address iteration (two addresses)...\n"); #endif i = 3; GNUNET_assert (NULL == @@ -166,7 +166,7 @@ main (int argc, char *argv[]) GNUNET_assert (i == 0); #if VERBOSE - fprintf (stderr, "Testing HELLO merge...\n"); + FPRINTF (stderr, "%s", "Testing HELLO merge...\n"); #endif msg1 = GNUNET_HELLO_merge (msg2, msg3); GNUNET_assert (GNUNET_HELLO_size (msg1) == GNUNET_HELLO_size (msg3)); @@ -179,7 +179,7 @@ main (int argc, char *argv[]) GNUNET_free (msg1); #if VERBOSE - fprintf (stderr, "Testing address iteration to copy HELLO...\n"); + FPRINTF (stderr, "%s", "Testing address iteration to copy HELLO...\n"); #endif i = 2; msg1 = GNUNET_HELLO_iterate_addresses (msg3, GNUNET_YES, &remove_some, &i); @@ -193,7 +193,7 @@ main (int argc, char *argv[]) GNUNET_free (msg1); #if VERBOSE - fprintf (stderr, "Testing delta address iteration...\n"); + FPRINTF (stderr, "%s", "Testing delta address iteration...\n"); #endif i = 2; GNUNET_HELLO_iterate_new_addresses (msg3, msg2, startup_time, &check_addr, diff --git a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c index 5dce8df10..92cd7fcc5 100644 --- a/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c +++ b/src/hostlist/test_gnunet_daemon_hostlist_reconnect.c @@ -113,7 +113,7 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, if (peer == NULL) return; #if VERBOSE - fprintf (stderr, "Peer %s connected\n", GNUNET_i2s (peer)); + FPRINTF (stderr, "Peer %s connected\n", GNUNET_i2s (peer)); #endif GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected, shutting down.\n"); ok = 0; @@ -252,10 +252,10 @@ main (int argc, char *argv[]) ret = check (); if (ret == 0) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); /* now do it again */ ret = check (); - fprintf (stderr, ".\n"); + FPRINTF (stderr, "%s", ".\n"); } GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-1"); GNUNET_DISK_directory_remove ("/tmp/test-gnunet-hostlist-peer-2"); diff --git a/src/mesh/mesh_tunnel_tree.c b/src/mesh/mesh_tunnel_tree.c index a7577e36f..445b7100d 100644 --- a/src/mesh/mesh_tunnel_tree.c +++ b/src/mesh/mesh_tunnel_tree.c @@ -344,25 +344,25 @@ tree_node_debug (struct MeshTunnelTreeNode *n, uint16_t level) uint16_t i; for (i = 0; i < level; i++) - fprintf (stderr, " "); + FPRINTF (stderr, "%s", " "); if (n->status == MESH_PEER_READY) - fprintf (stderr, "#"); + FPRINTF (stderr, "%s", "#"); if (n->status == MESH_PEER_SEARCHING) - fprintf (stderr, "+"); + FPRINTF (stderr, "%s", "+"); if (n->status == MESH_PEER_RELAY) - fprintf (stderr, "-"); + FPRINTF (stderr, "%s", "-"); if (n->status == MESH_PEER_RECONNECTING) - fprintf (stderr, "*"); + FPRINTF (stderr, "%s", "*"); GNUNET_PEER_resolve (n->peer, &id); - fprintf (stderr, "%s, [%u, %p] ", GNUNET_i2s (&id), n->peer, n); + FPRINTF (stderr, "%s, [%u, %p] ", GNUNET_i2s (&id), n->peer, n); if (NULL != n->parent) { GNUNET_PEER_resolve (n->parent->peer, &id); - fprintf (stderr, "(-> %s [%u])\n", GNUNET_i2s (&id), n->parent->peer); + FPRINTF (stderr, "(-> %s [%u])\n", GNUNET_i2s (&id), n->parent->peer); } else - fprintf (stderr, "(root)\n"); + FPRINTF (stderr, "%s", "(root)\n"); for (c = n->children_head; NULL != c; c = c->next) tree_node_debug (c, level + 1); } diff --git a/src/nat/gnunet-nat-server.c b/src/nat/gnunet-nat-server.c index 4b7e31ef8..0336ecc9d 100644 --- a/src/nat/gnunet-nat-server.c +++ b/src/nat/gnunet-nat-server.c @@ -284,7 +284,7 @@ run (void *cls, char *const *args, const char *cfgfile, if ((args[0] == NULL) || (1 != SSCANF (args[0], "%u", &port)) || (0 == port) || (65536 <= port)) { - fprintf (stderr, + FPRINTF (stderr, _ ("Please pass valid port number as the first argument! (got `%s')\n"), args[0]); diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index 801063b23..43743c47b 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c @@ -199,7 +199,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct NSEPeer *pos; #if VERBOSE - fprintf (stderr, "Ending test.\n"); + FPRINTF (stderr, "%s", "Ending test.\n"); #endif if (disconnect_task != GNUNET_SCHEDULER_NO_TASK) @@ -252,7 +252,7 @@ handle_estimate (void *cls, struct GNUNET_TIME_Absolute timestamp, GNUNET_free (output_buffer); } else - fprintf (stderr, + FPRINTF (stderr, "Received network size estimate from peer %s. Size: %f std.dev. %f\n", GNUNET_i2s (&peer->daemon->id), estimate, std_dev); diff --git a/src/nse/test_nse_api.c b/src/nse/test_nse_api.c index a2f73aaf4..7e0ab0bbc 100644 --- a/src/nse/test_nse_api.c +++ b/src/nse/test_nse_api.c @@ -93,7 +93,7 @@ check_nse_message (void *cls, struct GNUNET_TIME_Absolute timestamp, { int *ok = cls; - fprintf (stderr, + FPRINTF (stderr, "Received NSE message, estimate %f, standard deviation %f.\n", estimate, std_dev); /* Fantastic check below. Expect NaN, the only thing not equal to itself. */ @@ -162,7 +162,7 @@ check () GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping arm.\n"); stop_arm (&p1); if (0 != ok) - fprintf (stderr, "No information received from NSE service!\n"); + FPRINTF (stderr, "%s", "No information received from NSE service!\n"); return ok; } diff --git a/src/nse/test_nse_multipeer.c b/src/nse/test_nse_multipeer.c index 435cdabf4..4cd5e4349 100644 --- a/src/nse/test_nse_multipeer.c +++ b/src/nse/test_nse_multipeer.c @@ -93,7 +93,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) struct NSEPeer *pos; #if VERBOSE - fprintf (stderr, "Ending test.\n"); + FPRINTF (stderr, "%s", "Ending test.\n"); #endif while (NULL != (pos = peer_head)) @@ -122,7 +122,7 @@ handle_estimate (void *cls, struct GNUNET_TIME_Absolute timestamp, { struct NSEPeer *peer = cls; - fprintf (stderr, + FPRINTF (stderr, "Received network size estimate from peer %s. logSize: %f std.dev. %f (%f/%u)\n", GNUNET_i2s (&peer->daemon->id), estimate, std_dev, GNUNET_NSE_log_estimate_to_n (estimate), num_peers); @@ -136,7 +136,7 @@ connect_nse_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) unsigned int i; #if VERBOSE - fprintf (stderr, "TEST_NSE_MULTIPEER: connecting to nse service of peers\n"); + FPRINTF (stderr, "%s", "TEST_NSE_MULTIPEER: connecting to nse service of peers\n"); #endif for (i = 0; i < num_peers; i++) { diff --git a/src/peerinfo-tool/gnunet-peerinfo.c b/src/peerinfo-tool/gnunet-peerinfo.c index 337a9b2ab..21c996661 100644 --- a/src/peerinfo-tool/gnunet-peerinfo.c +++ b/src/peerinfo-tool/gnunet-peerinfo.c @@ -148,7 +148,7 @@ print_peer_info (void *cls, const struct GNUNET_PeerIdentity *peer, if (peer == NULL) { if (err_msg != NULL) - fprintf (stderr, _("Error in communication with PEERINFO service\n")); + FPRINTF (stderr, "%s", _("Error in communication with PEERINFO service\n")); GNUNET_PEERINFO_disconnect (peerinfo); return; } @@ -191,7 +191,7 @@ run (void *cls, char *const *args, const char *cfgfile, cfg = c; if (args[0] != NULL) { - fprintf (stderr, _("Invalid command line argument `%s'\n"), args[0]); + FPRINTF (stderr, _("Invalid command line argument `%s'\n"), args[0]); return; } if (get_self != GNUNET_YES) @@ -199,7 +199,7 @@ run (void *cls, char *const *args, const char *cfgfile, peerinfo = GNUNET_PEERINFO_connect (cfg); if (peerinfo == NULL) { - fprintf (stderr, _("Could not access PEERINFO service. Exiting.\n")); + FPRINTF (stderr, "%s", _("Could not access PEERINFO service. Exiting.\n")); return; } GNUNET_PEERINFO_iterate (peerinfo, NULL, @@ -213,14 +213,14 @@ run (void *cls, char *const *args, const char *cfgfile, GNUNET_CONFIGURATION_get_value_filename (cfg, "GNUNETD", "HOSTKEY", &fn)) { - fprintf (stderr, _("Could not find option `%s:%s' in configuration.\n"), + FPRINTF (stderr, _("Could not find option `%s:%s' in configuration.\n"), "GNUNETD", "HOSTKEYFILE"); return; } priv = GNUNET_CRYPTO_rsa_key_create_from_file (fn); if (priv == NULL) { - fprintf (stderr, _("Loading hostkey from `%s' failed.\n"), fn); + FPRINTF (stderr, _("Loading hostkey from `%s' failed.\n"), fn); GNUNET_free (fn); return; } diff --git a/src/peerinfo/perf_peerinfo_api.c b/src/peerinfo/perf_peerinfo_api.c index 38bbb828f..e69b487d5 100755 --- a/src/peerinfo/perf_peerinfo_api.c +++ b/src/peerinfo/perf_peerinfo_api.c @@ -56,7 +56,7 @@ check_it (void *cls, const struct GNUNET_HELLO_Address *address, #if DEBUG if (addrlen > 0) { - fprintf (stderr, "name: %s, addr: %s\n", tname, (const char *) addr); + FPRINTF (stderr, "name: %s, addr: %s\n", tname, (const char *) addr); } #endif return GNUNET_OK; @@ -110,13 +110,13 @@ process (void *cls, const struct GNUNET_PeerIdentity *peer, if (peer == NULL) { #if DEBUG - fprintf (stderr, "Process received NULL response\n"); + FPRINTF (stderr, "Process received NULL response\n"); #endif } else { #if DEBUG - fprintf (stderr, "Processed a peer\n"); + FPRINTF (stderr, "Processed a peer\n"); #endif numpeers++; if (0 && (hello != NULL)) @@ -179,7 +179,7 @@ check () GNUNET_assert (NULL != proc); GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, argv, "perf-peerinfo-api", "nohelp", options, &run, &ok); - fprintf (stderr, "Received %u/%u calls before timeout\n", numpeers, + FPRINTF (stderr, "Received %u/%u calls before timeout\n", numpeers, NUM_REQUESTS * NUM_REQUESTS / 2); GAUGER ("PEERINFO", "Peerinfo lookups", numpeers / 30, "peers/s"); #if START_SERVICE diff --git a/src/statistics/gnunet-statistics.c b/src/statistics/gnunet-statistics.c index 0f2c92582..7fe78161c 100644 --- a/src/statistics/gnunet-statistics.c +++ b/src/statistics/gnunet-statistics.c @@ -95,7 +95,7 @@ cleanup (void *cls, int success) if (success != GNUNET_OK) { - fprintf (stderr, _("Failed to obtain statistics.\n")); + FPRINTF (stderr, _("Failed to obtain statistics.\n"),NULL); ret = 1; } if (h != NULL) diff --git a/src/testing/test_testing_large_topology.c b/src/testing/test_testing_large_topology.c index e966ca137..2bca7b3b9 100644 --- a/src/testing/test_testing_large_topology.c +++ b/src/testing/test_testing_large_topology.c @@ -245,7 +245,7 @@ finish_testing () if (dotOutFile != NULL) { - fprintf (dotOutFile, "}"); + FPRINTF (dotOutFile, "%s", "}"); fclose (dotOutFile); } @@ -290,19 +290,19 @@ topology_cb (void *cls, const struct GNUNET_PeerIdentity *first, { if (outfile != NULL) { - fprintf (outfile, "\t\"%s\" -- ", GNUNET_i2s (first)); - fprintf (outfile, "\"%s\";\n", GNUNET_i2s (second)); + FPRINTF (outfile, "\t\"%s\" -- ", GNUNET_i2s (first)); + FPRINTF (outfile, "\"%s\";\n", GNUNET_i2s (second)); } topology_connections++; } else { - fprintf (stderr, + FPRINTF (stderr, "Finished iterating over topology, %d total connections!\n", topology_connections); if (outfile != NULL) { - fprintf (outfile, "}\n"); + FPRINTF (outfile, "%s", "}\n"); fclose (outfile); GNUNET_SCHEDULER_add_now (&finish_testing, NULL); } @@ -326,16 +326,16 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, if ((total_messages_received) % modnum == 0) { if (total_messages_received == 0) - fprintf (stdout, "0%%"); + FPRINTF (stdout, "%s", "0%%"); else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) total_messages_received / expected_messages) * 100)); } else if (total_messages_received % dotnum == 0) { - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); } fflush (stdout); #endif @@ -354,7 +354,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, if (total_messages_received == expected_messages) { #if VERBOSE - fprintf (stdout, "100%%]\n"); + FPRINTF (stdout, "%s", "100%%]\n"); #endif GNUNET_SCHEDULER_cancel (die_task); GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology"); @@ -362,7 +362,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_free (dotOutFileNameFinished); if (dotOutFileFinished != NULL) { - fprintf (dotOutFileFinished, "strict graph G {\n"); + FPRINTF (dotOutFileFinished, "%s", "strict graph G {\n"); } topology_connections = 0; GNUNET_TESTING_get_topology (pg, &topology_cb, dotOutFileFinished); @@ -424,7 +424,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (dotOutFile != NULL) { - fprintf (dotOutFile, "}"); + FPRINTF (dotOutFile, "%s", "}"); fclose (dotOutFile); } } @@ -639,16 +639,16 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, if ((total_connections) % modnum == 0) { if (total_connections == 0) - fprintf (stdout, "0%%"); + FPRINTF (stdout, "%s", "0%%"); else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) total_connections / expected_connections) * 100)); } else if (total_connections % dotnum == 0) { - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); } fflush (stdout); #endif @@ -667,7 +667,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, expected_messages++; if (dotOutFile != NULL) - fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, + FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, second_daemon->shortname); } #if VERBOSE @@ -683,7 +683,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, if (total_connections == expected_connections) { #if VERBOSE - fprintf (stdout, "100%%]\n"); + FPRINTF (stdout, "%s", "100%%]\n"); #endif #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -695,7 +695,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_NO_TASK; #if DELAY_FOR_LOGGING - fprintf (stdout, "Sending test messages in 10 seconds.\n"); + FPRINTF (stdout, "%s", "Sending test messages in 10 seconds.\n"); GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10), &send_test_messages, test_messages); @@ -709,7 +709,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, test_messages); #endif #if VERBOSE - fprintf (stdout, "Test message progress: ["); + FPRINTF (stdout, "%s", "Test message progress: ["); #endif } @@ -784,7 +784,7 @@ connect_topology () modnum = expected_connections / 4; dotnum = (expected_connections / 50) + 1; #if VERBOSE - fprintf (stdout, "Peer connection progress: ["); + FPRINTF (stdout, "%s", "Peer connection progress: ["); #endif } @@ -798,7 +798,7 @@ create_topology () #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Topology set up, now starting peers!\n"); - fprintf (stdout, "Daemon start progress ["); + FPRINTF (stdout, "%s", "Daemon start progress ["); #endif GNUNET_TESTING_daemons_continue_startup (pg); } @@ -836,15 +836,15 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, if ((num_peers - peers_left) % modnum == 0) { if (num_peers - peers_left == 0) - fprintf (stdout, "0%%"); + FPRINTF (stdout, "%s", "0%%"); else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) (num_peers - peers_left) / num_peers) * 100)); } else if ((num_peers - peers_left) % dotnum == 0) { - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); } fflush (stdout); #endif @@ -852,7 +852,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, if (peers_left == 0) { #if VERBOSE - fprintf (stdout, "100%%]\n"); + FPRINTF (stdout, "%s", "100%%]\n"); #endif #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -865,7 +865,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, GNUNET_SCHEDULER_add_delayed (timeout, &end_badly, "from peers_started_callback"); #if DELAY_FOR_LOGGING - fprintf (stdout, "Connecting topology in 10 seconds\n"); + FPRINTF (stdout, "%s", "Connecting topology in 10 seconds\n"); gather_log_data (); GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10), @@ -905,15 +905,15 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, if ((num_peers - peers_left) % modnum == 0) { if (num_peers - peers_left == 0) - fprintf (stdout, "0%%"); + FPRINTF (stdout, "%s", "0%%"); else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) (num_peers - peers_left) / num_peers) * 100)); } else if ((num_peers - peers_left) % dotnum == 0) { - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); } fflush (stdout); #endif @@ -921,7 +921,7 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, if (peers_left == 0) { #if VERBOSE - fprintf (stdout, "100%%]\n"); + FPRINTF (stdout, "%s", "100%%]\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All %d hostkeys created, now creating topology!\n", num_peers); #endif @@ -952,7 +952,7 @@ run (void *cls, char *const *args, const char *cfgfile, dotOutFile = fopen (dotOutFileName, "w"); if (dotOutFile != NULL) { - fprintf (dotOutFile, "strict graph G {\n"); + FPRINTF (dotOutFile, "%s", "strict graph G {\n"); } #if VERBOSE @@ -1101,7 +1101,7 @@ run (void *cls, char *const *args, const char *cfgfile, modnum = num_peers / 4; dotnum = (num_peers / 50) + 1; #if VERBOSE - fprintf (stdout, "Hostkey generation progress: ["); + FPRINTF (stdout, "%s", "Hostkey generation progress: ["); #endif /* Set up a task to end testing if peer start fails */ die_task = diff --git a/src/testing/test_testing_reconnect.c b/src/testing/test_testing_reconnect.c index 20c628c6a..bcee38659 100644 --- a/src/testing/test_testing_reconnect.c +++ b/src/testing/test_testing_reconnect.c @@ -72,11 +72,11 @@ end2_cb (void *cls, const char *emsg) { if (phase < NUM_PHASES) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); run_phase (); return; } - fprintf (stderr, ".\n"); + FPRINTF (stderr, "%s", ".\n"); #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Both daemons terminated, will now exit.\n"); @@ -129,8 +129,8 @@ my_connect_complete (void *cls, const struct GNUNET_PeerIdentity *first, { cc = NULL; #if VERBOSE - fprintf (stderr, "Peer %s ", GNUNET_i2s (first)); - fprintf (stderr, "connected to %s\n", GNUNET_i2s (second)); + FPRINTF (stderr, "Peer %s ", GNUNET_i2s (first)); + FPRINTF (stderr, "connected to %s\n", GNUNET_i2s (second)); #endif GNUNET_SCHEDULER_add_now (&finish_testing, NULL); } diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c index 7d0c0da5f..17f3be89a 100644 --- a/src/testing/test_testing_topology.c +++ b/src/testing/test_testing_topology.c @@ -253,8 +253,8 @@ finish_testing () if (dotOutFile != NULL) { - fprintf (dotOutFile, "}"); - fclose (dotOutFile); + FPRINTF (dotOutFile, "%s", "}"); + FCLOSE (dotOutFile); } ok = 0; @@ -326,19 +326,19 @@ topology_cb (void *cls, const struct GNUNET_PeerIdentity *first, { if (outfile != NULL) { - fprintf (outfile, "\t\"%s\" -- ", GNUNET_i2s (first)); - fprintf (outfile, "\"%s\";\n", GNUNET_i2s (second)); + FPRINTF (outfile, "\t\"%s\" -- ", GNUNET_i2s (first)); + FPRINTF (outfile, "\"%s\";\n", GNUNET_i2s (second)); } topology_connections++; } else { - fprintf (stderr, + FPRINTF (stderr, "Finished iterating over topology, %d total connections!\n", topology_connections); if (outfile != NULL) { - fprintf (outfile, "}\n"); + FPRINTF (outfile, "%s", "}\n"); fclose (outfile); #if DO_STATS GNUNET_TESTING_get_statistics (pg, &stats_finished, &stats_print, NULL); @@ -366,16 +366,16 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, if ((total_messages_received) % modnum == 0) { if (total_messages_received == 0) - fprintf (stdout, "0%%"); + FPRINTF (stdout, "%s", "0%%"); else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) total_messages_received / expected_messages) * 100)); } else if (total_messages_received % dotnum == 0) { - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); } fflush (stdout); #endif @@ -394,7 +394,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, if (total_messages_received == expected_messages) { #if PROGRESS_BARS - fprintf (stdout, "100%%]\n"); + FPRINTF (stdout, "%s", "100%%]\n"); #endif GNUNET_SCHEDULER_cancel (die_task); GNUNET_asprintf (&dotOutFileNameFinished, "%s.dot", "final_topology"); @@ -402,7 +402,7 @@ process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_free (dotOutFileNameFinished); if (dotOutFileFinished != NULL) { - fprintf (dotOutFileFinished, "strict graph G {\n"); + FPRINTF (dotOutFileFinished, "%s", "strict graph G {\n"); } topology_connections = 0; GNUNET_TESTING_get_topology (pg, &topology_cb, dotOutFileFinished); @@ -464,7 +464,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (dotOutFile != NULL) { - fprintf (dotOutFile, "}"); + FPRINTF (dotOutFile, "%s", "}"); fclose (dotOutFile); } } @@ -680,16 +680,16 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, if ((total_connections) % modnum == 0) { if (total_connections == 0) - fprintf (stdout, "0%%"); + FPRINTF (stdout, "%s", "0%%"); else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) total_connections / expected_connections) * 100)); } else if (total_connections % dotnum == 0) { - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); } fflush (stdout); #endif @@ -708,7 +708,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, expected_messages++; if (dotOutFile != NULL) - fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, + FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, second_daemon->shortname); } #if VERBOSE @@ -724,7 +724,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, if (total_connections == expected_connections) { #if PROGRESS_BARS - fprintf (stdout, "100%%]\n"); + FPRINTF (stdout, "%s", "100%%]\n"); #endif #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -740,7 +740,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_NO_TASK; #if DELAY_FOR_LOGGING - fprintf (stdout, "Sending test messages in 10 seconds.\n"); + FPRINTF (stdout, "%s", "Sending test messages in 10 seconds.\n"); GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10), &send_test_messages, test_messages); @@ -754,7 +754,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, test_messages); #endif #if PROGRESS_BARS - fprintf (stdout, "Test message progress: ["); + FPRINTF (stdout, "%s", "Test message progress: ["); #endif } @@ -837,7 +837,7 @@ connect_topology () if (dotnum == 0) dotnum = 1; #if PROGRESS_BARS - fprintf (stdout, "Peer connection progress: ["); + FPRINTF (stdout, "%s", "Peer connection progress: ["); #endif } @@ -851,7 +851,7 @@ create_topology () #if PROGRESS_BARS GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Topology set up, now starting peers!\n"); - fprintf (stdout, "Daemon start progress ["); + FPRINTF (stdout, "%s", "Daemon start progress ["); #endif GNUNET_TESTING_daemons_continue_startup (pg); } @@ -892,15 +892,15 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, if ((num_peers - peers_left) % modnum == 0) { if (num_peers - peers_left == 0) - fprintf (stdout, "0%%"); + FPRINTF (stdout, "%s", "0%%"); else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) (num_peers - peers_left) / num_peers) * 100)); } else if ((num_peers - peers_left) % dotnum == 0) { - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); } fflush (stdout); #endif @@ -908,7 +908,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, if (peers_left == 0) { #if PROGRESS_BARS - fprintf (stdout, "100%%]\n"); + FPRINTF (stdout, "%s", "100%%]\n"); #endif #if VERBOSE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, @@ -922,7 +922,7 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id, (GNUNET_TIME_UNIT_MINUTES, 8), &end_badly, "from peers_started_callback"); #if DELAY_FOR_LOGGING - fprintf (stdout, "Connecting topology in 10 seconds\n"); + FPRINTF (stdout, "%s", "Connecting topology in 10 seconds\n"); gather_log_data (); GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 10), @@ -962,15 +962,15 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, if ((num_peers - peers_left) % modnum == 0) { if (num_peers - peers_left == 0) - fprintf (stdout, "0%%"); + FPRINTF (stdout, "%s", "0%%"); else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) (num_peers - peers_left) / num_peers) * 100)); } else if ((num_peers - peers_left) % dotnum == 0) { - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); } fflush (stdout); #endif @@ -978,7 +978,7 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, if (peers_left == 0) { #if PROGRESS_BARS - fprintf (stdout, "100%%]\n"); + FPRINTF (stdout, "%s", "100%%]\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All %d hostkeys created, now creating topology!\n", num_peers); #endif @@ -1009,7 +1009,7 @@ run (void *cls, char *const *args, const char *cfgfile, dotOutFile = fopen (dotOutFileName, "w"); if (dotOutFile != NULL) { - fprintf (dotOutFile, "strict graph G {\n"); + FPRINTF (dotOutFile, "%s", "strict graph G {\n"); } #if VERBOSE @@ -1156,7 +1156,7 @@ run (void *cls, char *const *args, const char *cfgfile, if (dotnum == 0) dotnum = 1; #if PROGRESS_BARS - fprintf (stdout, "Hostkey generation progress: ["); + FPRINTF (stdout, "%s", "Hostkey generation progress: ["); #endif /* Set up a task to end testing if peer start fails */ die_task = diff --git a/src/testing/test_testing_topology_blacklist.c b/src/testing/test_testing_topology_blacklist.c index 095c5b2a2..9ff1fcbaa 100644 --- a/src/testing/test_testing_topology_blacklist.c +++ b/src/testing/test_testing_topology_blacklist.c @@ -142,7 +142,7 @@ finish_testing () #endif if (dotOutFile != NULL) { - fprintf (dotOutFile, "}"); + FPRINTF (dotOutFile, "%s", "}"); fclose (dotOutFile); } @@ -167,7 +167,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (dotOutFile != NULL) { - fprintf (dotOutFile, "}"); + FPRINTF (dotOutFile, "%s", "}"); fclose (dotOutFile); } } @@ -191,7 +191,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, first_daemon->shortname, second_daemon->shortname); #endif if (dotOutFile != NULL) - fprintf (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, + FPRINTF (dotOutFile, "\tn%s -- n%s;\n", first_daemon->shortname, second_daemon->shortname); } @@ -399,7 +399,7 @@ run (void *cls, char *const *args, const char *cfgfile, dotOutFile = fopen (dotOutFileName, "w"); if (dotOutFile != NULL) { - fprintf (dotOutFile, "strict graph G {\n"); + FPRINTF (dotOutFile, "%s", "strict graph G {\n"); } #if VERBOSE diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index f56c51381..4f67179c1 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c @@ -1115,17 +1115,17 @@ update_meter (struct ProgressMeter *meter) { if (meter->completed == 0) { - fprintf (stdout, "%sProgress: [0%%", meter->startup_string); + FPRINTF (stdout, "%sProgress: [0%%", meter->startup_string); } else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) meter->completed / meter->total) * 100)); } else if (meter->completed % meter->dotnum == 0) - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); if (meter->completed + 1 == meter->total) - fprintf (stdout, "%d%%]\n", 100); + FPRINTF (stdout, "%d%%]\n", 100); fflush (stdout); } meter->completed++; @@ -2810,7 +2810,7 @@ friend_file_iterator (void *cls, const GNUNET_HashCode * key, void *value) temppeer = &peer->id; GNUNET_CRYPTO_hash_to_enc (&temppeer->hashPubKey, &peer_enc); - fprintf (temp_friend_handle, "%s\n", (char *) &peer_enc); + FPRINTF (temp_friend_handle, "%s\n", (char *) &peer_enc); return GNUNET_YES; } @@ -2849,7 +2849,7 @@ blacklist_file_iterator (void *cls, const GNUNET_HashCode * key, void *value) GNUNET_CRYPTO_hash_to_enc (&temppeer->hashPubKey, &peer_enc); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Writing entry %s:%s to file\n", blacklist_ctx->transport, (char *) &peer_enc); - fprintf (blacklist_ctx->temp_file_handle, "%s:%s\n", blacklist_ctx->transport, + FPRINTF (blacklist_ctx->temp_file_handle, "%s:%s\n", blacklist_ctx->transport, (char *) &peer_enc); return GNUNET_YES; @@ -2899,7 +2899,7 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg) { GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon-> id.hashPubKey, &peer_enc); - fprintf (temp_friend_handle, "%s\n", (char *) &peer_enc); + FPRINTF (temp_friend_handle, "%s\n", (char *) &peer_enc); conn_iter = conn_iter->next; } #else @@ -3086,7 +3086,7 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg, { GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon-> id.hashPubKey, &peer_enc); - fprintf (temp_file_handle, "%s:%s\n", pos, (char *) &peer_enc); + FPRINTF (temp_file_handle, "%s:%s\n", pos, (char *) &peer_enc); conn_iter = conn_iter->next; } #else diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c index bf69a7fc8..a34cb5abe 100644 --- a/src/testing/testing_peergroup.c +++ b/src/testing/testing_peergroup.c @@ -210,17 +210,17 @@ update_meter (struct ProgressMeter *meter) { if (meter->completed == 0) { - fprintf (stdout, "%sProgress: [0%%", meter->startup_string); + FPRINTF (stdout, "%sProgress: [0%%", meter->startup_string); } else - fprintf (stdout, "%d%%", + FPRINTF (stdout, "%d%%", (int) (((float) meter->completed / meter->total) * 100)); } else if (meter->completed % meter->dotnum == 0) - fprintf (stdout, "."); + FPRINTF (stdout, "%s", "."); if (meter->completed + 1 == meter->total) - fprintf (stdout, "%d%%]\n", 100); + FPRINTF (stdout, "%d%%]\n", 100); fflush (stdout); } meter->completed++; diff --git a/src/topology/test_gnunet_daemon_topology.c b/src/topology/test_gnunet_daemon_topology.c index 9d8f1633d..65a313d44 100644 --- a/src/topology/test_gnunet_daemon_topology.c +++ b/src/topology/test_gnunet_daemon_topology.c @@ -110,7 +110,7 @@ notify_connect_complete (void *cls, const struct GNUNET_PeerIdentity *first, *cc = NULL; if (NULL != emsg) { - fprintf (stderr, "Failed to connect two peers: %s\n", emsg); + FPRINTF (stderr, "Failed to connect two peers: %s\n", emsg); for (i = 0; i < NUM_PEERS; i++) if (NULL != cc[i]) { diff --git a/src/transport/gnunet-transport-connect-running-peers.c b/src/transport/gnunet-transport-connect-running-peers.c index 172f34b27..8ba81891f 100644 --- a/src/transport/gnunet-transport-connect-running-peers.c +++ b/src/transport/gnunet-transport-connect-running-peers.c @@ -73,7 +73,7 @@ char *cfg_file_p1; char *cfg_file_p2; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif @@ -368,7 +368,7 @@ main (int argc, char *argv[]) if (argc < 3) { - fprintf (stderr, + FPRINTF (stderr, "usage gnunet-transport-connect-running-peers \n"); return -1; } diff --git a/src/transport/gnunet-transport.c b/src/transport/gnunet-transport.c index 02a5ee492..17a21dd28 100644 --- a/src/transport/gnunet-transport.c +++ b/src/transport/gnunet-transport.c @@ -167,11 +167,11 @@ display_test_result (struct TestContext *tc, int result) { if (GNUNET_YES != result) { - fprintf (stderr, "Configuration for plugin `%s' did not work!\n", tc->name); + FPRINTF (stderr, "Configuration for plugin `%s' did not work!\n", tc->name); } else { - fprintf (stderr, "Configuration for plugin `%s' is working!\n", tc->name); + FPRINTF (stderr, "Configuration for plugin `%s' is working!\n", tc->name); } if (GNUNET_SCHEDULER_NO_TASK != tc->tsk) { @@ -245,9 +245,9 @@ do_test_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg) GNUNET_CONFIGURATION_get_value_string (cfg, "transport", "plugins", &plugins)) { - fprintf (stderr, + FPRINTF (stderr, _ - ("No transport plugins configured, peer will never communicate\n")); + ("No transport plugins configured, peer will never communicate\n"), NULL); ret = 4; return; } @@ -259,7 +259,7 @@ do_test_configuration (const struct GNUNET_CONFIGURATION_Handle *cfg) if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (cfg, section, "PORT", &bnd_port)) { - fprintf (stderr, + FPRINTF (stderr, _("No port configured for plugin `%s', cannot test it\n"), tok); continue; } @@ -310,14 +310,14 @@ do_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (benchmark_receive) { duration = GNUNET_TIME_absolute_get_duration (start_time); - fprintf (stdout, _("Received %llu bytes/s (%llu bytes in %llu ms)\n"), + FPRINTF (stdout, _("Received %llu bytes/s (%llu bytes in %llu ms)\n"), 1000 * traffic_received / (1 + duration.rel_value), traffic_received, (unsigned long long) duration.rel_value); } if (benchmark_send) { duration = GNUNET_TIME_absolute_get_duration (start_time); - fprintf (stdout, _("Transmitted %llu bytes/s (%llu bytes in %llu ms)\n"), + FPRINTF (stdout, _("Transmitted %llu bytes/s (%llu bytes in %llu ms)\n"), 1000 * traffic_sent / (1 + duration.rel_value), traffic_sent, (unsigned long long) duration.rel_value); } @@ -350,7 +350,7 @@ transmit_data (void *cls, size_t size, void *buf) GNUNET_TIME_UNIT_FOREVER_REL, &transmit_data, NULL); if (verbosity > 0) - fprintf (stdout, _("Transmitting %u bytes to %s\n"), (unsigned int) size, + FPRINTF (stdout, _("Transmitting %u bytes to %s\n"), (unsigned int) size, GNUNET_i2s (&pid)); return size; } @@ -370,7 +370,7 @@ notify_connect (void *cls, const struct GNUNET_PeerIdentity *peer, const struct GNUNET_ATS_Information *ats, uint32_t ats_count) { if (verbosity > 0) - fprintf (stdout, _("Connected to %s\n"), GNUNET_i2s (peer)); + FPRINTF (stdout, _("Connected to %s\n"), GNUNET_i2s (peer)); if (0 != memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity))) return; ret = 0; @@ -401,7 +401,7 @@ static void notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) { if (verbosity > 0) - fprintf (stdout, _("Disconnected from %s\n"), GNUNET_i2s (peer)); + FPRINTF (stdout, _("Disconnected from %s\n"), GNUNET_i2s (peer)); if ((0 == memcmp (&pid, peer, sizeof (struct GNUNET_PeerIdentity))) && (NULL != th)) { @@ -430,7 +430,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, if (!benchmark_receive) return; if (verbosity > 0) - fprintf (stdout, _("Received %u bytes from %s\n"), + FPRINTF (stdout, _("Received %u bytes from %s\n"), (unsigned int) ntohs (message->size), GNUNET_i2s (peer)); if (traffic_received == 0) start_time = GNUNET_TIME_absolute_get (); @@ -444,7 +444,7 @@ process_string (void *cls, const char *address) if ((address != NULL)) { - fprintf (stdout, _("Peer `%s': %s %s\n"), GNUNET_i2s (&addrcp->peer), addrcp->transport_name, address); + FPRINTF (stdout, _("Peer `%s': %s %s\n"), GNUNET_i2s (&addrcp->peer), addrcp->transport_name, address); } else { @@ -499,7 +499,7 @@ run (void *cls, char *const *args, const char *cfgfile, } if (benchmark_send && (NULL == cpid)) { - fprintf (stderr, _("Option `%s' makes no sense without option `%s'.\n"), + FPRINTF (stderr, _("Option `%s' makes no sense without option `%s'.\n"), "-s", "-C"); return; } @@ -508,7 +508,7 @@ run (void *cls, char *const *args, const char *cfgfile, ret = 1; if (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (cpid, &pid.hashPubKey)) { - fprintf (stderr, _("Failed to parse peer identity `%s'\n"), cpid); + FPRINTF (stderr, _("Failed to parse peer identity `%s'\n"), cpid); return; } handle = diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index 5d9cfff19..0ef708b62 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c @@ -130,7 +130,7 @@ static struct GNUNET_TIME_Absolute start_time; */ #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif @@ -147,7 +147,7 @@ end () delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value; datarate = (total_bytes_sent * 1000) / delta; - fprintf (stderr, "Throughput was %llu b/s\n", datarate); + FPRINTF (stderr, "Throughput was %llu b/s\n", datarate); test_failed = GNUNET_NO; if (datarate > quota_in_p2) @@ -365,7 +365,7 @@ notify_ready (void *cls, size_t size, void *buf) total_bytes_sent += ret; if (n == TOTAL_MSGS) { - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages sent\n"); } return ret; @@ -417,12 +417,12 @@ measure (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) counter++; if ((DURATION.rel_value / 1000) < counter) { - fprintf (stderr, ".\n"); + FPRINTF (stderr, "%s", ".\n"); GNUNET_SCHEDULER_add_now (&end, NULL); } else { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); measure_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, &measure, NULL); } diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index dd0704231..1058f2b6b 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c @@ -81,7 +81,7 @@ char *cfg_file_p1; char *cfg_file_p2; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif diff --git a/src/transport/test_transport_api_bidirectional_connect.c b/src/transport/test_transport_api_bidirectional_connect.c index 20005deab..b4a3ca41d 100644 --- a/src/transport/test_transport_api_bidirectional_connect.c +++ b/src/transport/test_transport_api_bidirectional_connect.c @@ -80,7 +80,7 @@ char *cfg_file_p1; char *cfg_file_p2; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c index 026ed085a..1a73bcb5f 100644 --- a/src/transport/test_transport_api_disconnect.c +++ b/src/transport/test_transport_api_disconnect.c @@ -80,7 +80,7 @@ char *cfg_file_p1; char *cfg_file_p2; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif diff --git a/src/transport/test_transport_api_limited_sockets.c b/src/transport/test_transport_api_limited_sockets.c index 7fb13e261..d1aa6e40d 100644 --- a/src/transport/test_transport_api_limited_sockets.c +++ b/src/transport/test_transport_api_limited_sockets.c @@ -84,7 +84,7 @@ char *cfg_file_p1; char *cfg_file_p2; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif diff --git a/src/transport/test_transport_api_reliability.c b/src/transport/test_transport_api_reliability.c index ac360a3ea..eb03564d5 100644 --- a/src/transport/test_transport_api_reliability.c +++ b/src/transport/test_transport_api_reliability.c @@ -123,7 +123,7 @@ static struct GNUNET_TIME_Absolute start_time; */ #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif @@ -139,7 +139,7 @@ end () GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value; - fprintf (stderr, "\nThroughput was %llu kb/s\n", + FPRINTF (stderr, "\nThroughput was %llu kb/s\n", total_bytes * 1000 / 1024 / delta); GNUNET_asprintf (&value_name, "reliable_%s", test_plugin); GAUGER ("TRANSPORT", value_name, (int) (total_bytes * 1000 / 1024 / delta), @@ -267,7 +267,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, n++; if (0 == (n % (TOTAL_MSGS / 100))) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (die_task != GNUNET_SCHEDULER_NO_TASK) GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); @@ -353,7 +353,7 @@ notify_ready (void *cls, size_t size, void *buf) total_bytes += ret; if (n == TOTAL_MSGS) { - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages sent\n"); } return ret; diff --git a/src/transport/test_transport_api_restart_1peer.c b/src/transport/test_transport_api_restart_1peer.c index 61423a7ee..22c603565 100644 --- a/src/transport/test_transport_api_restart_1peer.c +++ b/src/transport/test_transport_api_restart_1peer.c @@ -80,7 +80,7 @@ char *cfg_file_p2; static int restarted; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif diff --git a/src/transport/test_transport_api_restart_2peers.c b/src/transport/test_transport_api_restart_2peers.c index 67cc90f0e..3de91d62a 100644 --- a/src/transport/test_transport_api_restart_2peers.c +++ b/src/transport/test_transport_api_restart_2peers.c @@ -80,7 +80,7 @@ char *cfg_file_p2; static int restarted; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif diff --git a/src/transport/test_transport_api_timeout.c b/src/transport/test_transport_api_timeout.c index 29f7dd4af..35279ff76 100644 --- a/src/transport/test_transport_api_timeout.c +++ b/src/transport/test_transport_api_timeout.c @@ -87,7 +87,7 @@ static int disconnects; #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif @@ -210,13 +210,13 @@ timer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (time_running.rel_value == GNUNET_TIME_relative_max (time_running, WAIT).rel_value) { - fprintf (stderr, "100%%\n"); + FPRINTF (stderr, "%s", "100%%\n"); shutdown_flag = GNUNET_YES; GNUNET_SCHEDULER_add_now (&end, NULL); } else { - fprintf (stderr, "%u%%..", percentage); + FPRINTF (stderr, "%u%%..", percentage); timer_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide (WAIT, 10), &timer, NULL); diff --git a/src/transport/test_transport_api_unreliability.c b/src/transport/test_transport_api_unreliability.c index 2120f7044..413daabc9 100644 --- a/src/transport/test_transport_api_unreliability.c +++ b/src/transport/test_transport_api_unreliability.c @@ -126,7 +126,7 @@ static GNUNET_TRANSPORT_TESTING_ConnectRequest cc; */ #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif @@ -144,7 +144,7 @@ end () GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value; - fprintf (stderr, "\nThroughput was %llu kb/s\n", + FPRINTF (stderr, "\nThroughput was %llu kb/s\n", total_bytes * 1000 / 1024 / delta); GNUNET_asprintf (&value_name, "unreliable_%s", test_plugin); GAUGER ("TRANSPORT", value_name, (int) (total_bytes * 1000 / 1024 / delta), @@ -337,7 +337,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, test_sending = GNUNET_YES; if (0 == (n % (TOTAL_MSGS / 100))) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (GNUNET_SCHEDULER_NO_TASK != die_task) GNUNET_SCHEDULER_cancel (die_task); die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); @@ -410,7 +410,7 @@ notify_ready (void *cls, size_t size, void *buf) } else { - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent\n"); if (GNUNET_SCHEDULER_NO_TASK != die_task) GNUNET_SCHEDULER_cancel (die_task); diff --git a/src/transport/test_transport_api_unreliability_constant.c b/src/transport/test_transport_api_unreliability_constant.c index 3770ebfdb..52bf63833 100644 --- a/src/transport/test_transport_api_unreliability_constant.c +++ b/src/transport/test_transport_api_unreliability_constant.c @@ -124,7 +124,7 @@ static struct GNUNET_TIME_Absolute start_time; */ #if VERBOSE -#define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) +#define OKPP do { ok++; FPRINTF (stderr, "Now at stage %u at %s:%u\n", ok, __FILE__, __LINE__); } while (0) #else #define OKPP do { ok++; } while (0) #endif @@ -142,7 +142,7 @@ end () GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n"); delta = GNUNET_TIME_absolute_get_duration (start_time).rel_value; - fprintf (stderr, "\nThroughput was %llu kb/s\n", + FPRINTF (stderr, "\nThroughput was %llu kb/s\n", total_bytes * 1000 / 1024 / delta); GNUNET_asprintf (&value_name, "unreliable_%s", test_plugin); GAUGER ("TRANSPORT", value_name, (int) (total_bytes * 1000 / 1024 / delta), @@ -281,7 +281,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, n++; if (0 == (n % (TOTAL_MSGS / 100))) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (GNUNET_SCHEDULER_NO_TASK != die_task) GNUNET_SCHEDULER_cancel (die_task); test_failed = GNUNET_YES; @@ -291,7 +291,7 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, { /* because of starting with 0 */ msg_recv++; - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); end (); } } @@ -356,7 +356,7 @@ notify_ready (void *cls, size_t size, void *buf) } else { - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "All messages scheduled to be sent!!\n"); if (GNUNET_SCHEDULER_NO_TASK != die_task) diff --git a/src/transport/test_transport_startonly.c b/src/transport/test_transport_startonly.c index c6215c9bc..36d9b18d3 100644 --- a/src/transport/test_transport_startonly.c +++ b/src/transport/test_transport_startonly.c @@ -124,7 +124,7 @@ run (void *cls, char *const *args, const char *cfgfile, timeout_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT, &end_badly, NULL); i = 1; - fprintf (stderr, "%i", i); + FPRINTF (stderr, "%i", i); while (i <= ITERATIONS) { GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Starting peer\n"); @@ -147,12 +147,12 @@ run (void *cls, char *const *args, const char *cfgfile, i++; if (i <= ITERATIONS) - fprintf (stderr, "..%i", i); + FPRINTF (stderr, "..%i", i); } tth = GNUNET_TRANSPORT_TESTING_init (); - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); end (); } diff --git a/src/util/common_logging.c b/src/util/common_logging.c index c358e6fd8..72a2c67da 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c @@ -680,7 +680,7 @@ output_message (enum GNUNET_ErrorType kind, const char *comp, if (GNUNET_stderr != NULL) { - fprintf (GNUNET_stderr, "%s %s %s %s", datestr, comp, + FPRINTF (GNUNET_stderr, "%s %s %s %s", datestr, comp, GNUNET_error_type_to_string (kind), msg); fflush (GNUNET_stderr); } diff --git a/src/util/configuration.c b/src/util/configuration.c index 41a4e1975..eb86d0496 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c @@ -309,7 +309,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, sec = cfg->sections; while (sec != NULL) { - if (0 > fprintf (fp, "[%s]\n", sec->name)) + if (0 > FPRINTF (fp, "[%s]\n", sec->name)) { error = 1; break; @@ -327,7 +327,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, pos[0] = '\\'; pos[1] = 'n'; } - if (0 > fprintf (fp, "%s = %s\n", ent->key, val)) + if (0 > FPRINTF (fp, "%s = %s\n", ent->key, val)) { error = 1; GNUNET_free (val); @@ -339,7 +339,7 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, } if (error != 0) break; - if (0 > fprintf (fp, "\n")) + if (0 > FPRINTF (fp, "%s\n", "")) { error = 1; break; diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c index ff20646f7..121dbef9a 100644 --- a/src/util/crypto_random.c +++ b/src/util/crypto_random.c @@ -303,7 +303,7 @@ void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init () gcry_control (GCRYCTL_DISABLE_SECMEM, 0); if (!gcry_check_version (GCRYPT_VERSION)) { - fprintf (stderr, + FPRINTF (stderr, _ ("libgcrypt has not the expected version (version %s is required).\n"), GCRYPT_VERSION); diff --git a/src/util/getopt.c b/src/util/getopt.c index 08c133423..169949821 100644 --- a/src/util/getopt.c +++ b/src/util/getopt.c @@ -669,7 +669,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, if (ambig && !exact) { if (GNopterr) - fprintf (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], + FPRINTF (stderr, _("%s: option `%s' is ambiguous\n"), argv[0], argv[GNoptind]); nextchar += strlen (nextchar); GNoptind++; @@ -692,12 +692,12 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, { if (argv[GNoptind - 1][1] == '-') /* --option */ - fprintf (stderr, + FPRINTF (stderr, _("%s: option `--%s' does not allow an argument\n"), argv[0], pfound->name); else /* +option or -option */ - fprintf (stderr, + FPRINTF (stderr, _("%s: option `%c%s' does not allow an argument\n"), argv[0], argv[GNoptind - 1][0], pfound->name); } @@ -715,7 +715,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, { if (GNopterr) { - fprintf (stderr, _("%s: option `%s' requires an argument\n"), + FPRINTF (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[GNoptind - 1]); } nextchar += strlen (nextchar); @@ -744,11 +744,11 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, { if (argv[GNoptind][1] == '-') /* --option */ - fprintf (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], + FPRINTF (stderr, _("%s: unrecognized option `--%s'\n"), argv[0], nextchar); else /* +option or -option */ - fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], + FPRINTF (stderr, _("%s: unrecognized option `%c%s'\n"), argv[0], argv[GNoptind][0], nextchar); } nextchar = (char *) ""; @@ -773,9 +773,9 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, { if (posixly_correct) /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); + FPRINTF (stderr, _("%s: illegal option -- %c\n"), argv[0], c); else - fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); + FPRINTF (stderr, _("%s: invalid option -- %c\n"), argv[0], c); } return '?'; } @@ -803,7 +803,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, if (GNopterr) { /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), + FPRINTF (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } if (optstring[0] == ':') @@ -851,7 +851,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, if (ambig && !exact) { if (GNopterr) - fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], + FPRINTF (stderr, _("%s: option `-W %s' is ambiguous\n"), argv[0], argv[GNoptind]); nextchar += strlen (nextchar); GNoptind++; @@ -869,7 +869,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, else { if (GNopterr) - fprintf (stderr, _("\ + FPRINTF (stderr, _("\ %s: option `-W %s' does not allow an argument\n"), argv[0], pfound->name); nextchar += strlen (nextchar); @@ -883,7 +883,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, else { if (GNopterr) - fprintf (stderr, _("%s: option `%s' requires an argument\n"), + FPRINTF (stderr, _("%s: option `%s' requires an argument\n"), argv[0], argv[GNoptind - 1]); nextchar += strlen (nextchar); return optstring[0] == ':' ? ':' : '?'; @@ -931,7 +931,7 @@ GN_getopt_internal (int argc, char *const *argv, const char *optstring, if (GNopterr) { /* 1003.2 specifies the format of this message. */ - fprintf (stderr, _("%s: option requires an argument -- %c\n"), + FPRINTF (stderr, _("%s: option requires an argument -- %c\n"), argv[0], c); } if (optstring[0] == ':') @@ -1035,7 +1035,7 @@ GNUNET_GETOPT_run (const char *binaryOptions, } if (i == count) { - fprintf (stderr, _("Use --help to get a list of options.\n")); + FPRINTF (stderr, _("Use %s to get a list of options.\n"), "--help"); cont = GNUNET_SYSERR; } } diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c index c74b90877..8fb3673c0 100644 --- a/src/util/getopt_helpers.c +++ b/src/util/getopt_helpers.c @@ -252,7 +252,7 @@ GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, if (1 != SSCANF (value, "%llu", val)) { - fprintf (stderr, _("You must pass a number to the `%s' option.\n"), option); + FPRINTF (stderr, _("You must pass a number to the `%s' option.\n"), option); return GNUNET_SYSERR; } return GNUNET_OK; @@ -280,7 +280,7 @@ GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, if (1 != SSCANF (value, "%u", val)) { - fprintf (stderr, _("You must pass a number to the `%s' option.\n"), option); + FPRINTF (stderr, _("You must pass a number to the `%s' option.\n"), option); return GNUNET_SYSERR; } return GNUNET_OK; diff --git a/src/util/plugin.c b/src/util/plugin.c index fe5fb87f9..4e0385a09 100644 --- a/src/util/plugin.c +++ b/src/util/plugin.c @@ -86,7 +86,7 @@ plugin_init () err = lt_dlinit (); if (err > 0) { - fprintf (stderr, _("Initialization of plugin mechanism failed: %s!\n"), + FPRINTF (stderr, _("Initialization of plugin mechanism failed: %s!\n"), lt_dlerror ()); return; } diff --git a/src/util/test_common_allocation.c b/src/util/test_common_allocation.c index 950f0cedb..438d39751 100644 --- a/src/util/test_common_allocation.c +++ b/src/util/test_common_allocation.c @@ -105,7 +105,7 @@ main (int argc, char *argv[]) GNUNET_log_setup ("test-common-allocation", "WARNING", NULL); ret = check (); if (ret != 0) - fprintf (stderr, "ERROR %d.\n", ret); + FPRINTF (stderr, "ERROR %d.\n", ret); return ret; } diff --git a/src/util/test_common_logging.c b/src/util/test_common_logging.c index d057db099..934586926 100644 --- a/src/util/test_common_logging.c +++ b/src/util/test_common_logging.c @@ -44,7 +44,7 @@ main (int argc, char *argv[]) unsigned int logs = 0; if (0 != putenv ("GNUNET_FORCE_LOG=")) - fprintf (stderr, "Failed to putenv: %s\n", strerror (errno)); + FPRINTF (stderr, "Failed to putenv: %s\n", strerror (errno)); GNUNET_log_setup ("test-common-logging", "DEBUG", "/dev/null"); GNUNET_logger_add (&my_log, &logs); GNUNET_logger_add (&my_log, &logs); @@ -60,7 +60,7 @@ main (int argc, char *argv[]) GNUNET_logger_remove (&my_log, &logs); if (logs != 4) { - fprintf (stdout, "Expected 4 log calls, got %u\n", logs); + FPRINTF (stdout, "Expected 4 log calls, got %u\n", logs); failureCount++; } GNUNET_break (0 == @@ -84,13 +84,13 @@ main (int argc, char *argv[]) GNUNET_logger_remove (&my_log, &logs); if (logs != 1) { - fprintf (stdout, "Expected 1 log call, got %u\n", logs); + FPRINTF (stdout, "Expected 1 log call, got %u\n", logs); failureCount++; } if (failureCount != 0) { - fprintf (stdout, "%u TESTS FAILED!\n", failureCount); + FPRINTF (stdout, "%u TESTS FAILED!\n", failureCount); return -1; } return 0; diff --git a/src/util/test_common_logging_dummy.c b/src/util/test_common_logging_dummy.c index 005b5caef..9f6756ff4 100644 --- a/src/util/test_common_logging_dummy.c +++ b/src/util/test_common_logging_dummy.c @@ -37,7 +37,7 @@ my_log (void *ctx, enum GNUNET_ErrorType kind, const char *component, { if (strncmp ("test-common-logging-dummy", component, 25) != 0) return; - fprintf (stdout, "%s", msg); + FPRINTF (stdout, "%s", msg); fflush (stdout); } diff --git a/src/util/test_common_logging_runtime_loglevels.c b/src/util/test_common_logging_runtime_loglevels.c index 9b5b1228a..51123d9b3 100644 --- a/src/util/test_common_logging_runtime_loglevels.c +++ b/src/util/test_common_logging_runtime_loglevels.c @@ -171,7 +171,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) buf_ptr += rd; bytes += rd; #if VERBOSE - fprintf (stderr, "got %d bytes, reading more\n", rd); + FPRINTF (stderr, "got %d bytes, reading more\n", rd); #endif GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, stdout_read_handle, &read_call, @@ -180,7 +180,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } #if VERBOSE - fprintf (stderr, "bytes is %d:%s\n", bytes, buf); + FPRINTF (stderr, "bytes is %d:%s\n", bytes, buf); #endif /* +------CHILD OUTPUT-- @@ -251,7 +251,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) &delays[7], level))) { if (bytes == 20 * 16) - fprintf (stderr, "Ran out of buffer space!\n"); + FPRINTF (stderr, "%s", "Ran out of buffer space!\n"); GNUNET_break (0); ok = 2; GNUNET_SCHEDULER_cancel (die_task); diff --git a/src/util/test_configuration.c b/src/util/test_configuration.c index 3780b3649..b1a446f86 100644 --- a/src/util/test_configuration.c +++ b/src/util/test_configuration.c @@ -240,14 +240,14 @@ checkDiffs (struct GNUNET_CONFIGURATION_Handle *cfgDefault, int option) GNUNET_CONFIGURATION_iterate (cfg, diffsCallBack, &cbData); if (1 == (ret = cbData.status)) { - fprintf (stderr, + FPRINTF (stderr, "%s", "Incorrect Configuration Diffs: Diffs may contain data not actually edited\n"); goto housekeeping; } cbData.cfgDiffs = cfg; GNUNET_CONFIGURATION_iterate (cfgDiffs, diffsCallBack, &cbData); if ((ret = cbData.status) == 1) - fprintf (stderr, + FPRINTF (stderr, "%s", "Incorrect Configuration Diffs: Data may be missing in diffs\n"); housekeeping: @@ -277,7 +277,7 @@ testConfig () return 1; if (0 != strcmp ("b", c)) { - fprintf (stderr, "Got `%s'\n", c); + FPRINTF (stderr, "Got `%s'\n", c); GNUNET_free (c); return 2; } @@ -470,7 +470,7 @@ main (int argc, char *argv[]) if (GNUNET_OK != GNUNET_CONFIGURATION_parse (cfg, "test_configuration_data.conf")) { - fprintf (stderr, "Failed to parse configuration file\n"); + FPRINTF (stderr, "%s", "Failed to parse configuration file\n"); GNUNET_CONFIGURATION_destroy (cfg); return 1; } @@ -484,7 +484,7 @@ main (int argc, char *argv[]) if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, "/tmp/gnunet-test.conf")) { - fprintf (stderr, "Failed to write configuration file\n"); + FPRINTF (stderr, "%s", "Failed to write configuration file\n"); GNUNET_CONFIGURATION_destroy (cfg); return 1; } @@ -546,7 +546,7 @@ main (int argc, char *argv[]) error: if (failureCount != 0) { - fprintf (stderr, "Test failed: %u\n", failureCount); + FPRINTF (stderr, "Test failed: %u\n", failureCount); return 1; } return 0; diff --git a/src/util/test_crypto_aes_weak.c b/src/util/test_crypto_aes_weak.c index a0161b575..0b7ba5c54 100644 --- a/src/util/test_crypto_aes_weak.c +++ b/src/util/test_crypto_aes_weak.c @@ -136,7 +136,7 @@ getWeakKeys () { if (number_of_runs % 1000 == 0) - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); /*printf("Got to run number %d.\n", number_of_runs); */ GNUNET_CRYPTO_aes_create_session_key (&sessionkey); diff --git a/src/util/test_crypto_ksk.c b/src/util/test_crypto_ksk.c index 2789f5edb..58c459547 100644 --- a/src/util/test_crypto_ksk.c +++ b/src/util/test_crypto_ksk.c @@ -46,7 +46,7 @@ testCorrectKey () int i; char out[3]; - fprintf (stderr, "Testing KBlock key correctness"); + FPRINTF (stderr, "%s", "Testing KBlock key correctness"); GNUNET_CRYPTO_hash ("X", strlen ("X"), &in); hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in); if (hostkey == NULL) @@ -66,12 +66,12 @@ testCorrectKey () snprintf (out, sizeof (out), "%02x", ((unsigned char *) &pkey)[i]); if (0 != strncmp (out, &want[i * 2], 2)) { - fprintf (stderr, " Failed! Wanted %.2s but got %2s at %d\n", &want[i * 2], + FPRINTF (stderr, " Failed! Wanted %.2s but got %2s at %d\n", &want[i * 2], out, i); return GNUNET_SYSERR; } } - fprintf (stderr, " OK\n"); + FPRINTF (stderr, "%s", " OK\n"); return GNUNET_OK; } @@ -85,7 +85,7 @@ testMultiKey (const char *word) struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pkey1; int i; - fprintf (stderr, "Testing KBlock key uniqueness (%s) ", word); + FPRINTF (stderr, "Testing KBlock key uniqueness (%s) ", word); GNUNET_CRYPTO_hash (word, strlen (word), &in); hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in); if (hostkey == NULL) @@ -101,12 +101,12 @@ testMultiKey (const char *word) GNUNET_CRYPTO_rsa_key_free (hostkey); for (i = 0; i < UNIQUE_ITER; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); hostkey = GNUNET_CRYPTO_rsa_key_create_from_hash (&in); if (hostkey == NULL) { GNUNET_break (0); - fprintf (stderr, " ERROR\n"); + FPRINTF (stderr, "%s", " ERROR\n"); return GNUNET_SYSERR; } GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey1); @@ -116,11 +116,11 @@ testMultiKey (const char *word) sizeof (struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded))) { GNUNET_break (0); - fprintf (stderr, " ERROR\n"); + FPRINTF (stderr, "%s", " ERROR\n"); return GNUNET_SYSERR; } } - fprintf (stderr, " OK\n"); + FPRINTF (stderr, "%s", " OK\n"); return GNUNET_OK; } @@ -135,19 +135,19 @@ testEncryptDecrypt (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey) struct GNUNET_TIME_Absolute start; int ok; - fprintf (stderr, "W"); + FPRINTF (stderr, "%s", "W"); GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey); ok = 0; start = GNUNET_TIME_absolute_get (); for (i = 0; i < ITER; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey, &target)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n"); ok++; continue; } @@ -155,7 +155,7 @@ testEncryptDecrypt (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey) GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result, strlen (TESTSTRING) + 1)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n"); ok++; continue; } @@ -186,17 +186,17 @@ testSignVerify (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey) struct GNUNET_TIME_Absolute start; int ok = GNUNET_OK; - fprintf (stderr, "W"); + FPRINTF (stderr, "%s", "W"); GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey); start = GNUNET_TIME_absolute_get (); purp.size = htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose)); purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); for (i = 0; i < ITER; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n"); ok = GNUNET_SYSERR; continue; } diff --git a/src/util/test_crypto_random.c b/src/util/test_crypto_random.c index 46d3ed0aa..681947a60 100644 --- a/src/util/test_crypto_random.c +++ b/src/util/test_crypto_random.c @@ -43,7 +43,7 @@ test (enum GNUNET_CRYPTO_Quality mode) b2 = GNUNET_CRYPTO_random_permute (mode, 1024); if (0 == memcmp (b2, buf, sizeof (buf))) { - fprintf (stderr, "!"); + FPRINTF (stderr, "%s", "!"); GNUNET_free (b2); continue; } diff --git a/src/util/test_crypto_rsa.c b/src/util/test_crypto_rsa.c index f26a76a38..f6800afcd 100644 --- a/src/util/test_crypto_rsa.c +++ b/src/util/test_crypto_rsa.c @@ -47,7 +47,7 @@ testEncryptDecrypt () struct GNUNET_TIME_Absolute start; int ok; - fprintf (stderr, "W"); + FPRINTF (stderr, "%s", "W"); hostkey = GNUNET_CRYPTO_rsa_key_create (); GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey); @@ -55,12 +55,12 @@ testEncryptDecrypt () start = GNUNET_TIME_absolute_get (); for (i = 0; i < ITER; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey, &target)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n"); ok++; continue; } @@ -68,7 +68,7 @@ testEncryptDecrypt () GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, result, strlen (TESTSTRING) + 1)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n"); ok++; continue; @@ -102,7 +102,7 @@ testEncryptPerformance () struct GNUNET_TIME_Absolute start; int ok; - fprintf (stderr, "W"); + FPRINTF (stderr, "%s", "W"); hostkey = GNUNET_CRYPTO_rsa_key_create (); GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey); @@ -110,12 +110,12 @@ testEncryptPerformance () start = GNUNET_TIME_absolute_get (); for (i = 0; i < ITER; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_encrypt (TESTSTRING, strlen (TESTSTRING) + 1, &pkey, &target)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n"); ok++; continue; } @@ -142,7 +142,7 @@ testEncryptDecryptSK () struct GNUNET_TIME_Absolute start; int ok; - fprintf (stderr, "W"); + FPRINTF (stderr, "%s", "W"); hostkey = GNUNET_CRYPTO_rsa_key_create (); GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey); @@ -150,14 +150,14 @@ testEncryptDecryptSK () start = GNUNET_TIME_absolute_get (); for (i = 0; i < ITER; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); GNUNET_CRYPTO_aes_create_session_key (&insk); if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_encrypt (&insk, sizeof (struct GNUNET_CRYPTO_AesSessionKey), &pkey, &target)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_encrypt returned SYSERR\n"); ok++; continue; } @@ -165,7 +165,7 @@ testEncryptDecryptSK () GNUNET_CRYPTO_rsa_decrypt (hostkey, &target, &outsk, sizeof (struct GNUNET_CRYPTO_AesSessionKey))) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_decrypt returned SYSERR\n"); ok++; continue; } @@ -198,7 +198,7 @@ testSignVerify () struct GNUNET_TIME_Absolute start; int ok = GNUNET_OK; - fprintf (stderr, "W"); + FPRINTF (stderr, "%s", "W"); hostkey = GNUNET_CRYPTO_rsa_key_create (); GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey); start = GNUNET_TIME_absolute_get (); @@ -207,10 +207,10 @@ testSignVerify () for (i = 0; i < ITER; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n"); ok = GNUNET_SYSERR; continue; } @@ -253,16 +253,16 @@ testSignPerformance () purp.size = htonl (sizeof (struct GNUNET_CRYPTO_RsaSignaturePurpose)); purp.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); - fprintf (stderr, "W"); + FPRINTF (stderr, "%s", "W"); hostkey = GNUNET_CRYPTO_rsa_key_create (); GNUNET_CRYPTO_rsa_key_get_public (hostkey, &pkey); start = GNUNET_TIME_absolute_get (); for (i = 0; i < ITER; i++) { - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (GNUNET_SYSERR == GNUNET_CRYPTO_rsa_sign (hostkey, &purp, &sig)) { - fprintf (stderr, "GNUNET_CRYPTO_rsa_sign returned SYSERR\n"); + FPRINTF (stderr, "%s", "GNUNET_CRYPTO_rsa_sign returned SYSERR\n"); ok = GNUNET_SYSERR; continue; } diff --git a/src/util/test_disk.c b/src/util/test_disk.c index 91154a6f5..546277256 100644 --- a/src/util/test_disk.c +++ b/src/util/test_disk.c @@ -46,13 +46,13 @@ testReadWrite () ret = GNUNET_DISK_fn_read (".testfile", tmp, sizeof (tmp) - 1); if (ret < 0) { - fprintf (stderr, "Error reading file `%s' in testReadWrite\n", ".testfile"); + FPRINTF (stderr, "Error reading file `%s' in testReadWrite\n", ".testfile"); return 1; } tmp[ret] = '\0'; if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1)) { - fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp, + FPRINTF (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp, TESTSTRING, ".testfile"); return 1; } @@ -61,14 +61,14 @@ testReadWrite () ret = GNUNET_DISK_fn_read (".testfile2", tmp, sizeof (tmp) - 1); if (ret < 0) { - fprintf (stderr, "Error reading file `%s' in testReadWrite\n", + FPRINTF (stderr, "Error reading file `%s' in testReadWrite\n", ".testfile2"); return 1; } tmp[ret] = '\0'; if (0 != memcmp (tmp, TESTSTRING, strlen (TESTSTRING) + 1)) { - fprintf (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp, + FPRINTF (stderr, "Error in testReadWrite: *%s* != *%s* for file %s\n", tmp, TESTSTRING, ".testfile2"); return 1; } @@ -276,7 +276,7 @@ main (int argc, char *argv[]) failureCount += testDirMani (); if (failureCount != 0) { - fprintf (stderr, "\n%u TESTS FAILED!\n", failureCount); + FPRINTF (stderr, "\n%u TESTS FAILED!\n", failureCount); return -1; } return 0; diff --git a/src/util/test_os_start_process.c b/src/util/test_os_start_process.c index df8520546..78538404a 100644 --- a/src/util/test_os_start_process.c +++ b/src/util/test_os_start_process.c @@ -75,7 +75,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) bytes = GNUNET_DISK_file_read (stdout_read_handle, &buf, sizeof (buf)); #if VERBOSE - fprintf (stderr, "bytes is %d\n", bytes); + FPRINTF (stderr, "bytes is %d\n", bytes); #endif if (bytes < 1) @@ -89,7 +89,7 @@ read_call (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) ok = strncmp (&buf[0], test_phrase, strlen (test_phrase)); #if VERBOSE - fprintf (stderr, "read %s\n", &buf[0]); + FPRINTF (stderr, "read %s\n", &buf[0]); #endif if (ok == 0) { diff --git a/src/util/test_peer.c b/src/util/test_peer.c index 3817d8243..9bf443600 100644 --- a/src/util/test_peer.c +++ b/src/util/test_peer.c @@ -69,7 +69,7 @@ check () pid = GNUNET_PEER_intern (&pidArr[i]); if (pid != (i + 1)) { - fprintf (stderr, "Unexpected Peer ID returned by intern function\n"); + FPRINTF (stderr, "%s", "Unexpected Peer ID returned by intern function\n"); return 1; } } @@ -80,7 +80,7 @@ check () pid = GNUNET_PEER_intern (&pidArr[i]); if (pid != (i + 1)) { - fprintf (stderr, "Unexpected Peer ID returned by intern function\n"); + FPRINTF (stderr, "%s", "Unexpected Peer ID returned by intern function\n"); return 1; } } diff --git a/src/util/test_resolver_api.c b/src/util/test_resolver_api.c index 4e248aa72..75140f8d5 100644 --- a/src/util/test_resolver_api.c +++ b/src/util/test_resolver_api.c @@ -264,8 +264,8 @@ run (void *cls, char *const *args, const char *cfgfile, _("gethostbyname() could not lookup IP address: %s\n"), hstrerror (h_errno)); #endif - fprintf (stderr, - "System seems to be off-line, will not run all DNS tests\n"); + FPRINTF (stderr, + "System seems to be off-line, will not run all DNS tests\n", NULL); *ok = 0; /* mark test as passing anyway */ return; } @@ -422,7 +422,7 @@ check () GNUNET_OS_process_close (proc); proc = NULL; if (ok != 0) - fprintf (stderr, "Missed some resolutions: %u\n", ok); + FPRINTF (stderr, "Missed some resolutions: %u\n", ok); return ok; } diff --git a/src/util/test_scheduler_delay.c b/src/util/test_scheduler_delay.c index ff6966a87..9cbf7d90f 100644 --- a/src/util/test_scheduler_delay.c +++ b/src/util/test_scheduler_delay.c @@ -59,10 +59,10 @@ test_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) target = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, i)); - fprintf (stderr, "."); + FPRINTF (stderr, "%s", "."); if (i > MAXV) { - fprintf (stderr, "\n"); + FPRINTF (stderr, "%s", "\n"); return; } GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply @@ -79,13 +79,13 @@ check () FPRINTF (stdout, "Sleep precision: %llu ms. ", cumDelta / 1000 / (MAXV / INCR)); if (cumDelta <= 10 * MAXV / INCR) - fprintf (stdout, "Timer precision is excellent.\n"); + FPRINTF (stdout, "%s", "Timer precision is excellent.\n"); else if (cumDelta <= 50 * MAXV / INCR) /* 50 ms average deviation */ - fprintf (stdout, "Timer precision is good.\n"); + FPRINTF (stdout, "%s", "Timer precision is good.\n"); else if (cumDelta > 250 * MAXV / INCR) - fprintf (stdout, "Timer precision is awful.\n"); + FPRINTF (stdout, "%s", "Timer precision is awful.\n"); else - fprintf (stdout, "Timer precision is acceptable.\n"); + FPRINTF (stdout, "%s", "Timer precision is acceptable.\n"); return 0; } diff --git a/src/util/test_service.c b/src/util/test_service.c index 1b78932f8..eff8c7570 100644 --- a/src/util/test_service.c +++ b/src/util/test_service.c @@ -270,7 +270,7 @@ main (int argc, char *argv[]) GNUNET_log_strerror (GNUNET_ERROR_TYPE_ERROR, "socket"); return 1; } - fprintf (stderr, + FPRINTF (stderr, "IPv6 support seems to not be available (%s), not testing it!\n", strerror (errno)); } diff --git a/src/util/test_strings.c b/src/util/test_strings.c index c6d604144..7e68153d7 100644 --- a/src/util/test_strings.c +++ b/src/util/test_strings.c @@ -89,7 +89,7 @@ check () * however, the "0:05 19" should always be there; hence: */ if (NULL == strstr (r, "0:05 19")) { - fprintf (stderr, "Got %s\n", r); + FPRINTF (stderr, "Got %s\n", r); GNUNET_break (0); GNUNET_free (r); return 1; -- cgit v1.2.3