style: Change boolean style convention

Following
https://lists.freedesktop.org/archives/spice-devel/2017-February/035800.html
, 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@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
This commit is contained in:
Frediano Ziglio 2017-02-23 17:36:31 +00:00
parent be727eb822
commit 7e395c3984

View File

@ -47,10 +47,18 @@ Examples: +
use `(var == 7)` instead of `(7 == var)` +
use `(function(var) > 7)` instead of `(7 < function(var))`
TRUE, FALSE and NULL
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
-----------------------------