Re: [spice-server] style: Slight tweak to the header guard section

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

 



On Wed, Feb 14, 2018 at 10:43:26PM +0100, Christophe de Dinechin wrote:
> 
> 
> > On 14 Feb 2018, at 17:29, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
> > 
> > This changes the suggested style to what is currently used in
> > spice-server codebase. This also removes a few sentences which
> > are not really related to how one should format their header guards.
> > 
> > Signed-off-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
> > ---
> > docs/spice_style.txt | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/docs/spice_style.txt b/docs/spice_style.txt
> > index c8a4cff66..bc18b1d9e 100644
> > --- a/docs/spice_style.txt
> > +++ b/docs/spice_style.txt
> > @@ -365,12 +365,10 @@ Headers should be protected against multiple inclusion using a macro that contai
> > 
> > ...
> > 
> > -#endif // MY_MODULE_H
> > +#endif /* MY_MODULE_H */
> 
> I had first written it with C style, Frediano suggested C++ style.Both are OK. Currently, we have 44 of one and 208 of the other, so the existing code base does not imply one or the other.

spice/server/*.h is consistently using /* */, and this file is in
spice-server codebase. So I'd rather this reflects what is being done
there ;)

> 
> > ----
> > 
> > -The macro may include additional information, e.g. a component. For example a file generally referenced as foo/bar.h could use a FOO_BAR_H macro.
> 
> Nack the removal. We want a guideline, because right now it’s “anything goes” and it looks ugly:

There is a guideline at the top of the section before the example:
"Headers should be protected against multiple inclusion using a macro
that contains the header file name in uppercase, with all characters
that are invalid in C replaced with an underscore '_':"

So I'm not advocating for "anything goes", I'm removing some parts which
I don't think are bringing much, or could even be confusing.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]