]> Git Repo - qemu.git/blobdiff - hw/display/tc6393xb_template.h
ide: bdrv_attach_dev() for empty CD-ROM
[qemu.git] / hw / display / tc6393xb_template.h
index 154aafd400c28fc1440969dc12836a2540c54999..78629c07f97727fe8476abb2ff373de4d597042a 100644 (file)
  */
 
 #if BITS == 8
-# define SET_PIXEL(addr, color)        *(uint8_t*)addr = color;
+# define SET_PIXEL(addr, color)  (*(uint8_t *)addr = color)
 #elif BITS == 15 || BITS == 16
-# define SET_PIXEL(addr, color)        *(uint16_t*)addr = color;
+# define SET_PIXEL(addr, color)  (*(uint16_t *)addr = color)
 #elif BITS == 24
-# define SET_PIXEL(addr, color)        \
-    addr[0] = color; addr[1] = (color) >> 8; addr[2] = (color) >> 16;
+# define SET_PIXEL(addr, color)  \
+    do {                         \
+        addr[0] = color;         \
+        addr[1] = (color) >> 8;  \
+        addr[2] = (color) >> 16; \
+    } while (0)
 #elif BITS == 32
-# define SET_PIXEL(addr, color)        *(uint32_t*)addr = color;
+# define SET_PIXEL(addr, color)  (*(uint32_t *)addr = color)
 #else
 # error unknown bit depth
 #endif
This page took 0.023578 seconds and 4 git commands to generate.