From 70fcf31fdd2b91564e67a6fb335f88a9a426a8e2 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 10 Nov 2013 17:47:39 +0100 Subject: [PATCH] Use bool for ready. --- camera/video4linux2.c | 12 ++++++------ driver.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/camera/video4linux2.c b/camera/video4linux2.c index 130afcbb66..f3f63fbe6e 100644 --- a/camera/video4linux2.c +++ b/camera/video4linux2.c @@ -51,7 +51,7 @@ typedef struct video4linux { char *dev_name; int fd; - int ready; + bool ready; io_method io; struct buffer *buffers; unsigned int n_buffers; @@ -182,7 +182,7 @@ static int xioctl(int fd, int request, void *args) do { r = ioctl(fd, request, args); - }while(r == -1 && errno == EINTR); + } while (r == -1 && errno == EINTR); return r; } @@ -478,7 +478,7 @@ static int v4l_stop(void *data) break; } - v4l->ready = 0; + v4l->ready = false; return 0; } @@ -554,7 +554,7 @@ static int v4l_start(void *data) break; } - v4l->ready = 1; + v4l->ready = true; return 0; } @@ -570,7 +570,7 @@ static void *v4l_init(void) v4l->dev_name = "/dev/video0"; v4l->width = 640; v4l->height = 480; - v4l->ready = 0; + v4l->ready = false; if (stat(v4l->dev_name, &st) == -1) { @@ -751,7 +751,7 @@ static void v4l_texture_subimage_2d(void *data) preprocess_image(data); } -static int v4l_ready(void *data, unsigned *width, unsigned *height) +static bool v4l_ready(void *data, unsigned *width, unsigned *height) { video4linux_t *v4l = (video4linux_t*)data; return v4l->ready; diff --git a/driver.h b/driver.h index 0d2cb11a54..111b8643a5 100644 --- a/driver.h +++ b/driver.h @@ -339,7 +339,7 @@ typedef struct camera_driver void (*free)(void *data); int (*start)(void *data); int (*stop)(void *data); - int (*ready)(void *data, unsigned *width, unsigned *height); + bool (*ready)(void *data, unsigned *width, unsigned *height); void (*texture_image_2d)(void *data); void (*texture_subimage_2d)(void *data); const char *ident;