Re: [PATCH] virsh: print error in case of cellno is invalid

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

 



On Wed, Jan 05, 2011 at 10:10:00AM -0700, Eric Blake wrote:
> 
> Style nit: you used:
> 
> if (cond) {
>    abc;
>    def;
> } else
>    xyz;
> 
> But we prefer either:
> 
> if (!cond)
>    xyz;
> else {
>    abc;
>    def;
> }
> 
> or:
> 
> if (cond) {
>    abc;
>    def;
> } else {
>    xyz;
> }
> 
> since HACKING documents that an else clause should only ever omit braces
> when the if clause also omitted braces, but an if clause can omit braces
> even when the else clause requires them.

Hmm, I didn't notice that. I really don't like to see braces in
else clauses, without also seeing braces in the if, and have
been fixing this to add braces whenever I come across it. IMHO
the hacking guideline should only allow

  if (foo)
    bar;
  else
    wizz;

Or

  if (foo) {
    bar;
    ...
  } else {
    wizz;
    ...
  }

Regards,
Daniel

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]