[libcamera-devel,2/3] libcamera: signal: Fix coding style issues

Message ID 20190212223702.9582-2-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,1/3] libcamera: pipeline_handler: Disconnect MediaDevice::disconnected signal
Related show

Commit Message

Laurent Pinchart Feb. 12, 2019, 10:37 p.m. UTC
Fix issues reported by checkstyle.py in preparation for further changes.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
Changes since v1:

- Don't add a space after the template keyword
---
 include/libcamera/signal.h | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Niklas Söderlund Feb. 13, 2019, 10:46 a.m. UTC | #1
Hi Laurent,

Thanks for your patch.

On 2019-02-13 00:37:01 +0200, Laurent Pinchart wrote:
> Fix issues reported by checkstyle.py in preparation for further changes.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
> Changes since v1:
> 
> - Don't add a space after the template keyword
> ---
>  include/libcamera/signal.h | 16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/include/libcamera/signal.h b/include/libcamera/signal.h
> index c375b0a878af..85dc481d6957 100644
> --- a/include/libcamera/signal.h
> +++ b/include/libcamera/signal.h
> @@ -34,28 +34,28 @@ template<typename T, typename... Args>
>  class SlotMember : public SlotBase<Args...>
>  {
>  public:
> -	SlotMember(T *obj, void(T::*func)(Args...))
> +	SlotMember(T *obj, void (T::*func)(Args...))
>  		: SlotBase<Args...>(obj), func_(func) { }
>  
>  	void invoke(Args... args) { (static_cast<T *>(this->obj_)->*func_)(args...); }
>  
>  private:
>  	friend class Signal<Args...>;
> -	void(T::*func_)(Args...);
> +	void (T::*func_)(Args...);
>  };
>  
>  template<typename... Args>
>  class SlotStatic : public SlotBase<Args...>
>  {
>  public:
> -	SlotStatic(void(*func)(Args...))
> +	SlotStatic(void (*func)(Args...))
>  		: SlotBase<Args...>(nullptr), func_(func) { }
>  
>  	void invoke(Args... args) { (*func_)(args...); }
>  
>  private:
>  	friend class Signal<Args...>;
> -	void(*func_)(Args...);
> +	void (*func_)(Args...);
>  };
>  
>  template<typename... Args>
> @@ -70,12 +70,12 @@ public:
>  	}
>  
>  	template<typename T>
> -	void connect(T *object, void(T::*func)(Args...))
> +	void connect(T *object, void (T::*func)(Args...))
>  	{
>  		slots_.push_back(new SlotMember<T, Args...>(object, func));
>  	}
>  
> -	void connect(void(*func)(Args...))
> +	void connect(void (*func)(Args...))
>  	{
>  		slots_.push_back(new SlotStatic<Args...>(func));
>  	}
> @@ -102,7 +102,7 @@ public:
>  	}
>  
>  	template<typename T>
> -	void disconnect(T *object, void(T::*func)(Args...))
> +	void disconnect(T *object, void (T::*func)(Args...))
>  	{
>  		for (auto iter = slots_.begin(); iter != slots_.end(); ) {
>  			SlotBase<Args...> *slot = *iter;
> @@ -120,7 +120,7 @@ public:
>  		}
>  	}
>  
> -	void disconnect(void(*func)(Args...))
> +	void disconnect(void (*func)(Args...))
>  	{
>  		for (auto iter = slots_.begin(); iter != slots_.end(); ) {
>  			SlotBase<Args...> *slot = *iter;
> -- 
> 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/signal.h b/include/libcamera/signal.h
index c375b0a878af..85dc481d6957 100644
--- a/include/libcamera/signal.h
+++ b/include/libcamera/signal.h
@@ -34,28 +34,28 @@  template<typename T, typename... Args>
 class SlotMember : public SlotBase<Args...>
 {
 public:
-	SlotMember(T *obj, void(T::*func)(Args...))
+	SlotMember(T *obj, void (T::*func)(Args...))
 		: SlotBase<Args...>(obj), func_(func) { }
 
 	void invoke(Args... args) { (static_cast<T *>(this->obj_)->*func_)(args...); }
 
 private:
 	friend class Signal<Args...>;
-	void(T::*func_)(Args...);
+	void (T::*func_)(Args...);
 };
 
 template<typename... Args>
 class SlotStatic : public SlotBase<Args...>
 {
 public:
-	SlotStatic(void(*func)(Args...))
+	SlotStatic(void (*func)(Args...))
 		: SlotBase<Args...>(nullptr), func_(func) { }
 
 	void invoke(Args... args) { (*func_)(args...); }
 
 private:
 	friend class Signal<Args...>;
-	void(*func_)(Args...);
+	void (*func_)(Args...);
 };
 
 template<typename... Args>
@@ -70,12 +70,12 @@  public:
 	}
 
 	template<typename T>
-	void connect(T *object, void(T::*func)(Args...))
+	void connect(T *object, void (T::*func)(Args...))
 	{
 		slots_.push_back(new SlotMember<T, Args...>(object, func));
 	}
 
-	void connect(void(*func)(Args...))
+	void connect(void (*func)(Args...))
 	{
 		slots_.push_back(new SlotStatic<Args...>(func));
 	}
@@ -102,7 +102,7 @@  public:
 	}
 
 	template<typename T>
-	void disconnect(T *object, void(T::*func)(Args...))
+	void disconnect(T *object, void (T::*func)(Args...))
 	{
 		for (auto iter = slots_.begin(); iter != slots_.end(); ) {
 			SlotBase<Args...> *slot = *iter;
@@ -120,7 +120,7 @@  public:
 		}
 	}
 
-	void disconnect(void(*func)(Args...))
+	void disconnect(void (*func)(Args...))
 	{
 		for (auto iter = slots_.begin(); iter != slots_.end(); ) {
 			SlotBase<Args...> *slot = *iter;