From dbafe16da7a9999ec77da21a42537702fb87f124 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart 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 Reviewed-by: Kieran Bingham Reviewed-by: Niklas Söderlund --- test/camera/buffer_import.cpp | 3 ++- test/camera/capture.cpp | 3 ++- test/hotplug-cameras.cpp | 4 ++-- test/ipa/ipa_wrappers_test.cpp | 4 ++-- test/libtest/test.h | 2 +- test/log/log_process.cpp | 3 ++- test/object-invoke.cpp | 2 +- test/process/process_test.cpp | 3 ++- test/timer-thread.cpp | 2 +- test/timer.cpp | 2 +- 10 files changed, 16 insertions(+), 12 deletions(-) (limited to 'test') diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp index 97a85827..d57ffa75 100644 --- a/test/camera/buffer_import.cpp +++ b/test/camera/buffer_import.cpp @@ -33,7 +33,8 @@ public: } protected: - void bufferComplete(Request *request, FrameBuffer *buffer) + void bufferComplete([[maybe_unused]] Request *request, + FrameBuffer *buffer) { if (buffer->metadata().status != FrameMetadata::FrameSuccess) return; diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp index 0fe3bf9b..eb67bf2d 100644 --- a/test/camera/capture.cpp +++ b/test/camera/capture.cpp @@ -26,7 +26,8 @@ protected: unsigned int completeBuffersCount_; unsigned int completeRequestsCount_; - void bufferComplete(Request *request, FrameBuffer *buffer) + void bufferComplete([[maybe_unused]] Request *request, + FrameBuffer *buffer) { if (buffer->metadata().status != FrameMetadata::FrameSuccess) return; diff --git a/test/hotplug-cameras.cpp b/test/hotplug-cameras.cpp index 6a94535f..7d551eeb 100644 --- a/test/hotplug-cameras.cpp +++ b/test/hotplug-cameras.cpp @@ -26,12 +26,12 @@ using namespace libcamera; class HotplugTest : public Test { protected: - void cameraAddedHandler(std::shared_ptr cam) + void cameraAddedHandler([[maybe_unused]] std::shared_ptr cam) { cameraAdded_ = true; } - void cameraRemovedHandler(std::shared_ptr cam) + void cameraRemovedHandler([[maybe_unused]] std::shared_ptr cam) { cameraRemoved_ = true; } diff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp index 23c799da..59d991cb 100644 --- a/test/ipa/ipa_wrappers_test.cpp +++ b/test/ipa/ipa_wrappers_test.cpp @@ -70,8 +70,8 @@ public: void configure(const CameraSensorInfo &sensorInfo, const std::map &streamConfig, const std::map &entityControls, - const IPAOperationData &ipaConfig, - IPAOperationData *result) override + [[maybe_unused]] const IPAOperationData &ipaConfig, + [[maybe_unused]] IPAOperationData *result) override { /* Verify sensorInfo. */ if (sensorInfo.outputSize.width != 2560 || diff --git a/test/libtest/test.h b/test/libtest/test.h index 26d4b94b..8ecf2bda 100644 --- a/test/libtest/test.h +++ b/test/libtest/test.h @@ -30,7 +30,7 @@ protected: }; #define TEST_REGISTER(klass) \ -int main(int argc, char *argv[]) \ +int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) \ { \ return klass().execute(); \ } diff --git a/test/log/log_process.cpp b/test/log/log_process.cpp index d46d5e35..b024f002 100644 --- a/test/log/log_process.cpp +++ b/test/log/log_process.cpp @@ -125,7 +125,8 @@ protected: } private: - void procFinished(Process *proc, enum Process::ExitStatus exitStatus, int exitCode) + void procFinished([[maybe_unused]] Process *proc, + enum Process::ExitStatus exitStatus, int exitCode) { exitStatus_ = exitStatus; exitCode_ = exitCode; diff --git a/test/object-invoke.cpp b/test/object-invoke.cpp index 1ae11bb1..f3fd2328 100644 --- a/test/object-invoke.cpp +++ b/test/object-invoke.cpp @@ -50,7 +50,7 @@ public: value_ = value; } - void methodWithReference(const int &value) + void methodWithReference([[maybe_unused]] const int &value) { } diff --git a/test/process/process_test.cpp b/test/process/process_test.cpp index 721a7c9d..42a26749 100644 --- a/test/process/process_test.cpp +++ b/test/process/process_test.cpp @@ -80,7 +80,8 @@ protected: } private: - void procFinished(Process *proc, enum Process::ExitStatus exitStatus, int exitCode) + void procFinished([[maybe_unused]] Process *proc, + enum Process::ExitStatus exitStatus, int exitCode) { exitStatus_ = exitStatus; exitCode_ = exitCode; diff --git a/test/timer-thread.cpp b/test/timer-thread.cpp index 2f901787..f794d8e7 100644 --- a/test/timer-thread.cpp +++ b/test/timer-thread.cpp @@ -40,7 +40,7 @@ public: } private: - void timeoutHandler(Timer *timer) + void timeoutHandler([[maybe_unused]] Timer *timer) { timeout_ = true; } diff --git a/test/timer.cpp b/test/timer.cpp index 7d5b93c3..537489d7 100644 --- a/test/timer.cpp +++ b/test/timer.cpp @@ -57,7 +57,7 @@ public: } private: - void timeoutHandler(Timer *timer) + void timeoutHandler([[maybe_unused]] Timer *timer) { expiration_ = std::chrono::steady_clock::now(); count_++; -- cgit v1.2.1