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

2012-07-18 Thread Meador Inge
Changes by Meador Inge : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ _

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

2012-07-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset 77401bd4f567 by Meador Inge in branch '2.7': Issue #6493: Fix handling of c_uint32 bitfields with width of 32 on Windows. http://hg.python.org/cpython/rev/77401bd4f567 New changeset 153ae76b963e by Meador Inge in branch '3.2': Issue #6493: Fix hand

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

2012-07-18 Thread Meador Inge
Meador Inge added the comment: The problem is with the 'BIT_MASK' macro, which is currently defined as the following for Windows: #define BIT_MASK(size) ((1 << NUM_BITS(size))-1) The C standard says that any attempt to shift left by exactly the bit width is undefined behavior. For the gi

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

2012-07-16 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- assignee: theller -> components: +Library (Lib), Windows nosy: +meador.inge stage: commit review -> patch review versions: +Python 3.3 -Python 3.1 ___ Python tracker _

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

2012-07-16 Thread HCT
HCT added the comment: Hirokazu's v3 patch is a clean solution for the issue and works on 3.2 any update on when it will go into 3.2/3.3? I can help if needed -- nosy: +hct ___ Python tracker

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

2011-07-10 Thread Vlad Riscutia
Vlad Riscutia added the comment: I have a similar patch for issue 6068. I wasn't aware of this issue when I looked into it. I believe both patches fix the same thing (please take a look and correct me if I'm wrong). My fix: we don't need to treat Windows differently, just remove #ifdef and

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

2010-10-03 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: This patch removes MAX_SIZE_INT limitation. I hope this is final patch. I confirmed all ctypes test passed on my environment. (Windows, VS8.0) -- Added file: http://bugs.python.org/file19123/py3k_fix_ctypes_cfields_v3.patch _

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

2010-10-03 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Removed file: http://bugs.python.org/file19121/py3k_fix_ctypes_cfields_v2.patch ___ Python tracker ___ ___ Pytho

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

2010-10-03 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Added file: http://bugs.python.org/file19122/py3k_fix_ctypes_cfields_v2.patch ___ Python tracker ___ ___ Python-

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

2010-10-03 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Sorry,my patch didn't work again... Because of this compiler behavior. Is this ANSI standard? #include typedef unsigned __int32 uint32; static void print_bits(uint32 n) { int i; for (i = 31; i >= 0; --i) { printf("%c", (n & (1 << i))

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

2010-10-03 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Removed file: http://bugs.python.org/file14507/ctypes_workaround_2.patch ___ Python tracker ___ ___ Python-bugs-

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

2010-10-03 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Removed file: http://bugs.python.org/file14506/ctypes_workaround.patch ___ Python tracker ___ ___ Python-bugs-li

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

2010-10-03 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: Here is at least better, simple patch. But ideally, mask should be created from variable type. "short" mask should be created for "short" variable, "long long" mask for "long long" variable, vise verse. I'll create such patch next. I hope it's final solution

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

2010-10-03 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: I glanced at my patch again, and I noticed it has a problem. SET() cannot handle type larger than unsigned int on windows. I'll recreate the patch... -- nosy: +ned.deily, stutzbach ___ Python tracker

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

2009-07-21 Thread Thomas Heller
Thomas Heller added the comment: ctypes_workaround_2.patch from ocean-city seems to fix it so I'll apply that. -- title: Can not set value for structure members larger than 32 bits -> Can not set value for structure members larger than 32 bits ___

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

2009-07-21 Thread Thomas Heller
Thomas Heller added the comment: > One of the new tests in r74134 is failing on my box (Gentoo x86), and on > a number of the buildbots: I've seen that, but do not yet have a patch. -- title: Can not set value for structure members larger than 32 bits -> Can not set value for structur

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

2009-07-21 Thread R. David Murray
Changes by R. David Murray : -- priority: -> normal stage: -> commit review type: -> behavior versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5, Python 3.0 ___ Python tracker _

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

2009-07-21 Thread R. David Murray
R. David Murray added the comment: One of the new tests in r74134 is failing on my box (Gentoo x86), and on a number of the buildbots: test test_ctypes failed -- Traceback (most recent call last): File "/home/rdmurray/python/trunk/Lib/ctypes/test/test_bitfields.py", line 255, in test_uint64

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

2009-07-16 Thread Hirokazu Yamamoto
Changes by Hirokazu Yamamoto : Added file: http://bugs.python.org/file14507/ctypes_workaround_2.patch ___ Python tracker ___ ___ Python-bugs-li

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

2009-07-16 Thread Hirokazu Yamamoto
Hirokazu Yamamoto added the comment: What's your platform? I could reproduce this on windows. And I found attached patch can workaround this. -- keywords: +patch nosy: +ocean-city Added file: http://bugs.python.org/file14506/ctypes_workaround.patch

[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 ___ ___ Python-bugs-list mailing list Unsubscri

[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 and 2.6.2: