[PATCH 2/3] riched20: Reduce code duplication in WM_SETTEXT/WM_CREATE handler

Henri Verbeet hverbeet at gmail.com
Tue Jun 2 05:37:22 CDT 2015

On 2 June 2015 at 11:22, Nikolay Sivov <nsivov at codeweavers.com> wrote:
> On 06/02/2015 11:41 AM, Dmitry Timoshkov wrote:
>> Nikolay Sivov <nsivov at 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.

More information about the wine-devel mailing list