[libcamera-devel] libcamera: bound_method: Fix type of pack for void methods
diff mbox series

Message ID 20210407145309.16877-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 9b2544d3df481bc9dd0795fb645b544ba6484216
Headers show
Series
  • [libcamera-devel] libcamera: bound_method: Fix type of pack for void methods
Related show

Commit Message

Laurent Pinchart April 7, 2021, 2:53 p.m. UTC
The BoundMethodPack used by the void BoundMethodArgs variant incorrectly
specified the template argument as void * instead of void. This causes
no functional problem, but results in space for an unused void * return
value being reserved. 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

Sebastian Fricke April 7, 2021, 5:06 p.m. UTC | #1
Hey Laurent,

Thank you for the patch.

On 07.04.2021 17:53, Laurent Pinchart wrote:
>The BoundMethodPack used by the void BoundMethodArgs variant incorrectly
>specified the template argument as void * instead of void. This causes
>no functional problem, but results in space for an unused void * return
>value being reserved. Fix it.

Looks good to me.

>
>Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Fricke <sebastian.fricke@posteo.net>

>---
> 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 95a956530877..f216e3b56826 100644
>--- a/include/libcamera/bound_method.h
>+++ b/include/libcamera/bound_method.h
>@@ -174,7 +174,7 @@ template<typename T, typename... Args>
> class BoundMethodMember<T, void, Args...> : public BoundMethodArgs<void, Args...>
> {
> public:
>-	using PackType = typename BoundMethodArgs<void *, Args...>::PackType;
>+	using PackType = typename BoundMethodArgs<void, Args...>::PackType;
>
> 	BoundMethodMember(T *obj, Object *object, void (T::*func)(Args...),
> 			  ConnectionType type = ConnectionTypeAuto)
>-- 
>Regards,
>
>Laurent Pinchart

Greetings,
Sebastian
>
>_______________________________________________
>libcamera-devel mailing list
>libcamera-devel@lists.libcamera.org
>https://lists.libcamera.org/listinfo/libcamera-devel
Kieran Bingham April 12, 2021, 6:56 p.m. UTC | #2
Hi Laurent,

On 07/04/2021 15:53, Laurent Pinchart wrote:
> The BoundMethodPack used by the void BoundMethodArgs variant incorrectly
> specified the template argument as void * instead of void. This causes
> no functional problem, but results in space for an unused void * return
> value being reserved. Fix it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Kieran Bingham <kieran.bingham@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 95a956530877..f216e3b56826 100644
> --- a/include/libcamera/bound_method.h
> +++ b/include/libcamera/bound_method.h
> @@ -174,7 +174,7 @@ template<typename T, typename... Args>
>  class BoundMethodMember<T, void, Args...> : public BoundMethodArgs<void, Args...>
>  {
>  public:
> -	using PackType = typename BoundMethodArgs<void *, Args...>::PackType;
> +	using PackType = typename BoundMethodArgs<void, Args...>::PackType;
>  
>  	BoundMethodMember(T *obj, Object *object, void (T::*func)(Args...),
>  			  ConnectionType type = ConnectionTypeAuto)
>

Patch
diff mbox series

diff --git a/include/libcamera/bound_method.h b/include/libcamera/bound_method.h
index 95a956530877..f216e3b56826 100644
--- a/include/libcamera/bound_method.h
+++ b/include/libcamera/bound_method.h
@@ -174,7 +174,7 @@  template<typename T, typename... Args>
 class BoundMethodMember<T, void, Args...> : public BoundMethodArgs<void, Args...>
 {
 public:
-	using PackType = typename BoundMethodArgs<void *, Args...>::PackType;
+	using PackType = typename BoundMethodArgs<void, Args...>::PackType;
 
 	BoundMethodMember(T *obj, Object *object, void (T::*func)(Args...),
 			  ConnectionType type = ConnectionTypeAuto)