summaryrefslogtreecommitdiff
path: root/Include/longintrepr.h
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2000-07-08 04:17:21 +0000
committerTim Peters <tim.peters@gmail.com>2000-07-08 04:17:21 +0000
commit5377df5b0944679f1361b2f7eda0421b772310b2 (patch)
treeb66ed78c8d5b5605fc9de63719373e1aef2a2b68 /Include/longintrepr.h
parent2df58d5cc83415bc5064b2b168449eebc796872f (diff)
downloadcpython-5377df5b0944679f1361b2f7eda0421b772310b2.tar.gz
Cray J90 fixes for long ints.
This was a convenient excuse to create the pyport.h file recently discussed! Please use new Py_ARITHMETIC_RIGHT_SHIFT when right-shifting a signed int and you *need* sign-extension. This is #define'd in pyport.h, keying off new config symbol SIGNED_RIGHT_SHIFT_ZERO_FILLS. If you're running on a platform that needs that symbol #define'd, the std tests never would have worked for you (in particular, at least test_long would have failed). The autoconfig stuff got added to Python after my Unix days, so I don't know how that works. Would someone please look into doing & testing an auto-config of the SIGNED_RIGHT_SHIFT_ZERO_FILLS symbol? It needs to be defined if & only if, e.g., (-1) >> 3 is not -1.
Diffstat (limited to 'Include/longintrepr.h')
-rw-r--r--Include/longintrepr.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Include/longintrepr.h b/Include/longintrepr.h
index 4ddbd06e59..fed01ed8b1 100644
--- a/Include/longintrepr.h
+++ b/Include/longintrepr.h
@@ -18,7 +18,7 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
/* Parameters of the long integer representation.
These shouldn't have to be changed as C should guarantee that a short
- contains at least 16 bits, but it's made changeable any way.
+ contains at least 16 bits, but it's made changeable anyway.
Note: 'digit' should be able to hold 2*MASK+1, and 'twodigits'
should be able to hold the intermediate results in 'mul'
(at most MASK << SHIFT).
@@ -28,8 +28,9 @@ redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
typedef unsigned short digit;
typedef unsigned int wdigit; /* digit widened to parameter size */
-typedef unsigned long twodigits;
-typedef long stwodigits; /* signed variant of twodigits */
+#define BASE_TWODIGITS_TYPE long
+typedef unsigned BASE_TWODIGITS_TYPE twodigits;
+typedef BASE_TWODIGITS_TYPE stwodigits; /* signed variant of twodigits */
#define SHIFT 15
#define BASE ((digit)1 << SHIFT)