aboutsummaryrefslogtreecommitdiff
path: root/hw/cirrus_vga_rop2.h
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-10-13 18:38:07 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-10-13 18:38:07 +0000
commit8c78881f481401ec3cfbdce2267101cf300cd4b1 (patch)
treee2c939028fae613d76205f608b139c0224ae0181 /hw/cirrus_vga_rop2.h
parent83e3f76c2565a06877dc415ac9f5cf6f1c75614c (diff)
cirrus: avoid write only variables
Compiling with GCC 4.6.0 20100925 produced a lot of warnings like: In file included from /src/qemu/hw/cirrus_vga_rop.h:174:0, from /src/qemu/hw/cirrus_vga.c:284: /src/qemu/hw/cirrus_vga_rop2.h: In function 'cirrus_patternfill_0_8': /src/qemu/hw/cirrus_vga_rop2.h:48:18: error: variable 'col' set but not used [-Werror=unused-but-set-variable] /src/qemu/hw/cirrus_vga_rop2.h: In function 'cirrus_colorexpand_transp_0_8': /src/qemu/hw/cirrus_vga_rop2.h:104:18: error: variable 'col' set but not used [-Werror=unused-but-set-variable] Fix the warnings by introducing an inline function, which avoids exposing write-only variables. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/cirrus_vga_rop2.h')
-rw-r--r--hw/cirrus_vga_rop2.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/hw/cirrus_vga_rop2.h b/hw/cirrus_vga_rop2.h
index 81a5b398e0..d28bcc6f25 100644
--- a/hw/cirrus_vga_rop2.h
+++ b/hw/cirrus_vga_rop2.h
@@ -23,15 +23,15 @@
*/
#if DEPTH == 8
-#define PUTPIXEL() ROP_OP(d[0], col)
+#define PUTPIXEL() ROP_OP(&d[0], col)
#elif DEPTH == 16
-#define PUTPIXEL() ROP_OP(((uint16_t *)d)[0], col);
+#define PUTPIXEL() ROP_OP_16((uint16_t *)&d[0], col)
#elif DEPTH == 24
-#define PUTPIXEL() ROP_OP(d[0], col); \
- ROP_OP(d[1], (col >> 8)); \
- ROP_OP(d[2], (col >> 16))
+#define PUTPIXEL() ROP_OP(&d[0], col); \
+ ROP_OP(&d[1], (col >> 8)); \
+ ROP_OP(&d[2], (col >> 16))
#elif DEPTH == 32
-#define PUTPIXEL() ROP_OP(((uint32_t *)d)[0], col)
+#define PUTPIXEL() ROP_OP_32(((uint32_t *)&d[0]), col)
#else
#error unsupported DEPTH
#endif