diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-10-27 00:36:13 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-08-25 02:58:04 +0300 |
commit | dbafe16da7a9999ec77da21a42537702fb87f124 (patch) | |
tree | bf195d3f0feee0efc714267f70d85bfc54b8c63c /src | |
parent | 3ef378731ad89de4dd77e0cb79860cc86676060e (diff) |
meson: Remove -Wno-unused-parameter
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>
Diffstat (limited to 'src')
26 files changed, 75 insertions, 56 deletions
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<CameraMetadata> CameraDevice::getResultMetadata(int frame_number, - int64_t timestamp) +std::unique_ptr<CameraMetadata> +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<unsigned int, IPAStream> &streamConfig, + [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig, const std::map<unsigned int, const ControlInfoMap &> &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<unsigned int, IPAStream> &streamConfig, +void IPARkISP1::configure([[maybe_unused]] const CameraSensorInfo &info, + [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig, const std::map<unsigned int, const ControlInfoMap &> &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<unsigned int, IPAStream> &streamConfig, - const std::map<unsigned int, const ControlInfoMap &> &entityControls, - const IPAOperationData &ipaConfig, - IPAOperationData *result) override {} - void mapBuffers(const std::vector<IPABuffer> &buffers) override {} - void unmapBuffers(const std::vector<unsigned int> &ids) override {} - void processEvent(const IPAOperationData &event) override {} + void configure([[maybe_unused]] const CameraSensorInfo &sensorInfo, + [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig, + [[maybe_unused]] const std::map<unsigned int, const ControlInfoMap &> &entityControls, + [[maybe_unused]] const IPAOperationData &ipaConfig, + [[maybe_unused]] IPAOperationData *result) override {} + void mapBuffers([[maybe_unused]] const std::vector<IPABuffer> &buffers) override {} + void unmapBuffers([[maybe_unused]] const std::vector<unsigned int> &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<IPAProxy> 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<std::unique_ptr<FrameBuffer>> *buffers) { RPiStream *s = static_cast<RPiStream *>(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<std::unique_ptr<FrameBuffer>> *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<unsigned int, IPAStream> &streamConfig, - const std::map<unsigned int, const ControlInfoMap &> &entityControls, - const IPAOperationData &ipaConfig, - IPAOperationData *result) override {} - void mapBuffers(const std::vector<IPABuffer> &buffers) override {} - void unmapBuffers(const std::vector<unsigned int> &ids) override {} - void processEvent(const IPAOperationData &event) override {} + void configure([[maybe_unused]] const CameraSensorInfo &sensorInfo, + [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig, + [[maybe_unused]] const std::map<unsigned int, const ControlInfoMap &> &entityControls, + [[maybe_unused]] const IPAOperationData &ipaConfig, + [[maybe_unused]] IPAOperationData *result) override {} + void mapBuffers([[maybe_unused]] const std::vector<IPABuffer> &buffers) override {} + void unmapBuffers([[maybe_unused]] const std::vector<unsigned int> &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<const uint8_t> key) +PubKey::PubKey([[maybe_unused]] Span<const uint8_t> 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<const uint8_t> data, Span<const uint8_t> sig) const +bool PubKey::verify([[maybe_unused]] Span<const uint8_t> data, + [[maybe_unused]] Span<const uint8_t> 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<PixelFormat, FormatInfo> 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(); |