cosmetic: replace boolean function return values with bool
For functions that test if something is true/valid and return a 1
or 0, it makes sense to switch to bool.
Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
diff --git a/src/weston-launch.c b/src/weston-launch.c
index 56e22b1..10c66de 100644
--- a/src/weston-launch.c
+++ b/src/weston-launch.c
@@ -22,6 +22,7 @@
#include "config.h"
+#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -133,7 +134,7 @@
return groups;
}
-static int
+static bool
weston_launch_allowed(struct weston_launch *wl)
{
struct group *gr;
@@ -145,7 +146,7 @@
#endif
if (getuid() == 0)
- return 1;
+ return true;
gr = getgrnam("weston-launch");
if (gr) {
@@ -154,7 +155,7 @@
for (i = 0; groups[i]; ++i) {
if (groups[i] == gr->gr_gid) {
free(groups);
- return 1;
+ return true;
}
}
free(groups);
@@ -168,13 +169,13 @@
sd_session_get_seat(session, &seat) == 0) {
free(seat);
free(session);
- return 1;
+ return true;
}
free(session);
}
#endif
- return 0;
+ return false;
}
static int