[ros-dev] [ros-diffs] [jimtabor] 51835: [Win32k|User32] - Move creation of the scrollbar Gray brush from user32 to win32k. - Noticed a color and pattern (patchy white pattern) difference when using GreCreateBitmap and i...
Alexander Potashev
aspotashev at gmail.com
Sun May 22 10:08:14 UTC 2011
2011/5/22 Aleksey Bragin <aleksey at reactos.org>:
> Fantastic, so I suppose whenever I want my double word variable to have a
> value of, say, 0x54 taking your friendly reminder about 8 hex digits into
> account, I would need to write 0x54545454 because, you know, I need 8 hex
> digits for 32-bit numbers and need to add some random stuff to fill it up to
> 8 digits :)
You can use something like this, though it's less self-descriptive:
#include <stdio.h>
typedef unsigned int DWORD;
#define DUP4BYTES(c) ((DWORD)(c) | (DWORD)(c) << 8 | (DWORD)(c) <<
16 | (DWORD)(c) << 24)
int main()
{
unsigned int x = DUP4BYTES(0x54);
printf("x = %08x\n", x);
return 0;
}
GCC is smart enough to produce "movl $0x54545454,-0x4(%rbp)" in its output.
--
Alexander Potashev
More information about the Ros-dev
mailing list