[or-cvs] r9595: Try to fix VC++ int conversion warning. (in tor/trunk: . src/or)
nickm at seul.org
nickm at seul.org
Fri Feb 16 20:01:22 UTC 2007
Author: nickm
Date: 2007-02-16 15:01:21 -0500 (Fri, 16 Feb 2007)
New Revision: 9595
Modified:
tor/trunk/
tor/trunk/src/or/routerlist.c
Log:
r11827 at catbus: nickm | 2007-02-16 15:00:39 -0500
Try to fix VC++ int conversion warning.
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r11827] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c 2007-02-16 20:01:02 UTC (rev 9594)
+++ tor/trunk/src/or/routerlist.c 2007-02-16 20:01:21 UTC (rev 9595)
@@ -1007,8 +1007,9 @@
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;
More information about the tor-commits
mailing list