svn commit: samba r6426 - in branches/SAMBA_4_0/source/torture/libnet: .

Andrew Bartlett abartlet at samba.org
Fri Apr 22 13:40:40 GMT 2005


On Fri, 2005-04-22 at 12:30 +1000, Rafal Szczesniak wrote:
> On Thu, Apr 21, 2005 at 06:20:34PM -0700, Richard Sharpe wrote:
> > On Fri, 22 Apr 2005 mimir at samba.org wrote:
> > 
> > > -	if (!NT_STATUS_IS_OK(status)) {
> > > -		return False;
> > > -	}
> > > +	if (!NT_STATUS_IS_OK(status)) return False;
> > 
> > I don't think this is a big item, but I actually prefer the first one
> > above that was deleted, because it makes things much easier when you are
> > inserting debugging statements and so forth, at the cost of a few more
> > characters.
> 
> Certainly, when you add debug statements you use the deleted form.
> I changed it to single line because it is smaller. Once I put there
> something more it will be just what you prefer.

The Samba4 coding style is, as I understand it, that we should never
discard braces.  It is too easy to either us a macro (which expands to
more than one statement, and may not be guarded as a while (0)), or
simply to add another line, particularly if you keep the indentation but
forget to add the braces.

Lines are cheap, bugs are expensive :-)

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Student Network Administrator, Hawker College  http://hawkerc.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20050422/d957cf83/attachment.bin


More information about the samba-technical mailing list