[PATCH] utils: ipc: Fix event functions with no parameters
Paul Elder
paul.elder at ideasonboard.com
Wed Apr 10 09:38:56 CEST 2024
On Tue, Apr 09, 2024 at 06:24:28PM +0300, Laurent Pinchart wrote:
> Hi Paul,
>
> Thank you for the patch.
>
> On Tue, Apr 09, 2024 at 07:40:44PM +0900, Paul Elder wrote:
> > If an event function is defined with no parameters, there would be a
> > compilation error complaining about unused parameters in the generated
> > code for the data and dataSize parameters that would normally correspond
> > to serialized data. Fix this by simply marking the parameters as
> > maybe_unused.
> >
> > Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> > ---
> > .../generators/libcamera_templates/module_ipa_proxy.cpp.tmpl | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> > index c37c4941..238cf4a5 100644
> > --- a/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> > +++ b/utils/ipc/generators/libcamera_templates/module_ipa_proxy.cpp.tmpl
> > @@ -235,8 +235,8 @@ void {{proxy_name}}::recvMessage(const IPCMessage &data)
> > }
> >
> > void {{proxy_name}}::{{method.mojom_name}}IPC(
> > - std::vector<uint8_t>::const_iterator data,
> > - size_t dataSize,
> > + [[maybe_unused]] std::vector<uint8_t>::const_iterator data,
> > + [[maybe_unused]] size_t dataSize,
>
> Do you think it would be useful to set [[maybe_unused]] only when there
> are no parameters, or would that be overkill ? I suppose it's called
> "maybe_unused" and ont "unused" for a reason, so
I think it's overkill :)
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Thanks,
Paul
>
> > [[maybe_unused]] const std::vector<SharedFD> &fds)
> > {
> > {%- for param in method.parameters %}
More information about the libcamera-devel
mailing list