[libcamera-devel,1/2] simple-cam: Turn globals static
diff mbox series

Message ID 20210926203319.18289-1-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,1/2] simple-cam: Turn globals static
Related show

Commit Message

Laurent Pinchart Sept. 26, 2021, 8:33 p.m. UTC
From: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>

This fixes a warning from QtCreator.

Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>
---
 simple-cam.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


base-commit: b8da445fc72cfd436ed7ddb8a428e7ea11af9fd9
prerequisite-patch-id: a93394f0289868f6be89478f79cc43f1080d5751

Comments

Laurent Pinchart Sept. 26, 2021, 8:39 p.m. UTC | #1
Hi Dorota,

Thank you for the patch.

On Sun, Sep 26, 2021 at 11:33:18PM +0300, Laurent Pinchart wrote:
> From: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>
> 
> This fixes a warning from QtCreator.
> 
> Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>

Looks good to me. I'll submit a corresponding fix to the application
writer's guide in libcamera.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  simple-cam.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/simple-cam.cpp b/simple-cam.cpp
> index 95e472b4377a..350f68be7906 100644
> --- a/simple-cam.cpp
> +++ b/simple-cam.cpp
> @@ -16,8 +16,8 @@
>  #define TIMEOUT_SEC 3
>  
>  using namespace libcamera;
> -std::shared_ptr<Camera> camera;
> -EventLoop loop;
> +static std::shared_ptr<Camera> camera;
> +static EventLoop loop;
>  
>  /*
>   * --------------------------------------------------------------------
> 
> base-commit: b8da445fc72cfd436ed7ddb8a428e7ea11af9fd9
> prerequisite-patch-id: a93394f0289868f6be89478f79cc43f1080d5751
Paul Elder Sept. 27, 2021, 6:51 a.m. UTC | #2
Hi,

On Sun, Sep 26, 2021 at 11:33:18PM +0300, Laurent Pinchart wrote:
> From: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>
> 
> This fixes a warning from QtCreator.
> 
> Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  simple-cam.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/simple-cam.cpp b/simple-cam.cpp
> index 95e472b4377a..350f68be7906 100644
> --- a/simple-cam.cpp
> +++ b/simple-cam.cpp
> @@ -16,8 +16,8 @@
>  #define TIMEOUT_SEC 3
>  
>  using namespace libcamera;
> -std::shared_ptr<Camera> camera;
> -EventLoop loop;
> +static std::shared_ptr<Camera> camera;
> +static EventLoop loop;
>  
>  /*
>   * --------------------------------------------------------------------
> 
> base-commit: b8da445fc72cfd436ed7ddb8a428e7ea11af9fd9
> prerequisite-patch-id: a93394f0289868f6be89478f79cc43f1080d5751
Kieran Bingham Sept. 27, 2021, 11:59 a.m. UTC | #3
On Sun, Sep 26, 2021 at 11:39:23PM +0300, Laurent Pinchart wrote:
> Hi Dorota,
> 
> Thank you for the patch.
> 
> On Sun, Sep 26, 2021 at 11:33:18PM +0300, Laurent Pinchart wrote:
> > From: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>
> > 
> > This fixes a warning from QtCreator.
> > 
> > Signed-off-by: Dorota Czaplejewicz <dorota.czaplejewicz@puri.sm>
> 
> Looks good to me. I'll submit a corresponding fix to the application
> writer's guide in libcamera.

I've got other patches to submit to that too ... maybe it's time to
revive them.

But this is likely a good thing to do all the same

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

> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> 
> > ---
> >  simple-cam.cpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/simple-cam.cpp b/simple-cam.cpp
> > index 95e472b4377a..350f68be7906 100644
> > --- a/simple-cam.cpp
> > +++ b/simple-cam.cpp
> > @@ -16,8 +16,8 @@
> >  #define TIMEOUT_SEC 3
> >  
> >  using namespace libcamera;
> > -std::shared_ptr<Camera> camera;
> > -EventLoop loop;
> > +static std::shared_ptr<Camera> camera;
> > +static EventLoop loop;
> >  
> >  /*
> >   * --------------------------------------------------------------------
> > 
> > base-commit: b8da445fc72cfd436ed7ddb8a428e7ea11af9fd9
> > prerequisite-patch-id: a93394f0289868f6be89478f79cc43f1080d5751
> 
> -- 
> Regards,
> 
> Laurent Pinchart

Patch
diff mbox series

diff --git a/simple-cam.cpp b/simple-cam.cpp
index 95e472b4377a..350f68be7906 100644
--- a/simple-cam.cpp
+++ b/simple-cam.cpp
@@ -16,8 +16,8 @@ 
 #define TIMEOUT_SEC 3
 
 using namespace libcamera;
-std::shared_ptr<Camera> camera;
-EventLoop loop;
+static std::shared_ptr<Camera> camera;
+static EventLoop loop;
 
 /*
  * --------------------------------------------------------------------