https://bugs.winehq.org/show_bug.cgi?id=43912
Bug ID: 43912 Summary: wine-2.0.3/programs/wineboot/wineboot.c:684]: (style) Suspicious condition Product: Wine Version: 2.0.3 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: programs Assignee: wine-bugs@winehq.org Reporter: dcb314@hotmail.com Distribution: ---
wine-2.0.3/programs/wineboot/wineboot.c:684]: (style) Suspicious condition (assignment + comparison); Clarify expression with parentheses.
Source code is
if ((res = RegCreateKeyExW( hkWin, szKeyName, 0, NULL, 0, bDelete ? KEY_ALL_ACCESS : KEY_READ, NULL, &hkRun, &dispos ) != ERROR_SUCCESS))
Maybe better code
if ((res = RegCreateKeyExW( hkWin, szKeyName, 0, NULL, 0, bDelete ? KEY_ALL_ACCESS : KEY_READ, NULL, &hkRun, &dispos )) != ERROR_SUCCESS)
https://bugs.winehq.org/show_bug.cgi?id=43912
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |dark.shadow4@web.de
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- Seems right, did you already send in a patch?
https://bugs.winehq.org/show_bug.cgi?id=43912
--- Comment #2 from David Binderman dcb314@hotmail.com --- (In reply to Fabian Maurer from comment #1)
Seems right, did you already send in a patch?
No I leave patches to folks who know the code.
https://bugs.winehq.org/show_bug.cgi?id=43912
--- Comment #3 from Fabian Maurer dark.shadow4@web.de ---
No I leave patches to folks who know the code.
I don't think there's much you could do wrong, you found a potential problem and propose a solution. If you understand it enough to propose a fix, why not send it in? Don't worry, if it's wrong then the reviewer will tell you.
https://bugs.winehq.org/show_bug.cgi?id=43912
Gijs Vermeulen gijsvrm@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gijsvrm@gmail.com
--- Comment #4 from Gijs Vermeulen gijsvrm@gmail.com --- https://source.winehq.org/git/wine.git/commit/8fc3f3437c260db23ddff453f9a9d5...
https://bugs.winehq.org/show_bug.cgi?id=43912
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Fixed by SHA1| |8fc3f3437c260db23ddff453f9a | |9d5f79564b24d Status|UNCONFIRMED |RESOLVED
--- Comment #5 from Nikolay Sivov bunglehead@gmail.com --- Marking fixed, 8fc3f3437c260db23ddff453f9a9d5f79564b24d.
https://bugs.winehq.org/show_bug.cgi?id=43912
Giacomo Orlandi gia_@inwind.it changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gia_@inwind.it
--- Comment #6 from Giacomo Orlandi gia_@inwind.it --- I think it's better to avoid an assignment inside an if condition. You save 1 line but you lose a lot more in readability. And we wouldn't have needed any discussion about the parentheses either...
I'm not bitching, just giving a suggestion! And I'm not a C programmer, but I'm my opinion this suggestion applies to all languages.
https://bugs.winehq.org/show_bug.cgi?id=43912
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #7 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 2.20.
https://bugs.winehq.org/show_bug.cgi?id=43912
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.0.x
https://bugs.winehq.org/show_bug.cgi?id=43912
Michael Stefaniuc mstefani@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|2.0.x |---
--- Comment #8 from Michael Stefaniuc mstefani@winehq.org --- Removing the 2.0.x milestone from bugs included in 2.0.4.