From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34316) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6kwx-0003O9-8R for qemu-devel@nongnu.org; Fri, 24 Jan 2014 12:53:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W6kwp-0001ub-Kn for qemu-devel@nongnu.org; Fri, 24 Jan 2014 12:53:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W6kwp-0001uM-Dz for qemu-devel@nongnu.org; Fri, 24 Jan 2014 12:53:43 -0500 Message-ID: <52E2A8A2.1000505@redhat.com> Date: Fri, 24 Jan 2014 18:53:38 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1390585631-20904-1-git-send-email-pbonzini@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH target-arm] display: avoid multi-statement macro List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: QEMU Developers Il 24/01/2014 18:52, Peter Maydell ha scritto: > On 24 January 2014 17:47, Paolo Bonzini 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 >> --- >> 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