[PATCH v2 1/2] comctl32/edit: Move common calls outside the blocks

Gabriel Iv─âncescu gabrielopcode at gmail.com
Thu Aug 23 14:22:56 CDT 2018


On Thu, Aug 23, 2018 at 8:19 PM, Nikolay Sivov <nsivov at codeweavers.com> wrote:
> Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
>
> I still think ~0u would be better, if only to match argument type.
>
>

The thing is that the argument type is a typedef (UINT). Here's an
imagined scenario (one of my crazy thoughts). Say UINT on some other
wacky platform, is typedef to long, and long is 64-bits there instead
of 32-bits like int is. ~ is unary operator so it applies to 0u, and
since int is 32-bits, this becomes silently zero-extended (since it's
unsigned) to 0x00000000FFFFFFFF instead of sign-extended to
0xFFFFFFFFFFFFFFFF.

Though yes, it doesn't really matter in practice and probably will
never apply to UINT itself, just a (bad?) habit of mine. :)



More information about the wine-devel mailing list