pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/mutt mutt: Fix build on platforms without u_int32_t



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a179c1adf6c6
branches:  trunk
changeset: 441829:a179c1adf6c6
user:      otis <otis%pkgsrc.org@localhost>
date:      Wed Nov 11 18:57:15 2020 +0000

description:
mutt: Fix build on platforms without u_int32_t

diffstat:

 mail/mutt/distinfo                     |   3 ++-
 mail/mutt/patches/patch-mutt__random.c |  29 +++++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)

diffs (47 lines):

diff -r 944649f5bb33 -r a179c1adf6c6 mail/mutt/distinfo
--- a/mail/mutt/distinfo        Wed Nov 11 17:55:59 2020 +0000
+++ b/mail/mutt/distinfo        Wed Nov 11 18:57:15 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.86 2020/11/08 17:42:45 tron Exp $
+$NetBSD: distinfo,v 1.87 2020/11/11 18:57:15 otis Exp $
 
 SHA1 (mutt-2.0.0.tar.gz) = 2554e214f2f0e6ff148a33805af6b00bb57ee988
 RMD160 (mutt-2.0.0.tar.gz) = 778578909487e7182dd0418416e63a002832ca6b
@@ -9,3 +9,4 @@
 SHA1 (patch-configure) = cbd7ff52b0b358fff41988d286267046f56ee8d5
 SHA1 (patch-doc_Makefile.in) = 8086887afeec554d0c78047a48ec3eb33d38f26c
 SHA1 (patch-lib.h) = f10c32fc891a3c70c7379e092159e207b6c27b8b
+SHA1 (patch-mutt__random.c) = 73a9a4fd24b8cf4f6354930d2c7dd91d29d46231
diff -r 944649f5bb33 -r a179c1adf6c6 mail/mutt/patches/patch-mutt__random.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mail/mutt/patches/patch-mutt__random.c    Wed Nov 11 18:57:15 2020 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-mutt__random.c,v 1.1 2020/11/11 18:57:15 otis Exp $
+
+Cast to more portable C99 uint32_t
+
+--- mutt_random.c.orig 2020-11-03 17:50:37.000000000 +0000
++++ mutt_random.c
+@@ -29,7 +29,7 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+ 
+-static u_int32_t z[4]; /* Keep state for LFRS113 PRNG */
++static uint32_t z[4]; /* Keep state for LFRS113 PRNG */
+ static int rand_bytes_produced = 0;
+ static time_t time_last_reseed = 0;
+ 
+@@ -92,11 +92,11 @@ void mutt_reseed (void)
+    * Use as many of the lower order bits from the current time of day as the seed.
+    * If the upper bound is truncated, that is fine.
+    *
+-   * tv_sec is integral of type integer or float.  Cast to 'u_int32_t' before
++   * tv_sec is integral of type integer or float.  Cast to 'uint32_t' before
+    * bitshift in case it is a float. */
+ 
+   /* Finally, set our seeds */
+-  z[0] ^= (((u_int32_t) tv.tv_sec << 20) | tv.tv_usec);
++  z[0] ^= (((uint32_t) tv.tv_sec << 20) | tv.tv_usec);
+   z[1] ^= getpid ()                             ^ z[0];
+   z[2] ^= getppid ()                            ^ z[0];
+   z[3] ^= (intptr_t) &z[3] ^ time_last_reseed   ^ z[0];



Home | Main Index | Thread Index | Old Index