[PATCH] lib: Fix whitespace in params.c

Michael Adam obnox at samba.org
Mon Aug 11 13:52:05 MDT 2014


On 2014-08-11 at 11:37 -0500, Christopher R. Hertel wrote:
> That particular file hasn't been modified in more than two years.
> Modifying the formating at this point would not (IMHO) lose
> significant history, and would bring that file into compliance with
> current project standards.

Well, as I said in my previous email, the way we handled this in
the last couple of years is to allow for whitespace cleanup,
since they don't disturb history (be important or not), and
not to do other kinds of formatting.
If we touch code because we really change something,
then we usually try to adapt the touched lines to the
agreed formatting.

We can of course re-discuss this (unwritten?) rule that I
think we have good reasons for.

> I do find it concerning that our current formatting style isn't
> supported by indent.

Why would that be concerning?
Why would one want to use indent if one can
just carefully format when coding in the first place? :-)
(At least I never felt the need to use indent.)

Well, I don't know for sure it is not.
It probably is!
But that is pretty irrelevant since we don't reformat files. ;-)

> How about astyle?  Shouldn't we be using a
> style that is standard enough that there is support for it?
> (Whitesmith, by the way, is supported by astyle.)

That is certainly true, but for me it is almost unreadable,
since it completely contradicts what I am accustomed to,
but that is just me... :-)

I guess that our style is in fact pretty standard,
up to today I only did not care enough to sarch whether
it has a name. (And if there is none, we could coin one.)

> Volker:  The use of ( NULL==ptr ) vs. ( ptr==NULL ) is a common trick
>          used to help catch forgotten equal signs.  ( NULL=ptr ) will
>          cause a compiler error while ( ptr=NULL ) is a valid assignment.
>          ...but that's just an explanation.  I'm not advocating for it.

I also do not find this strange but a useful and not
counter-intuitive "trick". But as we seem to have compiler
protection, it seems not to be really necessary.
But I don't see a good reason to change those occurrences.
(It is valid, and there are good reasons for it.)
And this is not about formatting any more...

Cheers - Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140811/267c2445/attachment.pgp>


More information about the samba-technical mailing list