[libcamera-devel,04/14] libcamera: bound_method: Mark overriden methods with override

Message ID 20200104050947.7673-5-laurent.pinchart@ideasonboard.com
State Accepted
Commit 7d66a45b8d91994ed0b9db368282b0e1135bfb44
Headers show
Series
  • object: Propagate return value of invoked method
Related show

Commit Message

Laurent Pinchart Jan. 4, 2020, 5:09 a.m. UTC
Mark the activate() and invoke() methods with the override keyword where
appropriate.

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

Comments

Niklas Söderlund Jan. 7, 2020, 7 p.m. UTC | #1
Hi Laurent,

Thanks for your work.

On 2020-01-04 07:09:37 +0200, Laurent Pinchart wrote:
> Mark the activate() and invoke() methods with the override keyword where
> appropriate.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  include/libcamera/bound_method.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h
> index 5743cacf5388..f23b17c7dd98 100644
> --- a/include/libcamera/bound_method.h
> +++ b/include/libcamera/bound_method.h
> @@ -107,7 +107,7 @@ public:
>  
>  	bool match(void (T::*func)(Args...)) const { return func == func_; }
>  
> -	void activate(Args... args, bool deleteMethod = false)
> +	void activate(Args... args, bool deleteMethod = false) override
>  	{
>  		if (this->object_)
>  			BoundMethodBase::activatePack(new PackType{ args... }, deleteMethod);
> @@ -115,7 +115,7 @@ public:
>  			(static_cast<T *>(this->obj_)->*func_)(args...);
>  	}
>  
> -	void invoke(Args... args)
> +	void invoke(Args... args) override
>  	{
>  		(static_cast<T *>(this->obj_)->*func_)(args...);
>  	}
> @@ -136,12 +136,12 @@ public:
>  
>  	bool match(void (*func)(Args...)) const { return func == func_; }
>  
> -	void activate(Args... args, bool deleteMethod = false)
> +	void activate(Args... args, bool deleteMethod = false) override
>  	{
>  		(*func_)(args...);
>  	}
>  
> -	void invoke(Args...) {}
> +	void invoke(Args...) override {}
>  
>  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 5743cacf5388..f23b17c7dd98 100644
--- a/include/libcamera/bound_method.h
+++ b/include/libcamera/bound_method.h
@@ -107,7 +107,7 @@  public:
 
 	bool match(void (T::*func)(Args...)) const { return func == func_; }
 
-	void activate(Args... args, bool deleteMethod = false)
+	void activate(Args... args, bool deleteMethod = false) override
 	{
 		if (this->object_)
 			BoundMethodBase::activatePack(new PackType{ args... }, deleteMethod);
@@ -115,7 +115,7 @@  public:
 			(static_cast<T *>(this->obj_)->*func_)(args...);
 	}
 
-	void invoke(Args... args)
+	void invoke(Args... args) override
 	{
 		(static_cast<T *>(this->obj_)->*func_)(args...);
 	}
@@ -136,12 +136,12 @@  public:
 
 	bool match(void (*func)(Args...)) const { return func == func_; }
 
-	void activate(Args... args, bool deleteMethod = false)
+	void activate(Args... args, bool deleteMethod = false) override
 	{
 		(*func_)(args...);
 	}
 
-	void invoke(Args...) {}
+	void invoke(Args...) override {}
 
 private:
 	void (*func_)(Args...);