diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-03 12:52:43 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-03 12:52:43 -0400 |
commit | df98582851a92d514c04061a5e0ec762c17a0cfb (patch) | |
tree | b52518169d65be6773a5abb606f3f56b5b8c9d25 /src/or/status.c | |
parent | fe8f7748202816a9b90e04db542e449145283a66 (diff) | |
parent | 02a4442524d84ea7edf6e3f136017faa73452d92 (diff) | |
download | tor-df98582851a92d514c04061a5e0ec762c17a0cfb.tar.gz tor-df98582851a92d514c04061a5e0ec762c17a0cfb.zip |
Merge remote-tracking branch 'github/ticket26626'
Diffstat (limited to 'src/or/status.c')
-rw-r--r-- | src/or/status.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/or/status.c b/src/or/status.c index 80b56ac1a8..2259b3aae7 100644 --- a/src/or/status.c +++ b/src/or/status.c @@ -79,12 +79,12 @@ bytes_to_usage(uint64_t bytes) char *bw_string = NULL; if (bytes < (1<<20)) { /* Less than a megabyte. */ - tor_asprintf(&bw_string, U64_FORMAT" kB", U64_PRINTF_ARG(bytes>>10)); + tor_asprintf(&bw_string, "%"PRIu64" kB", (bytes>>10)); } else if (bytes < (1<<30)) { /* Megabytes. Let's add some precision. */ - double bw = U64_TO_DBL(bytes); + double bw = ((double)bytes); tor_asprintf(&bw_string, "%.2f MB", bw/(1<<20)); } else { /* Gigabytes. */ - double bw = U64_TO_DBL(bytes); + double bw = ((double)bytes); tor_asprintf(&bw_string, "%.2f GB", bw/(1<<30)); } @@ -152,8 +152,8 @@ log_heartbeat(time_t now) double fullness_pct = 100; if (stats_n_data_cells_packaged && !hibernating) { fullness_pct = - 100*(U64_TO_DBL(stats_n_data_bytes_packaged) / - U64_TO_DBL(stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)); + 100*(((double)stats_n_data_bytes_packaged) / + ((double)stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)); } const double overhead_pct = ( r - 1.0 ) * 100.0; @@ -190,12 +190,12 @@ log_heartbeat(time_t now) const uint64_t main_loop_idle_count = get_main_loop_idle_count(); log_fn(LOG_NOTICE, LD_HEARTBEAT, "Main event loop statistics: " - U64_FORMAT " successful returns, " - U64_FORMAT " erroneous returns, and " - U64_FORMAT " idle returns.", - U64_PRINTF_ARG(main_loop_success_count), - U64_PRINTF_ARG(main_loop_error_count), - U64_PRINTF_ARG(main_loop_idle_count)); + "%"PRIu64 " successful returns, " + "%"PRIu64 " erroneous returns, and " + "%"PRIu64 " idle returns.", + (main_loop_success_count), + (main_loop_error_count), + (main_loop_idle_count)); } /** Now, if we are an HS service, log some stats about our usage */ |