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/libcamera | |
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/libcamera')
-rw-r--r-- | src/libcamera/device_enumerator_udev.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/ipa_manager.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/ipc_unixsocket.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 5 | ||||
-rw-r--r-- | src/libcamera/pipeline/rkisp1/rkisp1.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/pipeline/rkisp1/timeline.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/process.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/proxy/ipa_proxy_linux.cpp | 23 | ||||
-rw-r--r-- | src/libcamera/pub_key.cpp | 5 | ||||
-rw-r--r-- | src/libcamera/v4l2_pixelformat.cpp | 2 | ||||
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp | 4 |
11 files changed, 28 insertions, 23 deletions
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); |