[Bug 33009] New: Logical error in code isStateDirty
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(a)winehq.org ReportedBy: roman.marusyk(a)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; -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33009 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID --- Comment #1 from Alexandre Julliard <julliard(a)winehq.org> 2013-02-18 16:27:39 CST --- (In reply to comment #0)
sizeof(BOOL) is not always a 32bits
Yes it is. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33009 --- Comment #2 from Roman Marusyk <roman.marusyk(a)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. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=33009 Dmitry Timoshkov <dmitry(a)baikal.ru> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #3 from Dmitry Timoshkov <dmitry(a)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. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org