diff options
author | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-04 05:18:21 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-09-04 07:20:49 -0300 |
commit | 16c8f03b7cd32dd040af1771411c9a906af94fe8 (patch) | |
tree | 1b93967d5701f69b84bfe06a8ed31501e8167b9e /src/v4l.c | |
parent | 3cada8d74f6a4e82538bc17923f27bd3e03f4e8e (diff) |
Do some code cleanups
When building it with:
CFLAGS="-Wall -Wstrict-prototypes -Wnested-externs -Werror=missing-prototypes -Werror=implicit-function-declaration -Werror=pointer-arith -Werror=init-self -Werror=format-security -Werror=format=2 -Werror=missing-include-dirs -Werror=return-type"
Lots of warning appear. Clean up the most trivial ones.
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src/v4l.c')
-rw-r--r-- | src/v4l.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -33,9 +33,9 @@ void print_cam(cam_t *cam){ printf("timestamp = %s\n\n",cam->ts_string); } -static void insert_resolution(cam_t *cam, int x, int y) +static void insert_resolution(cam_t *cam, unsigned int x, unsigned int y) { - int i; + unsigned int i; try_set_win_info(cam, &x, &y); for (i = 0; i < cam->n_res; i++) { @@ -68,7 +68,8 @@ void get_supported_resolutions(cam_t *cam) { struct v4l2_fmtdesc fmt; struct v4l2_frmsizeenum frmsize; - int i, x, y; + int i; + unsigned int x, y; fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; @@ -337,7 +338,7 @@ void get_win_info(cam_t *cam) } } -void try_set_win_info(cam_t *cam, int *x, int *y) +void try_set_win_info(cam_t *cam, unsigned int *x, unsigned int *y) { struct v4l2_format fmt; @@ -488,11 +489,12 @@ void start_streaming(cam_t *cam) } } -void capture_buffers(cam_t *cam, unsigned char *outbuf, int len) +void capture_buffers(cam_t *cam, unsigned char *outbuf, unsigned int len) { char *msg; unsigned char *inbuf; - int r, y; + int r; + unsigned int y; fd_set fds; struct v4l2_buffer buf; struct timeval tv; |