cg3: add explicit ram_addr_t cast to scanline page variable
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Mon, 1 May 2017 07:33:47 +0000 (08:33 +0100)
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fri, 5 May 2017 08:49:00 +0000 (09:49 +0100)
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 <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
hw/display/cg3.c

index 03d9197f71c5264e69ea01e70fd81705c6dd47b0..7ef8a96496127896b258b3f5274e49ec8430dee6 100644 (file)
@@ -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) {