[libcamera-devel] libcamera: bound_method: Fix compiler warning due to unused arguments

Message ID 20191026211743.12963-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 9d66ffc085e4e8fd8d24fd196b70d88c7d0b0b7e
Headers show
Series
  • [libcamera-devel] libcamera: bound_method: Fix compiler warning due to unused arguments
Related show

Commit Message

Laurent Pinchart Oct. 26, 2019, 9:17 p.m. UTC
The BoundStaticMethod::invoke() method is never used, but must still be
implemented as the base class defines it as pure virtual. As it doesn't
use its arguments, the compiler generates a warning. Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 include/libcamera/bound_method.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jacopo Mondi Oct. 26, 2019, 9:32 p.m. UTC | #1
Hi Laurent

On Sun, Oct 27, 2019 at 12:17:43AM +0300, Laurent Pinchart wrote:
> The BoundStaticMethod::invoke() method is never used, but must still be
> implemented as the base class defines it as pure virtual. As it doesn't
> use its arguments, the compiler generates a warning. Fix it.
>

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
   j

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  include/libcamera/bound_method.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h
> index 54c40fc52e3b..8ebaadbec887 100644
> --- a/include/libcamera/bound_method.h
> +++ b/include/libcamera/bound_method.h
> @@ -119,7 +119,7 @@ public:
>  	bool match(void (*func)(Args...)) const { return func == func_; }
>
>  	void activate(Args... args) { (*func_)(args...); }
> -	void invoke(Args... args) {}
> +	void invoke(Args...) {}
>
>  private:
>  	void (*func_)(Args...);
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h
index 54c40fc52e3b..8ebaadbec887 100644
--- a/include/libcamera/bound_method.h
+++ b/include/libcamera/bound_method.h
@@ -119,7 +119,7 @@  public:
 	bool match(void (*func)(Args...)) const { return func == func_; }
 
 	void activate(Args... args) { (*func_)(args...); }
-	void invoke(Args... args) {}
+	void invoke(Args...) {}
 
 private:
 	void (*func_)(Args...);