[libcamera-devel,17/21] qcam: viewfinder: Use PixelFormat default constructor

Message ID 20200323142205.28342-18-laurent.pinchart@ideasonboard.com
State Superseded
Headers show
Series
  • qcam: Bypass format conversion when not required
Related show

Commit Message

Laurent Pinchart March 23, 2020, 2:22 p.m. UTC
There's no need to initialize the PixelFormat stored in ViewFinder
explicitly, as PixelFormat is now a class with a default constructor.
Remove the initialization.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/qcam/viewfinder.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham March 23, 2020, 5:12 p.m. UTC | #1
Hi Laurent,

On 23/03/2020 14:22, Laurent Pinchart wrote:
> There's no need to initialize the PixelFormat stored in ViewFinder
> explicitly, as PixelFormat is now a class with a default constructor.
> Remove the initialization.

Aha, the benefits for the PixelFormat class continue!

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

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/qcam/viewfinder.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp
> index e7b12015d8f6..c4471ffa4a06 100644
> --- a/src/qcam/viewfinder.cpp
> +++ b/src/qcam/viewfinder.cpp
> @@ -16,7 +16,7 @@
>  #include "format_converter.h"
>  
>  ViewFinder::ViewFinder(QWidget *parent)
> -	: QWidget(parent), format_(0)
> +	: QWidget(parent)
>  {
>  }
>  
>

Patch

diff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp
index e7b12015d8f6..c4471ffa4a06 100644
--- a/src/qcam/viewfinder.cpp
+++ b/src/qcam/viewfinder.cpp
@@ -16,7 +16,7 @@ 
 #include "format_converter.h"
 
 ViewFinder::ViewFinder(QWidget *parent)
-	: QWidget(parent), format_(0)
+	: QWidget(parent)
 {
 }