summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--mpi-patches/shrink-mpi-int14
2 files changed, 12 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 72856d26..1772973d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-12-27 Kaz Kylheku <kaz@kylheku.com>
+ * mpi-patches/shrink-mpi-int (mpi_int): Fixed terrible bug in this
+ patch, resulting in an insufficient bit field width for representing
+ the allocation size of the MPI integer on 32 bit platforms.
+
+2011-12-27 Kaz Kylheku <kaz@kylheku.com>
+
* rand.c (make_state): Use ANSI C syntax for prototyped function of no
arguments. This snuck through due to working with a C++ compiler.
(random): Fixed unused variable warning that happens on 32-bit-pointer
diff --git a/mpi-patches/shrink-mpi-int b/mpi-patches/shrink-mpi-int
index b1b03aa9..bac2aafb 100644
--- a/mpi-patches/shrink-mpi-int
+++ b/mpi-patches/shrink-mpi-int
@@ -1,19 +1,17 @@
Index: mpi-1.8.6/mpi.h
===================================================================
---- mpi-1.8.6.orig/mpi.h 2011-12-13 09:35:31.000000000 -0800
-+++ mpi-1.8.6/mpi.h 2011-12-13 09:40:01.000000000 -0800
+--- mpi-1.8.6.orig/mpi.h 2011-12-27 14:01:24.628295000 -0800
++++ mpi-1.8.6/mpi.h 2011-12-27 14:46:02.227842000 -0800
@@ -72,8 +72,13 @@
#define MAX_RADIX 64
typedef struct {
-- mp_sign sign; /* sign of this quantity */
-- mp_size alloc; /* how many digits allocated */
+#if SIZEOF_INT >= SIZEOF_PTR
-+ unsigned int sign : 1; /* sign of this quantity */
-+ unsigned int alloc : sizeof(int) - 1; /* how many digits allocated */
++ unsigned int sign : 1;
++ unsigned int alloc : sizeof(int)*CHAR_BIT - 1;
+#else
-+ mp_sign sign;
-+ mp_size alloc;
+ mp_sign sign; /* sign of this quantity */
+ mp_size alloc; /* how many digits allocated */
+#endif
mp_size used; /* how many digits used */
mp_digit *dp; /* the digits themselves */