diff options
author | Avi Kivity <avi@redhat.com> | 2009-05-03 22:25:16 +0300 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-05-08 16:11:38 -0500 |
commit | 4e12cd946f9e7a6e3d35bcce0bc7bfe38cec4eb7 (patch) | |
tree | 1b3d29a0a137dac44efe97ac1e89e2d4ca8676c3 /hw/cirrus_vga_rop.h | |
parent | fbb7b4e0804d2168f24142eebf7552adde1968dc (diff) |
vga: Replace VGA_COMMON with a structure
All VGA devices share a common field subset; currently they do so by
a macro which defines the common fields inline their state structures,
relying on the the common state being placed at offset 0 in the structure.
This makes refactoring the code difficult and requires a lot of error prone
casts.
Replace the macro by a new VGACommonState structure, and the casts by
regular field access and container_of() for upcasts.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/cirrus_vga_rop.h')
-rw-r--r-- | hw/cirrus_vga_rop.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/cirrus_vga_rop.h b/hw/cirrus_vga_rop.h index 0079d12701..39a7b7285b 100644 --- a/hw/cirrus_vga_rop.h +++ b/hw/cirrus_vga_rop.h @@ -82,7 +82,7 @@ glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_8)(CirrusVGAState *s, for (x = 0; x < bltwidth; x++) { p = *dst; ROP_OP(p, *src); - if (p != s->gr[0x34]) *dst = p; + if (p != s->vga.gr[0x34]) *dst = p; dst++; src++; } @@ -105,7 +105,7 @@ glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_8)(CirrusVGAState *s, for (x = 0; x < bltwidth; x++) { p = *dst; ROP_OP(p, *src); - if (p != s->gr[0x34]) *dst = p; + if (p != s->vga.gr[0x34]) *dst = p; dst--; src--; } @@ -130,7 +130,7 @@ glue(glue(cirrus_bitblt_rop_fwd_transp_, ROP_NAME),_16)(CirrusVGAState *s, p2 = *(dst+1); ROP_OP(p1, *src); ROP_OP(p2, *(src+1)); - if ((p1 != s->gr[0x34]) || (p2 != s->gr[0x35])) { + if ((p1 != s->vga.gr[0x34]) || (p2 != s->vga.gr[0x35])) { *dst = p1; *(dst+1) = p2; } @@ -158,7 +158,7 @@ glue(glue(cirrus_bitblt_rop_bkwd_transp_, ROP_NAME),_16)(CirrusVGAState *s, p2 = *dst; ROP_OP(p1, *(src-1)); ROP_OP(p2, *src); - if ((p1 != s->gr[0x34]) || (p2 != s->gr[0x35])) { + if ((p1 != s->vga.gr[0x34]) || (p2 != s->vga.gr[0x35])) { *(dst-1) = p1; *dst = p2; } |