cosmetic: convert some function returns from int to bool

[Pekka Paalanen: change is_nullable_type() return value to bool.]

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Derek Foreman 2014-10-03 14:39:59 -05:00 committed by Pekka Paalanen
parent 391820b0d6
commit 322cd6dded
2 changed files with 9 additions and 7 deletions

View file

@ -21,6 +21,7 @@
* OF THIS SOFTWARE. * OF THIS SOFTWARE.
*/ */
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
@ -288,7 +289,7 @@ warn(struct location *loc, const char *msg, ...)
va_end(ap); va_end(ap);
} }
static int static bool
is_nullable_type(struct arg *arg) is_nullable_type(struct arg *arg)
{ {
switch (arg->type) { switch (arg->type) {
@ -297,9 +298,9 @@ is_nullable_type(struct arg *arg)
case OBJECT: case OBJECT:
case NEW_ID: case NEW_ID:
case ARRAY: case ARRAY:
return 1; return true;
default: default:
return 0; return false;
} }
} }

View file

@ -27,6 +27,7 @@
#define _GNU_SOURCE #define _GNU_SOURCE
#include <stdbool.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -99,7 +100,7 @@ static const struct wl_buffer_interface shm_buffer_interface = {
shm_buffer_destroy shm_buffer_destroy
}; };
static int static bool
format_is_supported(struct wl_client *client, uint32_t format) format_is_supported(struct wl_client *client, uint32_t format)
{ {
struct wl_display *display = wl_client_get_display(client); struct wl_display *display = wl_client_get_display(client);
@ -109,15 +110,15 @@ format_is_supported(struct wl_client *client, uint32_t format)
switch (format) { switch (format) {
case WL_SHM_FORMAT_ARGB8888: case WL_SHM_FORMAT_ARGB8888:
case WL_SHM_FORMAT_XRGB8888: case WL_SHM_FORMAT_XRGB8888:
return 1; return true;
default: default:
formats = wl_display_get_additional_shm_formats(display); formats = wl_display_get_additional_shm_formats(display);
wl_array_for_each(p, formats) wl_array_for_each(p, formats)
if(*p == format) if(*p == format)
return 1; return true;
} }
return 0; return false;
} }
static void static void