diff options
author | Martin Kepplinger <martink@posteo.de> | 2017-07-03 13:23:47 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-07-03 13:28:22 +0200 |
commit | 55179a2ad321cb0cbda01fd894b426c5ceefe3bd (patch) | |
tree | 67ba5827ce6fedc19a671b518c82d4d11eac4668 | |
parent | 3a48a132685ca891ce1b7a10bbcd4b4cd33cee5e (diff) | |
download | curl-bagder/timeval-warnings.tar.gz |
timeval.c: Use long long constant type for timeval assignmentbagder/timeval-warnings
On a 64 bit host, sparse says:
timeval.c:148:15: warning: constant 0x7fffffffffffffff is so big it is long
timeval.c:149:12: warning: constant 0x7fffffffffffffff is so big it is long
so let's use long long constant types in order to prevent undesired overflow
failures.
Signed-off-by: Martin Kepplinger <martink@posteo.de>
-rw-r--r-- | lib/timeval.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/timeval.c b/lib/timeval.c index 1012b4e39..aff53cddc 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -145,8 +145,8 @@ time_t Curl_tvdiff_us(struct timeval newer, struct timeval older) return 0x7fffffff; #else /* for 64bit time_t systems */ - if(diff >= (0x7fffffffffffffff/1000000)) - return 0x7fffffffffffffff; + if(diff >= (0x7fffffffffffffffLL/1000000)) + return 0x7fffffffffffffffLL; #endif return (newer.tv_sec-older.tv_sec)*1000000+ (time_t)(newer.tv_usec-older.tv_usec); |