[issue6068] ctypes is not correctly handling bitfields backed by 64 bit integers on Windows

2011-06-24 Thread higstar
higstar added the comment: Issue was originally found on do sp2 on Python 2.6. Thanks Vlad, this rendered ctypes useless for my purposes, had to mask and shift myself. On Jun 25, 2011 8:32 AM, "Vlad Riscutia" wrote: > > Vlad Riscutia added the comment: > > Attached is

[issue6493] Can not set value for structure members larger than 32 bits

2009-07-15 Thread higstar
higstar added the comment: Also run in 3.0 -- versions: +Python 3.0 ___ Python tracker <http://bugs.python.org/issue6493> ___ ___ Python-bugs-list mailin

[issue6493] Can not set value for structure members larger than 32 bits

2009-07-15 Thread higstar
New submission from higstar : Added a test to test_bitfields.py: def test_uint32(self): class X(Structure): _fields_ = [("a", c_uint32, 32)] x = X() x.a = 10 self.failUnlessEqual(x.a, 10) Run in Python 2.5.2

[issue6069] casting error from ctypes array to structure

2009-05-21 Thread higstar
higstar added the comment: Another example of this: --- import ctypes correct_data_dict = { 'Data0' : 0x, 'Data1' : 0x02, 'Data2' : 0x0AAA, } class closest_fit(ctypes.B

[issue6068] support read/write c_ulonglong type bitfield structures

2009-05-20 Thread higstar
higstar added the comment: I added the following to test_bitfields.py and got the results listed below: def test_ulonglong_crossing_32_boundary(self): class X(BigEndianStructure): _fields_ = [("a", c_ulonglong, 16), ("b", c_ulonglong, 32),

[issue6068] support read/write c_ulonglong type bitfield structures

2009-05-20 Thread higstar
Changes by higstar : -- title: c_ulonglong structure members appear read-only -> support read/write c_ulonglong type bitfield structures ___ Python tracker <http://bugs.python.org/iss

[issue6069] casting error from ctypes array to structure

2009-05-20 Thread higstar
higstar added the comment: After reading the documentation for ctypes (specifically "Bit fields are only possible for integer fields" from section 16.15.1.12) I've updated the test. --- import ctypes import time class uint(ctypes.BigEndianStructure): _pack_ = 1# al

[issue6068] c_ulonglong structure members appear read-only

2009-05-20 Thread higstar
higstar added the comment: Right...I've just found a caveat in section 16.15.1.12 of the html documentation which means this should be a feature request: "Bit fields are only possible for integer fields" -- type: -> feature request

[issue6068] c_ulonglong structure members appear read-only

2009-05-20 Thread higstar
Changes by higstar : -- type: compile error -> ___ Python tracker <http://bugs.python.org/issue6068> ___ ___ Python-bugs-list mailing list Unsubscri

[issue6069] casting error from ctypes array to structure

2009-05-20 Thread higstar
New submission from higstar : Structure fails to correctly cast from a 2 byte bitfield. >From my very limited investigation, is looks like when using a member type of less than the total size of the structure (or at least the size of any byte boundaries) the casting is not done correctly?

[issue6068] c_ulonglong structure members appear read-only

2009-05-20 Thread higstar
New submission from higstar : When defining a structure with members of ctype type c_ulonglong, some members appear read only? I created this test.py and appended the results below: - import ctypes import time class all_ulong(ctypes.BigEndianStructure): _fields_