summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt1
-rw-r--r--kmscube/cube-gbm.cpp2
-rw-r--r--kmscube/cube-null.cpp2
-rw-r--r--py/CMakeLists.txt2
-rw-r--r--tests/kmscapture.cpp14
5 files changed, 12 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 739b80d..bbb2ceb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,7 @@ set(LIBKMS_ENABLE_KMSCUBE OFF CACHE BOOL "Enable kmscube")
set(LIBKMS_ENABLE_LTO OFF CACHE BOOL "Enable LTO")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wextra -Wno-unused-parameter")
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
diff --git a/kmscube/cube-gbm.cpp b/kmscube/cube-gbm.cpp
index a65f693..d015c55 100644
--- a/kmscube/cube-gbm.cpp
+++ b/kmscube/cube-gbm.cpp
@@ -379,7 +379,7 @@ void main_gbm()
for (auto& out : outputs)
out->start_flipping();
- struct pollfd fds[2] = { 0 };
+ struct pollfd fds[2] = { };
fds[0].fd = 0;
fds[0].events = POLLIN;
fds[1].fd = card.fd();
diff --git a/kmscube/cube-null.cpp b/kmscube/cube-null.cpp
index 42f2ac2..2623394 100644
--- a/kmscube/cube-null.cpp
+++ b/kmscube/cube-null.cpp
@@ -18,7 +18,7 @@ void main_null()
int framenum = 0;
- struct pollfd fds[1] = { 0 };
+ struct pollfd fds[1] = { };
fds[0].fd = 0;
fds[0].events = POLLIN;
diff --git a/py/CMakeLists.txt b/py/CMakeLists.txt
index f701ef6..7766480 100644
--- a/py/CMakeLists.txt
+++ b/py/CMakeLists.txt
@@ -14,6 +14,8 @@ include_directories(../libkms++ ../libkmstest)
#set(CMAKE_SWIG_FLAGS "-I../../libkms")
set(CMAKE_SWIG_FLAGS "-builtin")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")
+
set_source_files_properties(pykms.i PROPERTIES CPLUSPLUS ON)
swig_add_module(pykms python pykms.i)
swig_link_libraries(pykms kms++ kmstest ${LIBDRM_LIBRARIES} ${PYTHON_LIBRARIES})
diff --git a/tests/kmscapture.cpp b/tests/kmscapture.cpp
index d433c44..81650d7 100644
--- a/tests/kmscapture.cpp
+++ b/tests/kmscapture.cpp
@@ -121,7 +121,7 @@ Camera::Camera(int camera_id, Card& card, Plane* plane, uint32_t x, uint32_t y,
ASSERT(m_fd >= 0);
- struct v4l2_frmsizeenum v4lfrms = { 0 };
+ struct v4l2_frmsizeenum v4lfrms = { };
v4lfrms.pixel_format = (uint32_t) pixfmt;
while (ioctl(m_fd, VIDIOC_ENUM_FRAMESIZES, &v4lfrms) == 0) {
if (v4lfrms.type == V4L2_FRMSIZE_TYPE_DISCRETE) {
@@ -142,7 +142,7 @@ Camera::Camera(int camera_id, Card& card, Plane* plane, uint32_t x, uint32_t y,
m_out_x = x + iw / 2 - m_out_width / 2;
m_out_y = y + ih / 2 - m_out_height / 2;
- struct v4l2_format v4lfmt = { 0 };
+ struct v4l2_format v4lfmt = { };
v4lfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
r = ioctl(m_fd, VIDIOC_G_FMT, &v4lfmt);
ASSERT(r == 0);
@@ -154,7 +154,7 @@ Camera::Camera(int camera_id, Card& card, Plane* plane, uint32_t x, uint32_t y,
r = ioctl(m_fd, VIDIOC_S_FMT, &v4lfmt);
ASSERT(r == 0);
- struct v4l2_requestbuffers v4lreqbuf = { 0 };
+ struct v4l2_requestbuffers v4lreqbuf = { };
v4lreqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
v4lreqbuf.memory = v4l_mem;
v4lreqbuf.count = CAMERA_BUF_QUEUE_SIZE;
@@ -162,7 +162,7 @@ Camera::Camera(int camera_id, Card& card, Plane* plane, uint32_t x, uint32_t y,
ASSERT(r == 0);
ASSERT(v4lreqbuf.count == CAMERA_BUF_QUEUE_SIZE);
- struct v4l2_buffer v4lbuf = { 0 };
+ struct v4l2_buffer v4lbuf = { };
v4lbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
v4lbuf.memory = v4l_mem;
@@ -219,7 +219,7 @@ void Camera::show_next_frame(Crtc* crtc)
else
v4l_mem = V4L2_MEMORY_DMABUF;
- struct v4l2_buffer v4l2buf = { 0 };
+ struct v4l2_buffer v4l2buf = { };
v4l2buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
v4l2buf.memory = v4l_mem;
r = ioctl(m_fd, VIDIOC_DQBUF, &v4l2buf);
@@ -257,7 +257,7 @@ void Camera::show_next_frame(Crtc* crtc)
static bool is_capture_dev(int fd)
{
- struct v4l2_capability cap = { 0 };
+ struct v4l2_capability cap = { };
int r;
r = ioctl(fd, VIDIOC_QUERYCAP, &cap);
@@ -361,7 +361,7 @@ int main(int argc, char** argv)
FAIL_IF(i < nr_cameras, "available plane not found");
- struct pollfd fds[nr_cameras + 1] = { 0 };
+ struct pollfd fds[nr_cameras + 1] = { };
for (i = 0; i < nr_cameras; i++) {
fds[i].fd = cameras[i]->fd();
fds[i].events = POLLIN;