Browse Source

r11827@catbus: nickm | 2007-02-16 15:00:39 -0500
Try to fix VC++ int conversion warning.


svn:r9595

Nick Mathewson 18 years ago
parent
commit
a3ec172e1a
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/or/routerlist.c

+ 3 - 2
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 (total_exit_bw+total_nonexit_bw) {
       /* if there's some bandwidth, there's at least one known router,
       /* if there's some bandwidth, there's at least one known router,
        * so no worries about div by 0 here */
        * so no worries about div by 0 here */
-      avg_fast = avg_slow =
+      int n_known = smartlist_len(sl)-n_unknown;
-        (total_exit_bw+total_nonexit_bw)/(smartlist_len(sl)-n_unknown);
+      avg_fast = avg_slow = (int32_t)
+        ((total_exit_bw+total_nonexit_bw)/((uint64_t) n_known));
     } else {
     } else {
       avg_fast = 40000;
       avg_fast = 40000;
       avg_slow = 20000;
       avg_slow = 20000;