Enable -Wall

This commit is contained in:
Kamil Trzcinski
2022-04-14 10:13:18 +02:00
parent eaf4e06989
commit 9c7f5fed12
25 changed files with 41 additions and 57 deletions

View File

@ -10,7 +10,6 @@ int v4l2_buffer_open(buffer_t *buf)
struct v4l2_plane v4l2_plane = {0};
buffer_list_t *buf_list = buf->buf_list;
device_t *dev = buf_list->dev;
buf->v4l2 = calloc(1, sizeof(buffer_v4l2_t));
@ -29,7 +28,7 @@ int v4l2_buffer_open(buffer_t *buf)
v4l2_buf.memory = V4L2_MEMORY_DMABUF;
}
ERR_IOCTL(buf_list, buf_list->v4l2->dev_fd, VIDIOC_QUERYBUF, &v4l2_buf, "Cannot query buffer %d", index);
ERR_IOCTL(buf_list, buf_list->v4l2->dev_fd, VIDIOC_QUERYBUF, &v4l2_buf, "Cannot query buffer %d", buf->index);
uint64_t mem_offset = 0;
@ -51,7 +50,7 @@ int v4l2_buffer_open(buffer_t *buf)
v4l2_exp.type = v4l2_buf.type;
v4l2_exp.index = buf->index;
v4l2_exp.plane = 0;
ERR_IOCTL(buf_list, buf_list->v4l2->dev_fd, VIDIOC_EXPBUF, &v4l2_exp, "Can't export queue buffer=%u to DMA", index);
ERR_IOCTL(buf_list, buf_list->v4l2->dev_fd, VIDIOC_EXPBUF, &v4l2_exp, "Can't export queue buffer=%u to DMA", buf->index);
buf->dma_fd = v4l2_exp.fd;
}

View File

@ -62,7 +62,7 @@ int v4l2_buffer_list_open(buffer_list_t *buf_list)
// JPEG is in 16x16 blocks (shrink image to fit) (but adapt to 32x32)
// And ISP output
if (strstr(buf_list->name, "JPEG") || strstr(buf_list->name, "H264") || buf_list->do_capture && strstr(buf_list->name, "ISP")) {
if (strstr(buf_list->name, "JPEG") || strstr(buf_list->name, "H264") || (buf_list->do_capture && strstr(buf_list->name, "ISP"))) {
buffer_format_t org_fmt = buf_list->fmt;
fmt.width = shrink_to_block(fmt.width, 32);
fmt.height = shrink_to_block(fmt.height, 32);

View File

@ -24,7 +24,7 @@ int v4l2_device_open(device_t *dev)
LOG_ERROR(dev, "Device doesn't support streaming IO");
}
strcpy(dev->bus_info, v4l2_cap.bus_info);
strcpy(dev->bus_info, (char *)v4l2_cap.bus_info);
dev->v4l2->subdev_fd = v4l2_device_open_v4l2_subdev(dev, 0);
v4l2_device_query_controls(dev, dev->v4l2->dev_fd);

View File

@ -22,7 +22,7 @@ int v4l2_device_open_media_device(device_t *dev)
return -1;
}
char path[256];
char path[300];
sprintf(path, "/sys/dev/char/%d:%d/device", major(st.st_rdev), minor(st.st_rdev));
struct dirent **namelist;
@ -47,7 +47,6 @@ int v4l2_device_open_media_device(device_t *dev)
}
free(namelist);
error:
return ret;
}
@ -94,7 +93,7 @@ int v4l2_device_open_v4l2_subdev(device_t *dev, int subdev)
}
if (strstr(last, "/v4l-subdev") != last) {
LOG_VERBOSE(dev, "Link '%s' does not contain '/v4l-subdev'", link, path);
LOG_VERBOSE(dev, "Link '%s' does not contain '/v4l-subdev'", link);
goto error;
}

View File

@ -23,7 +23,6 @@ error:
static int v4l2_device_query_control_iter_id(device_t *dev, int fd, uint32_t *id)
{
struct v4l2_query_ext_ctrl qctrl = { .id = *id };
void *data = NULL;
if (0 != ioctl (fd, VIDIOC_QUERY_EXT_CTRL, &qctrl)) {
return -1;
@ -120,7 +119,7 @@ int v4l2_device_set_option(device_t *dev, const char *key, const char *value)
char *token;
int tokens = 0;
for ( ; token = strsep(&string, ","); tokens++) {
for ( ; (token = strsep(&string, ",")) != NULL; tokens++) {
if (tokens >= control->control.elems)
continue;

View File

@ -1,5 +1,6 @@
#pragma once
#include <time.h>
#include <linux/videodev2.h>
#include <linux/v4l2-subdev.h>
#include <stdbool.h>