[libcamera-devel,v3] libcamera: pipeline: Fix c++20 compile warning
diff mbox series

Message ID 20231129160853.1081623-1-bbrotherton@google.com
State Accepted
Headers show
Series
  • [libcamera-devel,v3] libcamera: pipeline: Fix c++20 compile warning
Related show

Commit Message

Brett Brotherton Nov. 29, 2023, 4:07 p.m. UTC
Fix -Wdeprecated-this-capture error when building with c++20 by
explicity naming this in the capture.

Signed-off-by: Brett Brotherton <bbrotherton@google.com>
---

Sorry about that here is updated patch that orrects formatting in the
commit message. 

 src/libcamera/pipeline_handler.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart Nov. 29, 2023, 9:47 p.m. UTC | #1
Hi Brett,

On Wed, Nov 29, 2023 at 09:07:45AM -0700, Brett Brotherton via libcamera-devel wrote:
> Fix -Wdeprecated-this-capture error when building with c++20 by
> explicity naming this in the capture.
> 
> Signed-off-by: Brett Brotherton <bbrotherton@google.com>
> ---
> 
> Sorry about that here is updated patch that orrects formatting in the
> commit message. 

No worries. Thanks for the updated patch, but I've already pushed v2
with the update to the commit message applied manually :-)

>  src/libcamera/pipeline_handler.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index 9c74c6cf..29e0c98a 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -649,7 +649,7 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera)
>   */
>  void PipelineHandler::hotplugMediaDevice(MediaDevice *media)
>  {
> -	media->disconnected.connect(this, [=]() { mediaDeviceDisconnected(media); });
> +	media->disconnected.connect(this, [this, media] { mediaDeviceDisconnected(media); });
>  }
>  
>  /**

Patch
diff mbox series

diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index 9c74c6cf..29e0c98a 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -649,7 +649,7 @@  void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera)
  */
 void PipelineHandler::hotplugMediaDevice(MediaDevice *media)
 {
-	media->disconnected.connect(this, [=]() { mediaDeviceDisconnected(media); });
+	media->disconnected.connect(this, [this, media] { mediaDeviceDisconnected(media); });
 }
 
 /**