From b290f3b12e30e4da7acd10662e85ae8b37d75d44 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Mon, 1 May 2017 08:33:47 +0100 Subject: [PATCH 1/2] tcx: fix cut/paste error in update_palette_entries() Commit ee72bed0 "tcx: remove primitives for non-32-bit surfaces" accidentally left a trailing break in update_palette_entries() causing the palette update routine to exit after just one iteration. Remove it. Signed-off-by: Mark Cave-Ayland --- hw/display/tcx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/display/tcx.c b/hw/display/tcx.c index 5a1115cc65..0e66dcd055 100644 --- a/hw/display/tcx.c +++ b/hw/display/tcx.c @@ -145,7 +145,6 @@ static void update_palette_entries(TCXState *s, int start, int end) } else { s->palette[i] = rgb_to_pixel32(s->r[i], s->g[i], s->b[i]); } - break; } tcx_set_dirty(s, 0, memory_region_size(&s->vram_mem)); } From 8eb57ae3f9afdd8d911f3b2862e05cd0bb042b4e Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Mon, 1 May 2017 08:33:47 +0100 Subject: [PATCH 2/2] cg3: add explicit ram_addr_t cast to scanline page variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coverity warns that multiplying two 32-bit values gives a 32-bit result which is assigned to a 64-bit variable. Add an explicit ram_addr_t cast to silence the warning. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/display/cg3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/display/cg3.c b/hw/display/cg3.c index 03d9197f71..7ef8a96496 100644 --- a/hw/display/cg3.c +++ b/hw/display/cg3.c @@ -113,7 +113,7 @@ static void cg3_update_display(void *opaque) for (y = 0; y < height; y++) { int update = s->full_update; - page = y * width; + page = (ram_addr_t)y * width; update |= memory_region_get_dirty(&s->vram_mem, page, width, DIRTY_MEMORY_VGA); if (update) {