summaryrefslogtreecommitdiff
path: root/src/lib/time/tvdiff.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-03 11:00:18 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-03 11:00:18 -0400
commit02a4442524d84ea7edf6e3f136017faa73452d92 (patch)
treeb7870d99b8b95f63b11cb29e0ac1a435bd673c95 /src/lib/time/tvdiff.c
parentd5a3bb960d41873ccfde0bbdb4adfb762528069e (diff)
downloadtor-02a4442524d84ea7edf6e3f136017faa73452d92.tar.gz
tor-02a4442524d84ea7edf6e3f136017faa73452d92.zip
Fix up some windows compilation issues.
These were mostly cases where our previous macros had been casting, and the values that we were trying to printf were not in fact uint64_t.
Diffstat (limited to 'src/lib/time/tvdiff.c')
-rw-r--r--src/lib/time/tvdiff.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/time/tvdiff.c b/src/lib/time/tvdiff.c
index 0af45a208b..cfd1ace771 100644
--- a/src/lib/time/tvdiff.c
+++ b/src/lib/time/tvdiff.c
@@ -52,14 +52,14 @@ tv_udiff(const struct timeval *start, const struct timeval *end)
if (start->tv_usec > TOR_USEC_PER_SEC || start->tv_usec < 0) {
log_warn(LD_GENERAL, "comparing times on microsecond detail with bad "
"start tv_usec: %"PRId64 " microseconds",
- (start->tv_usec));
+ (int64_t)start->tv_usec);
return LONG_MAX;
}
if (end->tv_usec > TOR_USEC_PER_SEC || end->tv_usec < 0) {
log_warn(LD_GENERAL, "comparing times on microsecond detail with bad "
"end tv_usec: %"PRId64 " microseconds",
- (end->tv_usec));
+ (int64_t)end->tv_usec);
return LONG_MAX;
}
@@ -101,14 +101,14 @@ tv_mdiff(const struct timeval *start, const struct timeval *end)
if (start->tv_usec > TOR_USEC_PER_SEC || start->tv_usec < 0) {
log_warn(LD_GENERAL, "comparing times on millisecond detail with bad "
"start tv_usec: %"PRId64 " microseconds",
- (start->tv_usec));
+ (int64_t)start->tv_usec);
return LONG_MAX;
}
if (end->tv_usec > TOR_USEC_PER_SEC || end->tv_usec < 0) {
log_warn(LD_GENERAL, "comparing times on millisecond detail with bad "
"end tv_usec: %"PRId64 " microseconds",
- (end->tv_usec));
+ (int64_t)end->tv_usec);
return LONG_MAX;
}
@@ -124,7 +124,7 @@ tv_mdiff(const struct timeval *start, const struct timeval *end)
if (secdiff > (int64_t)(LONG_MAX/1000 - 2) ||
secdiff < (int64_t)(LONG_MIN/1000 + 1)) {
log_warn(LD_GENERAL, "comparing times on millisecond detail too far "
- "apart: %"PRId64 " seconds", (secdiff));
+ "apart: %"PRId64 " seconds", (int64_t)secdiff);
return LONG_MAX;
}