mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-10 21:23:58 +01:00
Fix Snow Leopard compile and a codestyle violation
When calculating the current tick, cap (tv_sec / EWMA_TICK_LEN) to an unsigned int.
This commit is contained in:
parent
06e8370c33
commit
27b7746c51
@ -1825,7 +1825,7 @@ static unsigned
|
|||||||
cell_ewma_tick_from_timeval(const struct timeval *now,
|
cell_ewma_tick_from_timeval(const struct timeval *now,
|
||||||
double *remainder_out)
|
double *remainder_out)
|
||||||
{
|
{
|
||||||
unsigned res = now->tv_sec / EWMA_TICK_LEN;
|
unsigned res = (unsigned) (now->tv_sec / EWMA_TICK_LEN);
|
||||||
/* rem */
|
/* rem */
|
||||||
double rem = (now->tv_sec % EWMA_TICK_LEN) +
|
double rem = (now->tv_sec % EWMA_TICK_LEN) +
|
||||||
((double)(now->tv_usec)) / 1.0e6;
|
((double)(now->tv_usec)) / 1.0e6;
|
||||||
|
Loading…
Reference in New Issue
Block a user