Issue 352 in pyglet: Wraptypes does not wrap enum values properly

0 views
Skip to first unread message

codesite...@google.com

unread,
Oct 3, 2008, 2:07:05 PM10/3/08
to pyglet...@googlegroups.com
Issue 352: Wraptypes does not wrap enum values properly
http://code.google.com/p/pyglet/issues/detail?id=352

New issue report by fred.reichbier:
What steps will reproduce the problem?
1. create a file testlib.h containing the following code:

typedef enum test_enumeration {
T1 = (1 << 2),
T2 = (1 << 3)
} test_enumeration;

2. run python wrap.py testlib.h in tools/wraptypes
3. check the generated testlib.py; The value T1 is wrapped as 0, T2 as 1
instead of 4 and 8.

Attachments:
pyglet_info 6.3 KB


Issue attributes:
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

codesite...@google.com

unread,
Oct 3, 2008, 3:04:20 PM10/3/08
to pyglet...@googlegroups.com
Issue 352: Wraptypes does not wrap enum values properly
http://code.google.com/p/pyglet/issues/detail?id=352

Comment #1 by fred.reichbier:
I could figure out a solution; the values used for bitshifting weren't
integers.

I attached a patch.

Attachments:
bitshift.patch 550 bytes

codesite...@google.com

unread,
Oct 3, 2008, 9:07:58 PM10/3/08
to pyglet...@googlegroups.com
Issue 352: Wraptypes does not wrap enum values properly
http://code.google.com/p/pyglet/issues/detail?id=352

Comment #2 by Alex.Holkner:
Thanks, fixed in r2283. I actually applied a different patch to fix the
problem
(attached), which should also cover some similar cases.

Attachments:
bitshift2.patch 539 bytes


Issue attribute updates:
Status: Fixed
Labels: Component-Scripts

codesite...@google.com

unread,
Oct 4, 2008, 6:48:16 AM10/4/08
to pyglet...@googlegroups.com
Issue 352: Wraptypes does not wrap enum values properly
http://code.google.com/p/pyglet/issues/detail?id=352

Comment #3 by fred.reichbier:
Thank you!

Reply all
Reply to author
Forward
0 new messages