summaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2009-12-14 04:59:55 +0100
committerSebastian Hahn <sebastian@torproject.org>2009-12-14 05:17:45 +0100
commit27b7746c519125cac703f38a8b325d3a1c08619b (patch)
tree4b99b5041b8fc563fd18e39c94e81f7a2f77e457 /src/or/relay.c
parent06e8370c33d6ccb73d55e9e8c3d2673c48d7b328 (diff)
downloadtor-27b7746c519125cac703f38a8b325d3a1c08619b.tar.gz
tor-27b7746c519125cac703f38a8b325d3a1c08619b.zip
Fix Snow Leopard compile and a codestyle violation
When calculating the current tick, cap (tv_sec / EWMA_TICK_LEN) to an unsigned int.
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 19bb6871ce..b7e8871766 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -1817,7 +1817,7 @@ cell_ewma_to_circuit(cell_ewma_t *ewma)
#define EWMA_DEFAULT_SCALE_FACTOR 0.9
/** Given a timeval 'now', compute the cell_ewma tick in which it occurs
- * and the fraction of the tick that has elapsed before
+ * and the fraction of the tick that has elapsed before
*
* These tick values are not meant to be shared between Tor instances, or used
* for other purposes. */
@@ -1825,7 +1825,7 @@ static unsigned
cell_ewma_tick_from_timeval(const struct timeval *now,
double *remainder_out)
{
- unsigned res = now->tv_sec / EWMA_TICK_LEN;
+ unsigned res = (unsigned) (now->tv_sec / EWMA_TICK_LEN);
/* rem */
double rem = (now->tv_sec % EWMA_TICK_LEN) +
((double)(now->tv_usec)) / 1.0e6;