Re: [PATCH 2/3] riched20: Reduce code duplication in WM_SETTEXT/WM_CREATE handler
Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
+ if (lParam) + text = unicode ? (void*)createW->lpszName : (void*)createA->lpszName;
These casts should not be needed. -- Dmitry.
On 06/02/2015 11:41 AM, Dmitry Timoshkov wrote:
Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
+ if (lParam) + text = unicode ? (void*)createW->lpszName : (void*)createA->lpszName;
These casts should not be needed.
I get warnings without them, so I prefer to keep this as it was before my patch.
On 2 June 2015 at 11:22, Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
On 06/02/2015 11:41 AM, Dmitry Timoshkov wrote:
Nikolay Sivov <nsivov(a)codeweavers.com> wrote:
+ if (lParam) + text = unicode ? (void*)createW->lpszName : (void*)createA->lpszName;
These casts should not be needed.
I get warnings without them, so I prefer to keep this as it was before my patch.
I suppose it's mostly down to preference, but you actually don't really need the conditional at all, since the only difference between CREATESTRUCTW and CREATESTRUCTA is the type of the pointers. I.e., you could essentially just do "ME_SetText(editor, ((CREATESTRUCTW *)lParam)->lpszName, unicode);". After doing a couple of const-correctness fixes first anyway.
participants (3)
-
Dmitry Timoshkov -
Henri Verbeet -
Nikolay Sivov