[libcamera-devel] libcamera: geometry: Set steps to 0 in default SizeRange constructor

Message ID 20200519030445.15912-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 09eeec152086158e55870d8523b862b0731abdb5
Headers show
Series
  • [libcamera-devel] libcamera: geometry: Set steps to 0 in default SizeRange constructor
Related show

Commit Message

Laurent Pinchart May 19, 2020, 3:04 a.m. UTC
The default SizeRange constructor initializes the min and max members,
but leaves the hStep and vStep members uninitialized. Fix it.

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

Comments

Umang Jain May 19, 2020, 8:36 a.m. UTC | #1
Hi Laurent,

On Tue, 2020-05-19 at 06:04 +0300, Laurent Pinchart wrote:
> The default SizeRange constructor initializes the min and max
> members,
> but leaves the hStep and vStep members uninitialized. Fix it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  include/libcamera/geometry.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/libcamera/geometry.h
> b/include/libcamera/geometry.h
> index 2d364891858c..edda42cf34cc 100644
> --- a/include/libcamera/geometry.h
> +++ b/include/libcamera/geometry.h
> @@ -71,6 +71,7 @@ class SizeRange
>  {
>  public:
>  	SizeRange()
> +		: hStep(0), vStep(0)
>  	{
>  	}
>  

This makes sense.
Reviewed-by: Umang Jain <email@uajain.com>
Niklas Söderlund May 19, 2020, 2:06 p.m. UTC | #2
Hi Laurent,

Thanks for your work.

On 2020-05-19 06:04:45 +0300, Laurent Pinchart wrote:
> The default SizeRange constructor initializes the min and max members,
> but leaves the hStep and vStep members uninitialized. Fix it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  include/libcamera/geometry.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/libcamera/geometry.h b/include/libcamera/geometry.h
> index 2d364891858c..edda42cf34cc 100644
> --- a/include/libcamera/geometry.h
> +++ b/include/libcamera/geometry.h
> @@ -71,6 +71,7 @@ class SizeRange
>  {
>  public:
>  	SizeRange()
> +		: hStep(0), vStep(0)
>  	{
>  	}
>  
> -- 
> 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/geometry.h b/include/libcamera/geometry.h
index 2d364891858c..edda42cf34cc 100644
--- a/include/libcamera/geometry.h
+++ b/include/libcamera/geometry.h
@@ -71,6 +71,7 @@  class SizeRange
 {
 public:
 	SizeRange()
+		: hStep(0), vStep(0)
 	{
 	}