(V4L2) Silence C89_BUILD - implicit constant conversion overflow warnings

This commit is contained in:
twinaphex 2015-09-22 17:04:51 +02:00
parent e3c7dcae28
commit 83df9e61d0

View File

@ -96,7 +96,7 @@ static bool init_mmap(void *data)
req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
req.memory = V4L2_MEMORY_MMAP; req.memory = V4L2_MEMORY_MMAP;
if (xioctl(v4l->fd, VIDIOC_REQBUFS, &req) == -1) if (xioctl(v4l->fd, (uint8_t)VIDIOC_REQBUFS, &req) == -1)
{ {
if (errno == EINVAL) if (errno == EINVAL)
RARCH_ERR("%s does not support memory mapping.\n", v4l->dev_name); RARCH_ERR("%s does not support memory mapping.\n", v4l->dev_name);
@ -129,7 +129,7 @@ static bool init_mmap(void *data)
buf.memory = V4L2_MEMORY_MMAP; buf.memory = V4L2_MEMORY_MMAP;
buf.index = v4l->n_buffers; buf.index = v4l->n_buffers;
if (xioctl(v4l->fd, VIDIOC_QUERYBUF, &buf) == -1) if (xioctl(v4l->fd, (uint8_t)VIDIOC_QUERYBUF, &buf) == -1)
{ {
RARCH_ERR("Error - xioctl VIDIOC_QUERYBUF.\n"); RARCH_ERR("Error - xioctl VIDIOC_QUERYBUF.\n");
return false; return false;
@ -159,7 +159,7 @@ static bool init_device(void *data)
struct v4l2_format fmt; struct v4l2_format fmt;
video4linux_t *v4l = (video4linux_t*)data; video4linux_t *v4l = (video4linux_t*)data;
if (xioctl(v4l->fd, VIDIOC_QUERYCAP, &cap) < 0) if (xioctl(v4l->fd, (uint8_t)VIDIOC_QUERYCAP, &cap) < 0)
{ {
if (errno == EINVAL) if (errno == EINVAL)
RARCH_ERR("%s is no V4L2 device.\n", v4l->dev_name); RARCH_ERR("%s is no V4L2 device.\n", v4l->dev_name);
@ -184,7 +184,7 @@ static bool init_device(void *data)
memset(&cropcap, 0, sizeof(cropcap)); memset(&cropcap, 0, sizeof(cropcap));
cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (xioctl(v4l->fd, VIDIOC_CROPCAP, &cropcap) == 0) if (xioctl(v4l->fd, (uint8_t)VIDIOC_CROPCAP, &cropcap) == 0)
{ {
crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
crop.c = cropcap.defrect; crop.c = cropcap.defrect;
@ -200,7 +200,7 @@ static bool init_device(void *data)
fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV; fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
fmt.fmt.pix.field = V4L2_FIELD_NONE; fmt.fmt.pix.field = V4L2_FIELD_NONE;
if (xioctl(v4l->fd, VIDIOC_S_FMT, &fmt) < 0) if (xioctl(v4l->fd, (uint8_t)VIDIOC_S_FMT, &fmt) < 0)
{ {
RARCH_ERR("Error - VIDIOC_S_FMT\n"); RARCH_ERR("Error - VIDIOC_S_FMT\n");
return false; return false;
@ -260,7 +260,7 @@ static bool v4l_start(void *data)
buf.memory = V4L2_MEMORY_MMAP; buf.memory = V4L2_MEMORY_MMAP;
buf.index = i; buf.index = i;
if (xioctl(v4l->fd, VIDIOC_QBUF, &buf) == -1) if (xioctl(v4l->fd, (uint8_t)VIDIOC_QBUF, &buf) == -1)
{ {
RARCH_ERR("Error - VIDIOC_QBUF.\n"); RARCH_ERR("Error - VIDIOC_QBUF.\n");
return false; return false;
@ -385,7 +385,7 @@ static bool preprocess_image(void *data)
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP; buf.memory = V4L2_MEMORY_MMAP;
if (xioctl(v4l->fd, VIDIOC_DQBUF, &buf) == -1) if (xioctl(v4l->fd, (uint8_t)VIDIOC_DQBUF, &buf) == -1)
{ {
switch (errno) switch (errno)
{ {
@ -401,7 +401,7 @@ static bool preprocess_image(void *data)
process_image(v4l, (const uint8_t*)v4l->buffers[buf.index].start); process_image(v4l, (const uint8_t*)v4l->buffers[buf.index].start);
if (xioctl(v4l->fd, VIDIOC_QBUF, &buf) == -1) if (xioctl(v4l->fd, (uint8_t)VIDIOC_QBUF, &buf) == -1)
RARCH_ERR("VIDIOC_QBUF\n"); RARCH_ERR("VIDIOC_QBUF\n");
return true; return true;