diff options
author | Kevin McCarthy <kevin@8t8.us> | 2020-03-08 14:41:22 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2020-03-08 14:44:07 -0700 |
commit | 5cf8a04208fdb099bcd01849fff3dfe3fe923355 (patch) | |
tree | fbb93dd96f8978d47357686ca7ed149578717ba5 /mutt_socket.c | |
parent | 3ac6f3ea14e69b1c04d0feaea33bc37c9c1f7f0a (diff) |
Convert progress and socket_poll millis to unsigned long long.
64-bit platforms should already be using a 64-bit tv_sec, so we should
use the same for the millis values.
Diffstat (limited to 'mutt_socket.c')
-rw-r--r-- | mutt_socket.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mutt_socket.c b/mutt_socket.c index d3840842..83d8ddf7 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -432,14 +432,14 @@ int raw_socket_write (CONNECTION* conn, const char* buf, size_t count) int raw_socket_poll (CONNECTION* conn, time_t wait_secs) { fd_set rfds; - unsigned long wait_millis, post_t_millis; + unsigned long long wait_millis, post_t_millis; struct timeval tv, pre_t, post_t; int rv; if (conn->fd < 0) return -1; - wait_millis = wait_secs * 1000UL; + wait_millis = (unsigned long long)wait_secs * 1000ULL; FOREVER { @@ -460,8 +460,10 @@ int raw_socket_poll (CONNECTION* conn, time_t wait_secs) if (SigInt) mutt_query_exit (); - wait_millis += (pre_t.tv_sec * 1000UL) + (pre_t.tv_usec / 1000); - post_t_millis = (post_t.tv_sec * 1000UL) + (post_t.tv_usec / 1000); + wait_millis += ((unsigned long long)pre_t.tv_sec * 1000ULL) + + (unsigned long long)(pre_t.tv_usec / 1000); + post_t_millis = ((unsigned long long)post_t.tv_sec * 1000ULL) + + (unsigned long long)(post_t.tv_usec / 1000); if (wait_millis <= post_t_millis) return 0; wait_millis -= post_t_millis; |