[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH target-arm] display: avoid multi-statement macro
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH target-arm] display: avoid multi-statement macro |
Date: |
Fri, 24 Jan 2014 17:52:10 +0000 |
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 ?
thanks
-- PMM