[Spice-devel] [PATCH 1/2] unify header include order

Christophe Fergeau cfergeau at redhat.com
Wed May 11 16:04:05 UTC 2016


On Tue, May 10, 2016 at 02:23:04PM +0100, Frediano Ziglio wrote:
> Use this style for include headers inside headers:
> 
>   #include <system_headers.h>
>   #include <no_spice_no_system_libraries.h>
>   #include <spice_protocol.h>
>   #include <spice_common.h>
> 
>   #include "spice_server.h"

I would add that to this coding style document if it's not already
there. I tend to prefer when the headers are alphabetically ordered 
within a given section (probably not worth changing throughout the
codebase now, but could be nice to keep an eye on that when adding new
#includes)


> diff --git a/server/red-channel.h b/server/red-channel.h
> index bc225c6..03e6407 100644
> --- a/server/red-channel.h
> +++ b/server/red-channel.h
> @@ -24,7 +24,6 @@
>  
>  #include <pthread.h>
>  #include <limits.h>
> -
>  #include <common/ring.h>
>  #include <common/marshaller.h>
>  
> diff --git a/server/red-common.h b/server/red-common.h
> index 3a63f04..b92bbee 100644
> --- a/server/red-common.h
> +++ b/server/red-common.h
> @@ -18,14 +18,14 @@
>  #ifndef _H_RED_COMMON
>  #define _H_RED_COMMON
>  
> -#include <glib.h>
> -
>  #include <errno.h>
>  #include <stdbool.h>
>  #include <stdint.h>
>  #include <string.h>
>  #include <unistd.h>
>  
> +#include <glib.h>
> +
>  #include <spice/macros.h>
>  #include <common/log.h>
>  #include <common/lz_common.h>

Nit, but this hunk and the previous one seems a bit inconsistent with
respect to the blank line. Do you want to group all <> #includes, or to
separate each different sections?

Acked-by: Christophe Fergeau <cfergeau at redhat.com>

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160511/dda1a595/attachment.sig>


More information about the Spice-devel mailing list