qemu-devel
[Top][All Lists]
Advanced

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

Re: braces [was Re: [Qemu-devel] [PATCH 03/19] Remove double error messa


From: Michael S. Tsirkin
Subject: Re: braces [was Re: [Qemu-devel] [PATCH 03/19] Remove double error message in qemu_option_set()]
Date: Fri, 11 Sep 2009 08:01:14 +0300
User-agent: Mutt/1.5.19 (2009-01-05)

On Thu, Sep 10, 2009 at 07:36:09PM +0100, Mark McLoughlin wrote:
> On Thu, 2009-09-10 at 21:03 +0300, Michael S. Tsirkin wrote:
> > On Thu, Sep 10, 2009 at 04:18:45PM +0100, Mark McLoughlin wrote:
> > > qemu_opt_set() prints an error message in all failure cases, so
> > > qemu_set_option() doesn't need to print another error.
> > > 
> > > Signed-off-by: Mark McLoughlin <address@hidden>
> > 
> > Same comment about {} here
> 
> That's 3 of these you and Juan have found. And, genuinely, I try not to
> do this. Just shows how much of reflex it is.
> 
> IMHO,
> 
>   if (blaa(foo, bar, doodah) == NULL)
>       return -1;
> 
> is far nicer than:
> 
>   if (blaa(foo, bar, doodah) == NULL) {
>       return -1;
>   }
> 
> but OTOH, this:
> 
>   if (blaa(foo, bar, doodah) == NULL) {
>       return doodah(foo, bar, blaa);
>   }
> 
> *is* arguably better than:
> 
>   if (blaa(foo, bar, doodah) == NULL)
>       return doodah(foo, bar, blaa);

And 
  if (!blaa(foo, bar, doodah))
is even better :)

> There's enough of both ways in the code that I think either should be
> acceptable.
> 
> Cheers,
> Mark.




reply via email to

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