]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Revert rev 74134, as it does not completely fixx issue #6493.
authorThomas Heller <theller@ctypes.org>
Tue, 21 Jul 2009 19:04:02 +0000 (19:04 +0000)
committerThomas Heller <theller@ctypes.org>
Tue, 21 Jul 2009 19:04:02 +0000 (19:04 +0000)
Lib/ctypes/test/test_bitfields.py
Misc/NEWS
Modules/_ctypes/cfield.c

index 211d1db022a6d171c09dbc963361ebfa130f66ff..e9c46c2c2037a28f0ac52815dd8d3d017634cb38 100644 (file)
@@ -240,20 +240,5 @@ class BitFieldTest(unittest.TestCase):
             _anonymous_ = ["_"]
             _fields_ = [("_", X)]
 
-    def test_uint32(self):
-        class X(Structure):
-            _fields_ = [("a", c_uint32, 32)]
-        x = X()
-        x.a = 10
-        self.failUnlessEqual(x.a, 10)
-
-    def test_uint64(self):
-        class X(Structure):
-            _fields_ = [("a", c_uint64, 64)]
-        x = X()
-        x.a = 10
-        self.failUnlessEqual(x.a, 10)
-
-
 if __name__ == "__main__":
     unittest.main()
index d175786e5ed963df5a842a1ecbb5679de21db19a..77e3ac6acae56258ac874d6d6d77d5b4910c258b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -349,8 +349,6 @@ Core and Builtins
 Library
 -------
 
-- Issue #6493: Fix a ctypes problem setting bitfields more than 31 bits wide.
-
 - unittest has been split up into a package.  All old names should still work.
 
 - Issue #6431: Make Fraction type return NotImplemented when it doesn't
index 766348189afadc0062bf00775019e232b322147b..bf247bc41b7faac8d406a25c92fb7c4c39ddf8cf 100644 (file)
@@ -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 more a compiler issue than a Windows/non-Windows one */
+/* This seems nore a compiler issue than a Windows/non-Windows one */
 #ifdef MS_WIN32
-#  define BIT_MASK(size) ((1i64 << NUM_BITS(size))-1)
+#  define BIT_MASK(size) ((1 << NUM_BITS(size))-1)
 #else
 #  define BIT_MASK(size) ((1LL << NUM_BITS(size))-1)
 #endif