summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2009-07-21 06:27:14 (GMT)
committerThomas Heller <theller@ctypes.org>2009-07-21 06:27:14 (GMT)
commit6adda9641d41c858cfe2318f9e4e5b898ee1dce4 (patch)
treea6a4f5f1d67d5a732f9bbc51af761ee01f6671dc /Modules
parent4d4b7398a283da7f8cf0e2f7bc7abd9a054b169f (diff)
downloadcpython-6adda9641d41c858cfe2318f9e4e5b898ee1dce4.zip
cpython-6adda9641d41c858cfe2318f9e4e5b898ee1dce4.tar.gz
cpython-6adda9641d41c858cfe2318f9e4e5b898ee1dce4.tar.bz2
Issue #6493: Fix a ctypes problem setting bitfields more than 31 bits
wide.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/cfield.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index bf247bc..7663481 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -426,9 +426,9 @@ get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
#define LOW_BIT(x) ((x) & 0xFFFF)
#define NUM_BITS(x) ((x) >> 16)
-/* This seems nore a compiler issue than a Windows/non-Windows one */
+/* This seems more a compiler issue than a Windows/non-Windows one */
#ifdef MS_WIN32
-# define BIT_MASK(size) ((1 << NUM_BITS(size))-1)
+# define BIT_MASK(size) ((1i64 << NUM_BITS(size))-1)
#else
# define BIT_MASK(size) ((1LL << NUM_BITS(size))-1)
#endif