소스 검색

Fix Snow Leopard compile and a codestyle violation

When calculating the current tick, cap (tv_sec / EWMA_TICK_LEN) to an unsigned int.
Sebastian Hahn 16 년 전
부모
커밋
27b7746c51
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/or/relay.c

+ 2 - 2
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;