aboutsummaryrefslogtreecommitdiffstats
path: root/src/v4l.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-04 08:18:21 (GMT)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-04 10:20:49 (GMT)
commit16c8f03b7cd32dd040af1771411c9a906af94fe8 (patch)
tree1b93967d5701f69b84bfe06a8ed31501e8167b9e /src/v4l.c
parent3cada8d74f6a4e82538bc17923f27bd3e03f4e8e (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.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/v4l.c b/src/v4l.c
index d7af8aa..31d6f0f 100644
--- a/src/v4l.c
+++ b/src/v4l.c
@@ -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;

Privacy Policy