[Spice-commits] docs/spice_style.txt

Frediano Ziglio fziglio at kemper.freedesktop.org
Mon Feb 27 12:35:53 UTC 2017

 docs/spice_style.txt |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 7e395c39846ec7e893cfa6c6e0838823693d2d1b
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu Feb 23 17:36:31 2017 +0000

    style: Change boolean style convention
    , the consensus was to use 'bool' rather than 'gboolean', and to use
    true/false rather than TRUE/FALSE. New code should attempt to follow
    the new style.
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Christophe Fergeau <cfergeau at redhat.com>

diff --git a/docs/spice_style.txt b/docs/spice_style.txt
index 4614598..eb0e30e 100644
--- a/docs/spice_style.txt
+++ b/docs/spice_style.txt
@@ -47,10 +47,18 @@ Examples: +
   use `(var == 7)` instead of  `(7 == var)` +
   use `(function(var) > 7)` instead of `(7 < function(var))`
+boolean type
+Where possible prefer the usage of `bool` type to store boolean.
+If not technically possible (ie libJPEG uses `boolean` while GLib uses `gboolean`) uses proper library type.
+Constants should be consistent with the type used so `true` and `false` for `bool` type.
+true, false and NULL
-Use `TRUE`, `FALSE` and `NULL` instead of 1 and 0 in order to improve code readability.
+Use `true`, `false` and `NULL` instead of 1 and 0 in order to improve code readability.
 Static storage initialization

More information about the Spice-commits mailing list