[or-cvs] Oh. And apparently, msvc6 doesnt think very much of doing u...

Nick Mathewson nickm at seul.org
Tue Jul 18 02:24:03 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv29929/src/or

Modified Files:
	hibernate.c main.c 
Log Message:
Oh. And apparently, msvc6 doesnt think very much of doing u64-and-double arithmetic either.

Index: hibernate.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/hibernate.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -p -d -r1.73 -r1.74
--- hibernate.c	17 Jul 2006 00:39:05 -0000	1.73
+++ hibernate.c	18 Jul 2006 02:24:01 -0000	1.74
@@ -683,7 +683,8 @@ hibernate_hard_limit_reached(void)
 static int
 hibernate_soft_limit_reached(void)
 {
-  uint64_t soft_limit = DBL_TO_U64((get_options()->AccountingMax) * .95);
+  uint64_t soft_limit = DBL_TO_U64(U64_TO_DBL(get_options()->AccountingMax)
+                                     * .95);
   if (!soft_limit)
     return 0;
   return n_bytes_read_in_interval >= soft_limit

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.651
retrieving revision 1.652
diff -u -p -d -r1.651 -r1.652
--- main.c	17 Jul 2006 06:54:28 -0000	1.651
+++ main.c	18 Jul 2006 02:24:01 -0000	1.652
@@ -1360,11 +1360,11 @@ dumpstats(int severity)
   if (stats_n_data_cells_packaged)
     log(severity,LD_NET,"Average packaged cell fullness: %2.3f%%",
         100*(U64_TO_DBL(stats_n_data_bytes_packaged) /
-             (stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
+             U64_TO_DBL(stats_n_data_cells_packaged*RELAY_PAYLOAD_SIZE)) );
   if (stats_n_data_cells_received)
     log(severity,LD_NET,"Average delivered cell fullness: %2.3f%%",
         100*(U64_TO_DBL(stats_n_data_bytes_received) /
-             (stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
+             U64_TO_DBL(stats_n_data_cells_received*RELAY_PAYLOAD_SIZE)) );
 
   if (now - time_of_process_start >= 0)
     elapsed = now - time_of_process_start;



More information about the tor-commits mailing list