qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 1/8] CODING_STYLE: Section about conditional


From: Alex Bennée
Subject: Re: [Qemu-devel] [PATCH v3 1/8] CODING_STYLE: Section about conditional statement
Date: Tue, 05 Aug 2014 16:48:18 +0100

Gonglei (Arei) writes:

> Hi,
>
>> > Yoda conditions lack readability, and QEMU has a
>> > strict compiler configuration for checking a common
>> > mistake like "if (dev = NULL)". Make it a written rule.
<snip>
>> 
>> I know this is my suggested text, but now that I'm re-reading it, I'd
>> recommend s/0/1/ in all three places, since comparison to 0 is one of
>> those special cases where '!a' is faster to write than 'a == 0'.
>> 
> Got it.

Should we add explicit examples for:

if (x)
if (!x)

then?

-- 
Alex Bennée



reply via email to

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