qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH target-arm] display: avoid multi-statement macro


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH target-arm] display: avoid multi-statement macro
Date: Fri, 24 Jan 2014 18:53:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Il 24/01/2014 18:52, Peter Maydell ha scritto:
On 24 January 2014 17:47, Paolo Bonzini <address@hidden> wrote:
For blizzard, pl110 and tc6393xb this is harmless, but for pxa2xx
Coverity noticed that it is used inside an "if" statement.
Fix it because it's the file with the highest number of defects
in the whole QEMU tree!

Signed-off-by: Paolo Bonzini <address@hidden>
---
 hw/display/blizzard_template.h | 10 +++++-----
 hw/display/pl110_template.h    |  6 +++---
 hw/display/pxa2xx_template.h   |  8 ++++----
 hw/display/tc6393xb_template.h |  8 ++++----
 4 files changed, 22 insertions(+), 23 deletions(-)

diff --git a/hw/display/blizzard_template.h b/hw/display/blizzard_template.h
index a8a8899..b899a29 100644
--- a/hw/display/blizzard_template.h
+++ b/hw/display/blizzard_template.h
@@ -21,21 +21,21 @@
 #define SKIP_PIXEL(to)         to += deststep
 #if DEPTH == 8
 # define PIXEL_TYPE            uint8_t
-# define COPY_PIXEL(to, from)  *to = from; SKIP_PIXEL(to)
+# define COPY_PIXEL(to, from)  *to = from, SKIP_PIXEL(to)

Why not use the standard do { ... } while(0) idiom ?

I figured that this would make the patch easier to review, but I can use "do {...} while(0)" too (either directly or as a follow up).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]