diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-07-03 10:43:43 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-07-03 10:45:43 -0400 |
commit | d5a3bb960d41873ccfde0bbdb4adfb762528069e (patch) | |
tree | 45e5a10184c90df512d54f49ac4b2101ed3a258c /src/or/status.c | |
parent | 9568c0ce3d3885a41ca44ac030b04d089ac56a40 (diff) | |
download | tor-d5a3bb960d41873ccfde0bbdb4adfb762528069e.tar.gz tor-d5a3bb960d41873ccfde0bbdb4adfb762528069e.zip |
Retire U64_TO_DBL and DBL_TO_U64
These were necessary long ago to work around a bug in VC6.
Diffstat (limited to 'src/or/status.c')
-rw-r--r-- | src/or/status.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/status.c b/src/or/status.c index 5c0a768ace..4538e22a56 100644 --- a/src/or/status.c +++ b/src/or/status.c @@ -79,10 +79,10 @@ bytes_to_usage(uint64_t bytes) if (bytes < (1<<20)) { /* Less than a megabyte. */ 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)); } @@ -150,8 +150,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; |