From dbafe16da7a9999ec77da21a42537702fb87f124 Mon Sep 17 00:00:00 2001
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: Sun, 27 Oct 2019 00:36:13 +0300
Subject: meson: Remove -Wno-unused-parameter
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We build libcamera with -Wno-unused-parameter and this doesn't cause
much issue internally. However, it prevents catching unused parameters
in inline functions defined in public headers. This can lead to
compilation warnings for applications compiled without
-Wno-unused-parameter.

To catch those issues, remove -Wno-unused-parameter and fix all the
related warnings with [[maybe_unused]].

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/gstreamer/gstlibcamerapool.cpp     | 2 +-
 src/gstreamer/gstlibcameraprovider.cpp | 2 +-
 src/gstreamer/gstlibcamerasrc.cpp      | 7 +++++--
 3 files changed, 7 insertions(+), 4 deletions(-)

(limited to 'src/gstreamer')

diff --git a/src/gstreamer/gstlibcamerapool.cpp b/src/gstreamer/gstlibcamerapool.cpp
index 8f536169..b756ee35 100644
--- a/src/gstreamer/gstlibcamerapool.cpp
+++ b/src/gstreamer/gstlibcamerapool.cpp
@@ -33,7 +33,7 @@ G_DEFINE_TYPE(GstLibcameraPool, gst_libcamera_pool, GST_TYPE_BUFFER_POOL);
 
 static GstFlowReturn
 gst_libcamera_pool_acquire_buffer(GstBufferPool *pool, GstBuffer **buffer,
-				  GstBufferPoolAcquireParams *params)
+				  [[maybe_unused]] GstBufferPoolAcquireParams *params)
 {
 	GstLibcameraPool *self = GST_LIBCAMERA_POOL(pool);
 	GstBuffer *buf = GST_BUFFER(gst_atomic_queue_pop(self->queue));
diff --git a/src/gstreamer/gstlibcameraprovider.cpp b/src/gstreamer/gstlibcameraprovider.cpp
index 840e87a3..cd850d81 100644
--- a/src/gstreamer/gstlibcameraprovider.cpp
+++ b/src/gstreamer/gstlibcameraprovider.cpp
@@ -89,7 +89,7 @@ gst_libcamera_device_set_property(GObject *object, guint prop_id,
 }
 
 static void
-gst_libcamera_device_init(GstLibcameraDevice *self)
+gst_libcamera_device_init([[maybe_unused]] GstLibcameraDevice *self)
 {
 }
 
diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index 0c28ae3f..1bfc2e2f 100644
--- a/src/gstreamer/gstlibcamerasrc.cpp
+++ b/src/gstreamer/gstlibcamerasrc.cpp
@@ -338,7 +338,8 @@ gst_libcamera_src_task_run(gpointer user_data)
 }
 
 static void
-gst_libcamera_src_task_enter(GstTask *task, GThread *thread, gpointer user_data)
+gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,
+			     gpointer user_data)
 {
 	GstLibcameraSrc *self = GST_LIBCAMERA_SRC(user_data);
 	GLibRecLocker lock(&self->stream_lock);
@@ -467,7 +468,9 @@ done:
 }
 
 static void
-gst_libcamera_src_task_leave(GstTask *task, GThread *thread, gpointer user_data)
+gst_libcamera_src_task_leave([[maybe_unused]] GstTask *task,
+			     [[maybe_unused]] GThread *thread,
+			     gpointer user_data)
 {
 	GstLibcameraSrc *self = GST_LIBCAMERA_SRC(user_data);
 	GstLibcameraSrcState *state = self->state;
-- 
cgit v1.2.1