Revision 2cdaca90 hw/display/pl110_template.h

b/hw/display/pl110_template.h
14 14
#if BITS == 8
15 15
#define COPY_PIXEL(to, from) *(to++) = from
16 16
#elif BITS == 15 || BITS == 16
17
#define COPY_PIXEL(to, from) *(uint16_t *)to = from; to += 2;
17
#define COPY_PIXEL(to, from) do { *(uint16_t *)to = from; to += 2; } while (0)
18 18
#elif BITS == 24
19
#define COPY_PIXEL(to, from) \
20
  *(to++) = from; *(to++) = (from) >> 8; *(to++) = (from) >> 16
19
#define COPY_PIXEL(to, from)    \
20
    do {                        \
21
        *(to++) = from;         \
22
        *(to++) = (from) >> 8;  \
23
        *(to++) = (from) >> 16; \
24
    } while (0)
21 25
#elif BITS == 32
22
#define COPY_PIXEL(to, from) *(uint32_t *)to = from; to += 4;
26
#define COPY_PIXEL(to, from) do { *(uint32_t *)to = from; to += 4; } while (0)
23 27
#else
24 28
#error unknown bit depth
25 29
#endif

Also available in: Unified diff