summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-02-16 20:01:21 +0000
committerNick Mathewson <nickm@torproject.org>2007-02-16 20:01:21 +0000
commita3ec172e1ac0e1ae2b2a09c05edb4e7f2fef4a1e (patch)
tree95c5508423434bd60821a16fa3f5d69cc0b2996c
parent11e5656ab7fdbf8bad2e041261542f2bda6a5a8c (diff)
downloadtor-a3ec172e1ac0e1ae2b2a09c05edb4e7f2fef4a1e.tar.gz
tor-a3ec172e1ac0e1ae2b2a09c05edb4e7f2fef4a1e.zip
r11827@catbus: nickm | 2007-02-16 15:00:39 -0500
Try to fix VC++ int conversion warning. svn:r9595
-rw-r--r--src/or/routerlist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index bfaf44dd2f..8e08b72f21 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1007,8 +1007,9 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, int for_exit, int statuses)
if (total_exit_bw+total_nonexit_bw) {
/* if there's some bandwidth, there's at least one known router,
* so no worries about div by 0 here */
- avg_fast = avg_slow =
- (total_exit_bw+total_nonexit_bw)/(smartlist_len(sl)-n_unknown);
+ int n_known = smartlist_len(sl)-n_unknown;
+ avg_fast = avg_slow = (int32_t)
+ ((total_exit_bw+total_nonexit_bw)/((uint64_t) n_known));
} else {
avg_fast = 40000;
avg_slow = 20000;