2004-01-17 21:48:00

by Romain Lievin

[permalink] [raw]
Subject: [PATCH] "gconfig" removed root folder...

Hi,

On Fri, Jan 16, 2004 at 05:14:41PM +0100, Tomas Szepe wrote:
> On Jan-15 2004, Thu, 22:44 +0100
> Romain Lievin <[email protected]> wrote:
>
> > + if(stat(fn, &sb) == -1) return;
>
> Codingstyle inconsistency.

What should I write then ? Your piece of advice may make me better.

>
> Contrary to popular belief, 'if' is _not_ a function nor is it a macro.

Thanks, Romain.
--
Romain Li�vin (roms): <[email protected]>
Web site: http://tilp.info
"Linux, y'a moins bien mais c'est plus cher !"







2004-01-18 07:25:14

by Tomas Szepe

[permalink] [raw]
Subject: Re: [PATCH] "gconfig" removed root folder...

On Jan-17 2004, Sat, 22:47 +0100
Romain Lievin <[email protected]> wrote:

> > On Jan-15 2004, Thu, 22:44 +0100
> > Romain Lievin <[email protected]> wrote:
> >
> > > + if(stat(fn, &sb) == -1) return;
> >
> > Codingstyle inconsistency.
>
> What should I write then ? Your piece of advice may make me better.

Read Documentation/CodingStyle. It is loosely based on the original
K&R style, where (the scarce) language constructs' arguments' opening
parenthese is prepended by a space, whereas with functions and macros
it is not. I.e., one writes 'if (...)', 'while (...)', 'foo(bar)', etc.

Also, your explicit casts could use extra whitespace, like so:
"a = (int *) b;" not "a = (int *)b;"

When submiting code to an existing file, the general rule of thumb
is not to disrupt the style of that particular file, regardless
of what it appears to be. You have managed to break this rule
_and_ the official CodingStyle.

--
Tomas Szepe <[email protected]>