summaryrefslogtreecommitdiff
path: root/src/or/rephist.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-07-17 00:39:05 +0000
committerNick Mathewson <nickm@torproject.org>2006-07-17 00:39:05 +0000
commite572d5990c4ed5100338a4e1ad4cae6a55329b4f (patch)
tree18ec12edf7054392a0203a327a5b4bd11f9026b2 /src/or/rephist.c
parent169d6c4aca43ea574762f42542a9db4745396ff8 (diff)
downloadtor-e572d5990c4ed5100338a4e1ad4cae6a55329b4f.tar.gz
tor-e572d5990c4ed5100338a4e1ad4cae6a55329b4f.zip
MSVC6 is apparently terrified of unnatural cross-breeding between uint64_t and double, and needs more persuasion than usual to cast one to the other. Issue identified by Frediano Ziglio; patch revised for minimal impact on non-MSVC6 compilers.
svn:r6768
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r--src/or/rephist.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c
index 2459d46b7d..3d391ad94d 100644
--- a/src/or/rephist.c
+++ b/src/or/rephist.c
@@ -577,11 +577,9 @@ rep_hist_bandwidth_assess(void)
r = find_largest_max(read_array);
w = find_largest_max(write_array);
if (r>w)
- return (int)(w/(double)NUM_SECS_ROLLING_MEASURE);
+ return (int)(U64_TO_DBL(w)/NUM_SECS_ROLLING_MEASURE);
else
- return (int)(r/(double)NUM_SECS_ROLLING_MEASURE);
-
- return 0;
+ return (int)(U64_TO_DBL(r)/NUM_SECS_ROLLING_MEASURE);
}
/**