diff options
author | dana koch <dsk@google.com> | 2014-05-12 09:16:06 +1000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-05-11 23:36:00 -0400 |
commit | d6e6c63baf4409766ffd82fc859187b6285b093f (patch) | |
tree | 0a38dfcecc034cc33348a238cc0a210d840f2e67 /src/or/rephist.c | |
parent | de2010e9c229cb130c30659aa62122529c125637 (diff) | |
download | tor-d6e6c63baf4409766ffd82fc859187b6285b093f.tar.gz tor-d6e6c63baf4409766ffd82fc859187b6285b093f.zip |
Quench clang's complaints with -Wshorten-64-to-32 when time_t is not long.
On OpenBSD 5.4, time_t is a 32-bit integer. These instances contain
implicit treatment of long and time_t as comparable types, so explicitly
cast to time_t.
Diffstat (limited to 'src/or/rephist.c')
-rw-r--r-- | src/or/rephist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/rephist.c b/src/or/rephist.c index a0f24e18f7..5446c25e36 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -931,7 +931,7 @@ correct_time(time_t t, time_t now, time_t stored_at, time_t started_measuring) return 0; else { long run_length = stored_at - t; - t = now - run_length; + t = (time_t)(now - run_length); if (t < started_measuring) t = started_measuring; return t; @@ -1092,7 +1092,7 @@ rep_hist_load_mtbf_data(time_t now) hist->start_of_run = correct_time(start_of_run, now, stored_at, tracked_since); if (hist->start_of_run < latest_possible_start + wrl) - latest_possible_start = hist->start_of_run - wrl; + latest_possible_start = (time_t)(hist->start_of_run - wrl); hist->weighted_run_length = wrl; hist->total_run_weights = trw; @@ -2311,7 +2311,7 @@ rep_hist_buffer_stats_add_circ(circuit_t *circ, time_t end_of_interval) return; start_of_interval = (circ->timestamp_created.tv_sec > start_of_buffer_stats_interval) ? - circ->timestamp_created.tv_sec : + (time_t)circ->timestamp_created.tv_sec : start_of_buffer_stats_interval; interval_length = (int) (end_of_interval - start_of_interval); if (interval_length <= 0) |