[v3,03/11] Specify file extensions for C++ and Obj-C

Submitted by Christophe de Dinechin on Feb. 8, 2018, 11:25 a.m.

Details

Message ID 20180208112531.19601-4-christophe@dinechin.org
State New
Headers show
Series "Updates to the style guide" ( rev: 2 1 ) in Spice

Not browsing as part of any series.

Commit Message

Christophe de Dinechin Feb. 8, 2018, 11:25 a.m.
From: Christophe de Dinechin <dinechin@redhat.com>

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
---
 docs/spice_style.txt | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/docs/spice_style.txt b/docs/spice_style.txt
index 10bfbc9a..13032df6 100644
--- a/docs/spice_style.txt
+++ b/docs/spice_style.txt
@@ -34,7 +34,16 @@  Names
 
 Use lower case and separate words using dashes (e.g., file-name.c, header.h).
 
-Use standard file extension for C source and header files.
+The file extensions used in the SPICE project are:
+- .c for C source
+- .cpp for C++ sources
+- .h for headers that can be included from C code
+- .hpp for headers that are strictly reserved to C++
+- .m for Objective-C source files (currently not properly enforced)
+
+Note that .h headers may contain C++ code as long as the header can
+sucessfully be included from a C source file.
+
 
 Line width
 ~~~~~~~~~~

Comments

See https://lists.freedesktop.org/archives/spice-devel/2018-February/041724.html

> From: Christophe de Dinechin <dinechin@redhat.com>
> 
> Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
> ---
>  docs/spice_style.txt | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/spice_style.txt b/docs/spice_style.txt
> index 10bfbc9a..13032df6 100644
> --- a/docs/spice_style.txt
> +++ b/docs/spice_style.txt
> @@ -34,7 +34,16 @@ Names
>  
>  Use lower case and separate words using dashes (e.g., file-name.c,
>  header.h).
>  
> -Use standard file extension for C source and header files.
> +The file extensions used in the SPICE project are:
> +- .c for C source
> +- .cpp for C++ sources
> +- .h for headers that can be included from C code
> +- .hpp for headers that are strictly reserved to C++
> +- .m for Objective-C source files (currently not properly enforced)
> +
> +Note that .h headers may contain C++ code as long as the header can
> +sucessfully be included from a C source file.
> +
>  
>  Line width
>  ~~~~~~~~~~
On Mon, Feb 12, 2018 at 03:23:06AM -0500, Frediano Ziglio wrote:
> See https://lists.freedesktop.org/archives/spice-devel/2018-February/041724.html
> 
> > From: Christophe de Dinechin <dinechin@redhat.com>
> > 
> > Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
> > ---
> >  docs/spice_style.txt | 11 ++++++++++-
> >  1 file changed, 10 insertions(+), 1 deletion(-)
> > 
> > diff --git a/docs/spice_style.txt b/docs/spice_style.txt
> > index 10bfbc9a..13032df6 100644
> > --- a/docs/spice_style.txt
> > +++ b/docs/spice_style.txt
> > @@ -34,7 +34,16 @@ Names
> >  
> >  Use lower case and separate words using dashes (e.g., file-name.c,
> >  header.h).
> >  
> > -Use standard file extension for C source and header files.
> > +The file extensions used in the SPICE project are:
> > +- .c for C source
> > +- .cpp for C++ sources
> > +- .h for headers that can be included from C code
> > +- .hpp for headers that are strictly reserved to C++
> > +- .m for Objective-C source files (currently not properly enforced)

We do have .m files in spice??

Christophe