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 --- include/libcamera/bound_method.h | 2 +- include/libcamera/signal.h | 2 +- include/libcamera/span.h | 4 ++-- meson.build | 1 - src/android/camera3_hal.cpp | 11 +++++++---- src/android/camera_device.cpp | 5 +++-- src/android/camera_ops.cpp | 5 +++-- src/cam/main.cpp | 2 +- src/gstreamer/gstlibcamerapool.cpp | 2 +- src/gstreamer/gstlibcameraprovider.cpp | 2 +- src/gstreamer/gstlibcamerasrc.cpp | 7 +++++-- src/ipa/raspberrypi/controller/rpi/agc.cpp | 3 ++- src/ipa/raspberrypi/raspberrypi.cpp | 2 +- src/ipa/rkisp1/rkisp1.cpp | 13 +++++++----- src/ipa/vimc/vimc.cpp | 16 +++++++-------- src/libcamera/device_enumerator_udev.cpp | 2 +- src/libcamera/ipa_manager.cpp | 2 +- src/libcamera/ipc_unixsocket.cpp | 2 +- src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 5 +++-- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 +- src/libcamera/pipeline/rkisp1/timeline.cpp | 2 +- src/libcamera/process.cpp | 2 +- src/libcamera/proxy/ipa_proxy_linux.cpp | 23 ++++++++++++---------- src/libcamera/pub_key.cpp | 5 +++-- src/libcamera/v4l2_pixelformat.cpp | 2 +- src/libcamera/v4l2_videodevice.cpp | 4 ++-- src/qcam/dng_writer.cpp | 5 +++-- src/qcam/main.cpp | 2 +- src/qcam/main_window.cpp | 3 ++- src/v4l2/v4l2_camera.cpp | 2 +- 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 +- 40 files changed, 95 insertions(+), 73 deletions(-) diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h index 983bb5cb..d1e44483 100644 --- a/include/libcamera/bound_method.h +++ b/include/libcamera/bound_method.h @@ -214,7 +214,7 @@ public: bool match(R (*func)(Args...)) const { return func == func_; } - R activate(Args... args, bool deleteMethod = false) override + R activate(Args... args, [[maybe_unused]] bool deleteMethod = false) override { return (*func_)(args...); } diff --git a/include/libcamera/signal.h b/include/libcamera/signal.h index ed30eb55..accb797e 100644 --- a/include/libcamera/signal.h +++ b/include/libcamera/signal.h @@ -70,7 +70,7 @@ public: void disconnect() { - SignalBase::disconnect([](SlotList::iterator &iter) { + SignalBase::disconnect([]([[maybe_unused]] SlotList::iterator &iter) { return true; }); } diff --git a/include/libcamera/span.h b/include/libcamera/span.h index 513ddb43..738af6ac 100644 --- a/include/libcamera/span.h +++ b/include/libcamera/span.h @@ -113,12 +113,12 @@ public: { } - constexpr Span(pointer ptr, size_type count) + constexpr Span(pointer ptr, [[maybe_unused]] size_type count) : data_(ptr) { } - constexpr Span(pointer first, pointer last) + constexpr Span(pointer first, [[maybe_unused]] pointer last) : data_(first) { } diff --git a/meson.build b/meson.build index f27b7646..b6c99ba8 100644 --- a/meson.build +++ b/meson.build @@ -37,7 +37,6 @@ if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix : '#define _GNU_SOUR endif common_arguments = [ - '-Wno-unused-parameter', '-include', 'config.h', ] diff --git a/src/android/camera3_hal.cpp b/src/android/camera3_hal.cpp index c4eb56a9..67a497b8 100644 --- a/src/android/camera3_hal.cpp +++ b/src/android/camera3_hal.cpp @@ -32,20 +32,23 @@ static int hal_get_camera_info(int id, struct camera_info *info) return cameraManager.getCameraInfo(id, info); } -static int hal_set_callbacks(const camera_module_callbacks_t *callbacks) +static int hal_set_callbacks([[maybe_unused]] const camera_module_callbacks_t *callbacks) { cameraManager.setCallbacks(callbacks); return 0; } -static int hal_open_legacy(const struct hw_module_t *module, const char *id, - uint32_t halVersion, struct hw_device_t **device) +static int hal_open_legacy([[maybe_unused]] const struct hw_module_t *module, + [[maybe_unused]] const char *id, + [[maybe_unused]] uint32_t halVersion, + [[maybe_unused]] struct hw_device_t **device) { return -ENOSYS; } -static int hal_set_torch_mode(const char *camera_id, bool enabled) +static int hal_set_torch_mode([[maybe_unused]] const char *camera_id, + [[maybe_unused]] bool enabled) { return -ENOSYS; } diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index de6f86f7..9605b9e9 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1548,8 +1548,9 @@ void CameraDevice::notifyError(uint32_t frameNumber, camera3_stream_t *stream) /* * Produce a set of fixed result metadata. */ -std::unique_ptr CameraDevice::getResultMetadata(int frame_number, - int64_t timestamp) +std::unique_ptr +CameraDevice::getResultMetadata([[maybe_unused]] int frame_number, + int64_t timestamp) { /* * \todo Keep this in sync with the actual number of entries. diff --git a/src/android/camera_ops.cpp b/src/android/camera_ops.cpp index 216ac285..696e8043 100644 --- a/src/android/camera_ops.cpp +++ b/src/android/camera_ops.cpp @@ -61,11 +61,12 @@ static int hal_dev_process_capture_request(const struct camera3_device *dev, return camera->processCaptureRequest(request); } -static void hal_dev_dump(const struct camera3_device *dev, int fd) +static void hal_dev_dump([[maybe_unused]] const struct camera3_device *dev, + [[maybe_unused]] int fd) { } -static int hal_dev_flush(const struct camera3_device *dev) +static int hal_dev_flush([[maybe_unused]] const struct camera3_device *dev) { return 0; } diff --git a/src/cam/main.cpp b/src/cam/main.cpp index cc3facd5..244720b4 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -378,7 +378,7 @@ int CamApp::run() return 0; } -void signalHandler(int signal) +void signalHandler([[maybe_unused]] int signal) { std::cout << "Exiting" << std::endl; CamApp::instance()->quit(); 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; diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index c02b5ece..3573f36b 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -221,7 +221,8 @@ void Agc::SetConstraintMode(std::string const &constraint_mode_name) constraint_mode_name_ = constraint_mode_name; } -void Agc::SwitchMode(CameraMode const &camera_mode, Metadata *metadata) +void Agc::SwitchMode([[maybe_unused]] CameraMode const &camera_mode, + Metadata *metadata) { // On a mode switch, it's possible the exposure profile could change, // so we run through the dividing up of exposure/gain again and diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 37472087..4557016c 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -191,7 +191,7 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo) } void IPARPi::configure(const CameraSensorInfo &sensorInfo, - const std::map &streamConfig, + [[maybe_unused]] const std::map &streamConfig, const std::map &entityControls, const IPAOperationData &ipaConfig, IPAOperationData *result) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 3a1c50c4..d95d902a 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -32,7 +32,10 @@ LOG_DEFINE_CATEGORY(IPARkISP1) class IPARkISP1 : public IPAInterface { public: - int init(const IPASettings &settings) override { return 0; } + int init([[maybe_unused]] const IPASettings &settings) override + { + return 0; + } int start() override { return 0; } void stop() override {} @@ -75,11 +78,11 @@ private: * assemble one. Make sure the reported sensor information are relevant * before accessing them. */ -void IPARkISP1::configure(const CameraSensorInfo &info, - const std::map &streamConfig, +void IPARkISP1::configure([[maybe_unused]] const CameraSensorInfo &info, + [[maybe_unused]] const std::map &streamConfig, const std::map &entityControls, - const IPAOperationData &ipaConfig, - IPAOperationData *result) + [[maybe_unused]] const IPAOperationData &ipaConfig, + [[maybe_unused]] IPAOperationData *result) { if (entityControls.empty()) return; diff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp index 1593c92d..ef257762 100644 --- a/src/ipa/vimc/vimc.cpp +++ b/src/ipa/vimc/vimc.cpp @@ -37,14 +37,14 @@ public: int start() override; void stop() override; - void configure(const CameraSensorInfo &sensorInfo, - const std::map &streamConfig, - const std::map &entityControls, - const IPAOperationData &ipaConfig, - IPAOperationData *result) override {} - void mapBuffers(const std::vector &buffers) override {} - void unmapBuffers(const std::vector &ids) override {} - void processEvent(const IPAOperationData &event) override {} + void configure([[maybe_unused]] const CameraSensorInfo &sensorInfo, + [[maybe_unused]] const std::map &streamConfig, + [[maybe_unused]] const std::map &entityControls, + [[maybe_unused]] const IPAOperationData &ipaConfig, + [[maybe_unused]] IPAOperationData *result) override {} + void mapBuffers([[maybe_unused]] const std::vector &buffers) override {} + void unmapBuffers([[maybe_unused]] const std::vector &ids) override {} + void processEvent([[maybe_unused]] const IPAOperationData &event) override {} private: void initTrace(); diff --git a/src/libcamera/device_enumerator_udev.cpp b/src/libcamera/device_enumerator_udev.cpp index 96689daa..c6e23a1a 100644 --- a/src/libcamera/device_enumerator_udev.cpp +++ b/src/libcamera/device_enumerator_udev.cpp @@ -327,7 +327,7 @@ int DeviceEnumeratorUdev::addV4L2Device(dev_t devnum) return 0; } -void DeviceEnumeratorUdev::udevNotify(EventNotifier *notifier) +void DeviceEnumeratorUdev::udevNotify([[maybe_unused]] EventNotifier *notifier) { struct udev_device *dev = udev_monitor_receive_device(monitor_); std::string action(udev_device_get_action(dev)); diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp index d7a75104..046fd5c6 100644 --- a/src/libcamera/ipa_manager.cpp +++ b/src/libcamera/ipa_manager.cpp @@ -300,7 +300,7 @@ std::unique_ptr IPAManager::createIPA(PipelineHandler *pipe, return proxy; } -bool IPAManager::isSignatureValid(IPAModule *ipa) const +bool IPAManager::isSignatureValid([[maybe_unused]] IPAModule *ipa) const { #if HAVE_IPA_PUBKEY File file{ ipa->path() }; diff --git a/src/libcamera/ipc_unixsocket.cpp b/src/libcamera/ipc_unixsocket.cpp index 7df86e88..701b2c51 100644 --- a/src/libcamera/ipc_unixsocket.cpp +++ b/src/libcamera/ipc_unixsocket.cpp @@ -308,7 +308,7 @@ int IPCUnixSocket::recvData(void *buffer, size_t length, return 0; } -void IPCUnixSocket::dataNotifier(EventNotifier *notifier) +void IPCUnixSocket::dataNotifier([[maybe_unused]] EventNotifier *notifier) { int ret; diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index b8f0549f..42c9caa0 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -758,7 +758,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config) return ret; } -int PipelineHandlerRPi::exportFrameBuffers(Camera *camera, Stream *stream, +int PipelineHandlerRPi::exportFrameBuffers([[maybe_unused]] Camera *camera, Stream *stream, std::vector> *buffers) { RPiStream *s = static_cast(stream); @@ -1182,7 +1182,8 @@ int RPiCameraData::configureIPA() return 0; } -void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData &action) +void RPiCameraData::queueFrameAction([[maybe_unused]] unsigned int frame, + const IPAOperationData &action) { /* * The following actions can be handled when the pipeline handler is in diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 32fdaed7..4d89aab3 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -700,7 +700,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c) return 0; } -int PipelineHandlerRkISP1::exportFrameBuffers(Camera *camera, Stream *stream, +int PipelineHandlerRkISP1::exportFrameBuffers([[maybe_unused]] Camera *camera, Stream *stream, std::vector> *buffers) { unsigned int count = stream->configuration().bufferCount; diff --git a/src/libcamera/pipeline/rkisp1/timeline.cpp b/src/libcamera/pipeline/rkisp1/timeline.cpp index f5194608..6b83bbe5 100644 --- a/src/libcamera/pipeline/rkisp1/timeline.cpp +++ b/src/libcamera/pipeline/rkisp1/timeline.cpp @@ -204,7 +204,7 @@ void Timeline::updateDeadline() timer_.start(deadline); } -void Timeline::timeout(Timer *timer) +void Timeline::timeout([[maybe_unused]] Timer *timer) { utils::time_point now = std::chrono::steady_clock::now(); diff --git a/src/libcamera/process.cpp b/src/libcamera/process.cpp index 8311d274..994190dc 100644 --- a/src/libcamera/process.cpp +++ b/src/libcamera/process.cpp @@ -89,7 +89,7 @@ void sigact(int signal, siginfo_t *info, void *ucontext) } /* namespace */ -void ProcessManager::sighandler(EventNotifier *notifier) +void ProcessManager::sighandler([[maybe_unused]] EventNotifier *notifier) { char data; ssize_t ret = read(pipe_[0], &data, sizeof(data)); diff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp index 68eafb30..b78a0e45 100644 --- a/src/libcamera/proxy/ipa_proxy_linux.cpp +++ b/src/libcamera/proxy/ipa_proxy_linux.cpp @@ -26,17 +26,20 @@ public: IPAProxyLinux(IPAModule *ipam); ~IPAProxyLinux(); - int init(const IPASettings &settings) override { return 0; } + int init([[maybe_unused]] const IPASettings &settings) override + { + return 0; + } int start() override { return 0; } void stop() override {} - void configure(const CameraSensorInfo &sensorInfo, - const std::map &streamConfig, - const std::map &entityControls, - const IPAOperationData &ipaConfig, - IPAOperationData *result) override {} - void mapBuffers(const std::vector &buffers) override {} - void unmapBuffers(const std::vector &ids) override {} - void processEvent(const IPAOperationData &event) override {} + void configure([[maybe_unused]] const CameraSensorInfo &sensorInfo, + [[maybe_unused]] const std::map &streamConfig, + [[maybe_unused]] const std::map &entityControls, + [[maybe_unused]] const IPAOperationData &ipaConfig, + [[maybe_unused]] IPAOperationData *result) override {} + void mapBuffers([[maybe_unused]] const std::vector &buffers) override {} + void unmapBuffers([[maybe_unused]] const std::vector &ids) override {} + void processEvent([[maybe_unused]] const IPAOperationData &event) override {} private: void readyRead(IPCUnixSocket *ipc); @@ -91,7 +94,7 @@ IPAProxyLinux::~IPAProxyLinux() delete socket_; } -void IPAProxyLinux::readyRead(IPCUnixSocket *ipc) +void IPAProxyLinux::readyRead([[maybe_unused]] IPCUnixSocket *ipc) { } diff --git a/src/libcamera/pub_key.cpp b/src/libcamera/pub_key.cpp index 2f60adbb..9bb08fda 100644 --- a/src/libcamera/pub_key.cpp +++ b/src/libcamera/pub_key.cpp @@ -30,7 +30,7 @@ namespace libcamera { * \brief Construct a PubKey from key data * \param[in] key Key data encoded in DER format */ -PubKey::PubKey(Span key) +PubKey::PubKey([[maybe_unused]] Span key) : valid_(false) { #if HAVE_GNUTLS @@ -73,7 +73,8 @@ PubKey::~PubKey() * * \return True if the signature is valid, false otherwise */ -bool PubKey::verify(Span data, Span sig) const +bool PubKey::verify([[maybe_unused]] Span data, + [[maybe_unused]] Span sig) const { #if HAVE_GNUTLS const gnutls_datum_t gnuTlsData{ diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp index 8391ec48..30c94bb9 100644 --- a/src/libcamera/v4l2_pixelformat.cpp +++ b/src/libcamera/v4l2_pixelformat.cpp @@ -196,7 +196,7 @@ PixelFormat V4L2PixelFormat::toPixelFormat() const * \return The V4L2PixelFormat corresponding to \a pixelFormat */ V4L2PixelFormat V4L2PixelFormat::fromPixelFormat(const PixelFormat &pixelFormat, - bool multiplanar) + [[maybe_unused]] bool multiplanar) { const PixelFormatInfo &info = PixelFormatInfo::info(pixelFormat); if (!info.isValid()) diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 652677ff..508522ef 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1462,7 +1462,7 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer) * For Capture video devices the FrameBuffer will contain valid data. * For Output video devices the FrameBuffer can be considered empty. */ -void V4L2VideoDevice::bufferAvailable(EventNotifier *notifier) +void V4L2VideoDevice::bufferAvailable([[maybe_unused]] EventNotifier *notifier) { FrameBuffer *buffer = dequeueBuffer(); if (!buffer) @@ -1539,7 +1539,7 @@ FrameBuffer *V4L2VideoDevice::dequeueBuffer() * When this slot is called, a V4L2 event is available to be dequeued from the * device. */ -void V4L2VideoDevice::eventAvailable(EventNotifier *notifier) +void V4L2VideoDevice::eventAvailable([[maybe_unused]] EventNotifier *notifier) { struct v4l2_event event{}; int ret = ioctl(VIDIOC_DQEVENT, &event); diff --git a/src/qcam/dng_writer.cpp b/src/qcam/dng_writer.cpp index b5b81f06..030d1387 100644 --- a/src/qcam/dng_writer.cpp +++ b/src/qcam/dng_writer.cpp @@ -215,7 +215,7 @@ void packScanlineIPU3(void *output, const void *input, unsigned int width) } } -void thumbScanlineIPU3(const FormatInfo &info, void *output, +void thumbScanlineIPU3([[maybe_unused]] const FormatInfo &info, void *output, const void *input, unsigned int width, unsigned int stride) { @@ -350,7 +350,8 @@ static const std::map formatInfo = { int DNGWriter::write(const char *filename, const Camera *camera, const StreamConfiguration &config, const ControlList &metadata, - const FrameBuffer *buffer, const void *data) + [[maybe_unused]] const FrameBuffer *buffer, + const void *data) { const auto it = formatInfo.find(config.pixelFormat); if (it == formatInfo.cend()) { diff --git a/src/qcam/main.cpp b/src/qcam/main.cpp index b3468cbf..bae358df 100644 --- a/src/qcam/main.cpp +++ b/src/qcam/main.cpp @@ -17,7 +17,7 @@ #include "../cam/stream_options.h" #include "main_window.h" -void signalHandler(int signal) +void signalHandler([[maybe_unused]] int signal) { qInfo() << "Exiting"; qApp->quit(); diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index 75035372..612d978a 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -637,7 +637,8 @@ void MainWindow::captureRaw() captureRaw_ = true; } -void MainWindow::processRaw(FrameBuffer *buffer, const ControlList &metadata) +void MainWindow::processRaw(FrameBuffer *buffer, + [[maybe_unused]] const ControlList &metadata) { #ifdef HAVE_DNG QString defaultPath = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp index 61bca073..7a22f983 100644 --- a/src/v4l2/v4l2_camera.cpp +++ b/src/v4l2/v4l2_camera.cpp @@ -158,7 +158,7 @@ int V4L2Camera::validateConfiguration(const PixelFormat &pixelFormat, return 0; } -int V4L2Camera::allocBuffers(unsigned int count) +int V4L2Camera::allocBuffers([[maybe_unused]] unsigned int count) { Stream *stream = config_->at(0).stream(); 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