summaryrefslogtreecommitdiffstats
path: root/mpi-patches/shrink-mpi-int
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-27 14:48:35 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-27 14:48:35 -0800
commit1727190a9cc0c0e3bf211ecb7b18e36ecc0388e6 (patch)
tree70055a9b495ed5e44f646ed2f3932029a9ded361 /mpi-patches/shrink-mpi-int
parent67fee64f8b90cb72905ac7c0ae40ae5f0a7d2151 (diff)
downloadtxr-1727190a9cc0c0e3bf211ecb7b18e36ecc0388e6.tar.gz
txr-1727190a9cc0c0e3bf211ecb7b18e36ecc0388e6.tar.bz2
txr-1727190a9cc0c0e3bf211ecb7b18e36ecc0388e6.zip
* 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.
Diffstat (limited to 'mpi-patches/shrink-mpi-int')
-rw-r--r--mpi-patches/shrink-mpi-int14
1 files changed, 6 insertions, 8 deletions
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 */