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>
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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() };
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user