aboutsummaryrefslogtreecommitdiff
path: root/src/or/networkstatus.c
diff options
context:
space:
mode:
authordana koch <dsk@google.com>2014-05-12 09:16:06 +1000
committerNick Mathewson <nickm@torproject.org>2014-05-11 23:36:00 -0400
commitd6e6c63baf4409766ffd82fc859187b6285b093f (patch)
tree0a38dfcecc034cc33348a238cc0a210d840f2e67 /src/or/networkstatus.c
parentde2010e9c229cb130c30659aa62122529c125637 (diff)
downloadtor-d6e6c63baf4409766ffd82fc859187b6285b093f.tar
tor-d6e6c63baf4409766ffd82fc859187b6285b093f.tar.gz
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/networkstatus.c')
-rw-r--r--src/or/networkstatus.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index 90918d4fe..890da0ad1 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -830,7 +830,7 @@ update_consensus_networkstatus_fetch_time_impl(time_t now, int flav)
if (directory_fetches_dir_info_early(options)) {
/* We want to cache the next one at some point after this one
* is no longer fresh... */
- start = c->fresh_until + min_sec_before_caching;
+ start = (time_t)(c->fresh_until + min_sec_before_caching);
/* Some clients may need the consensus sooner than others. */
if (options->FetchDirInfoExtraEarly || authdir_mode_v3(options)) {
dl_interval = 60;
@@ -843,7 +843,7 @@ update_consensus_networkstatus_fetch_time_impl(time_t now, int flav)
} else {
/* We're an ordinary client or a bridge. Give all the caches enough
* time to download the consensus. */
- start = c->fresh_until + (interval*3)/4;
+ start = (time_t)(c->fresh_until + (interval*3)/4);
/* But download the next one well before this one is expired. */
dl_interval = ((c->valid_until - start) * 7 )/ 8;
@@ -851,7 +851,7 @@ update_consensus_networkstatus_fetch_time_impl(time_t now, int flav)
* to choose the rest of the interval *after* them. */
if (directory_fetches_dir_info_later(options)) {
/* Give all the *clients* enough time to download the consensus. */
- start = start + dl_interval + min_sec_before_caching;
+ start = (time_t)(start + dl_interval + min_sec_before_caching);
/* But try to get it before ours actually expires. */
dl_interval = (c->valid_until - start) - min_sec_before_caching;
}