Revision 2cdaca90 hw/display/pxa2xx_template.h

b/hw/display/pxa2xx_template.h
11 11

  
12 12
# define SKIP_PIXEL(to)		to += deststep
13 13
#if BITS == 8
14
# define COPY_PIXEL(to, from)	*to = from; SKIP_PIXEL(to)
14
# define COPY_PIXEL(to, from)  do { *to = from; SKIP_PIXEL(to); } while (0)
15 15
#elif BITS == 15 || BITS == 16
16
# define COPY_PIXEL(to, from)	*(uint16_t *) to = from; SKIP_PIXEL(to)
16
# define COPY_PIXEL(to, from)    \
17
    do {                         \
18
        *(uint16_t *) to = from; \
19
        SKIP_PIXEL(to);          \
20
    } while (0)
17 21
#elif BITS == 24
18
# define COPY_PIXEL(to, from)	\
19
	*(uint16_t *) to = from; *(to + 2) = (from) >> 16; SKIP_PIXEL(to)
22
# define COPY_PIXEL(to, from)     \
23
    do {                          \
24
        *(uint16_t *) to = from;  \
25
        *(to + 2) = (from) >> 16; \
26
        SKIP_PIXEL(to);           \
27
    } while (0)
20 28
#elif BITS == 32
21
# define COPY_PIXEL(to, from)	*(uint32_t *) to = from; SKIP_PIXEL(to)
29
# define COPY_PIXEL(to, from)    \
30
    do {                         \
31
        *(uint32_t *) to = from; \
32
        SKIP_PIXEL(to);          \
33
    } while (0)
22 34
#else
23 35
# error unknown bit depth
24 36
#endif

Also available in: Unified diff