[libcamera-devel] libcamera: signal: Fix return value template type of BoundMethodMember
diff mbox series

Message ID 20210412225841.13724-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit ab8db44efb09c54c402d027bbf980b0249958429
Headers show
Series
  • [libcamera-devel] libcamera: signal: Fix return value template type of BoundMethodMember
Related show

Commit Message

Laurent Pinchart April 12, 2021, 10:58 p.m. UTC
The BoundMethodMember instance created in Signal::connect() for
receivers inheriting from the Object class incorrectly sets the return
type to void instead of R. This doesn't cause any functional issue as
the return type is ignored anyway for signals, but should be fixed
nonetheless.

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

Comments

Kieran Bingham April 13, 2021, 9:24 p.m. UTC | #1
Hi Laurent,

On 12/04/2021 23:58, Laurent Pinchart wrote:
> The BoundMethodMember instance created in Signal::connect() for
> receivers inheriting from the Object class incorrectly sets the return
> type to void instead of R. This doesn't cause any functional issue as
> the return type is ignored anyway for signals, but should be fixed
> nonetheless.
> 

Hrmmm signal.h is some tough reading.

But indeed I can see this is the only place where R isn't used.

Reveiwed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  include/libcamera/signal.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/libcamera/signal.h b/include/libcamera/signal.h
> index 5bcd7a77c5f1..3233529a1275 100644
> --- a/include/libcamera/signal.h
> +++ b/include/libcamera/signal.h
> @@ -49,7 +49,7 @@ public:
>  		     ConnectionType type = ConnectionTypeAuto)
>  	{
>  		Object *object = static_cast<Object *>(obj);
> -		SignalBase::connect(new BoundMethodMember<T, void, Args...>(obj, object, func, type));
> +		SignalBase::connect(new BoundMethodMember<T, R, Args...>(obj, object, func, type));
>  	}
>  
>  	template<typename T, typename R, typename std::enable_if_t<!std::is_base_of<Object, T>::value> * = nullptr>
>

Patch
diff mbox series

diff --git a/include/libcamera/signal.h b/include/libcamera/signal.h
index 5bcd7a77c5f1..3233529a1275 100644
--- a/include/libcamera/signal.h
+++ b/include/libcamera/signal.h
@@ -49,7 +49,7 @@  public:
 		     ConnectionType type = ConnectionTypeAuto)
 	{
 		Object *object = static_cast<Object *>(obj);
-		SignalBase::connect(new BoundMethodMember<T, void, Args...>(obj, object, func, type));
+		SignalBase::connect(new BoundMethodMember<T, R, Args...>(obj, object, func, type));
 	}
 
 	template<typename T, typename R, typename std::enable_if_t<!std::is_base_of<Object, T>::value> * = nullptr>