http://bugs.winehq.org/show_bug.cgi?id=33009
Bug #: 33009 Summary: Logical error in code isStateDirty Product: Wine Version: unspecified Platform: x86 OS/Version: Mac OS X Status: UNCONFIRMED Severity: major Priority: P2 Component: directx-d3d AssignedTo: wine-bugs@winehq.org ReportedBy: roman.marusyk@gmail.com Classification: Unclassified
wined3d_private.h have a static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state) .... (line 1792) return context->isStateDirty[idx] & (1 << shift);
sizeof(BOOL) is not always a 32bits
if someone compile and built only wined3d on macos BOOL is typedef char BOOL;
and code return x & (1 << shift) very bad for example return x & (1 << 24) is a return x & (0x01000000) if BOOL is typedef char , we have always return FALSE
anyway, better write return (context->isStateDirty[idx] & (1 << shift)) != 0;
http://bugs.winehq.org/show_bug.cgi?id=33009
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID
--- Comment #1 from Alexandre Julliard julliard@winehq.org 2013-02-18 16:27:39 CST --- (In reply to comment #0)
sizeof(BOOL) is not always a 32bits
Yes it is.
http://bugs.winehq.org/show_bug.cgi?id=33009
--- Comment #2 from Roman Marusyk roman.marusyk@gmail.com 2013-02-18 16:46:19 CST --- MacOS10.8 /usr/include/objc/objc.h
typedef signed char BOOL;
it is a bad practice to return BOOL after bitwise operation. good practice is always to compare with zero.
http://bugs.winehq.org/show_bug.cgi?id=33009
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #3 from Dmitry Timoshkov dmitry@baikal.ru 2013-02-18 19:11:27 CST --- (In reply to comment #2)
MacOS10.8 /usr/include/objc/objc.h
typedef signed char BOOL;
You are looking in the wrong header.