From: Vincent Lefevre Date: Wed, 2 Jul 2008 03:06:03 +0000 (-0700) Subject: Clamp timeval math to unsigned int to match progress timestamps. X-Git-Tag: neomutt-20160307~997 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a946faf264fe018d4bd5262b6fa761406ac70396;p=neomutt Clamp timeval math to unsigned int to match progress timestamps. This is fine since only relative differences matter. Closes #3018. --- diff --git a/ChangeLog b/ChangeLog index 12dfe6d4c..5eae52516 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,13 @@ -2008-07-01 17:20 -0700 Brendan Cully (8e2438ec5909) +2008-07-01 18:29 -0700 Brendan Cully (f9af0501d2dd) + + * crypt-gpgme.c: Set GPGME locale on first attempt to create context. + Closes #2913. + + * crypt-gpgme.c, crypt-gpgme.h, crypt-mod-pgp-gpgme.c: Stub in a + gpgme version of extract-keys. It doesn't currently work right + because apparently while gpg on the command line can parse a whole + message, we'll have to do it for gpgme. I really wonder about the + 'ME' part of GPGME sometimes. * crypt-gpgme.c, lib.c, lib.h: Support displaying application/pgp-keys with GPGME. This was pretty convoluted because GPGME provides no way diff --git a/curs_lib.c b/curs_lib.c index 8e453bee0..b52f51114 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -377,7 +377,8 @@ void mutt_progress_init (progress_t* progress, const char *msg, dprint (1, (debugfile, "gettimeofday failed: %d\n", errno)); /* if timestamp is 0 no time-based suppression is done */ if (TimeInc) - progress->timestamp = tv.tv_sec * 1000 + tv.tv_usec / 1000; + progress->timestamp = (unsigned int) (tv.tv_sec * 1000) + + (unsigned int) (tv.tv_usec / 1000); mutt_progress_update (progress, 0, 0); } @@ -400,7 +401,8 @@ void mutt_progress_update (progress_t* progress, long pos, int percent) /* skip refresh if not enough time has passed */ if (update && progress->timestamp && !gettimeofday (&tv, NULL)) { - now = tv.tv_sec * 1000 + tv.tv_usec / 1000; + now = (unsigned int) (tv.tv_sec * 1000) + + (unsigned int) (tv.tv_usec / 1000); if (now && now - progress->timestamp < TimeInc) update = 0; }