Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d8431ae3
Commit
d8431ae3
authored
Jul 21, 2009
by
Thomas Heller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert rev 74134, as it does not completely fixx issue #6493.
parent
24d9175e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
19 deletions
+2
-19
Lib/ctypes/test/test_bitfields.py
Lib/ctypes/test/test_bitfields.py
+0
-15
Misc/NEWS
Misc/NEWS
+0
-2
Modules/_ctypes/cfield.c
Modules/_ctypes/cfield.c
+2
-2
No files found.
Lib/ctypes/test/test_bitfields.py
View file @
d8431ae3
...
...
@@ -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
()
Misc/NEWS
View file @
d8431ae3
...
...
@@ -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
...
...
Modules/_ctypes/cfield.c
View file @
d8431ae3
...
...
@@ -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
m
ore a compiler issue than a Windows/non-Windows one */
/* This seems
n
ore a compiler issue than a Windows/non-Windows one */
#ifdef MS_WIN32
# define BIT_MASK(size) ((1
i64
<< NUM_BITS(size))-1)
# define BIT_MASK(size) ((1 << NUM_BITS(size))-1)
#else
# define BIT_MASK(size) ((1LL << NUM_BITS(size))-1)
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment