[libcamera-devel] libipa: camera_sensor_helper: Mark createInstance() with override
diff mbox series

Message ID 20240112100203.3000-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 439cfe7fbd1b854db63900225e526f9a3a4ac08d
Headers show
Series
  • [libcamera-devel] libipa: camera_sensor_helper: Mark createInstance() with override
Related show

Commit Message

Laurent Pinchart Jan. 12, 2024, 10:02 a.m. UTC
The CameraSensorHelperFactory::createInstance() function overrides a
virtual function from CameraSensorHelperFactoryBase. The function
declaration doesn't mark it with the override keyword. This could cause
issues in the future if the base class' function changes, as the
compiler will not issue any warning in that case. Fix it.

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


base-commit: 89227a428a82e724548399d35c98ea89566f9045

Comments

Kieran Bingham Jan. 12, 2024, 10:41 a.m. UTC | #1
Quoting Laurent Pinchart via libcamera-devel (2024-01-12 10:02:03)
> The CameraSensorHelperFactory::createInstance() function overrides a
> virtual function from CameraSensorHelperFactoryBase. The function
> declaration doesn't mark it with the override keyword. This could cause
> issues in the future if the base class' function changes, as the
> compiler will not issue any warning in that case. Fix it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

> ---
>  src/ipa/libipa/camera_sensor_helper.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h
> index 3ea1806cb1fd..1ca9371be6ff 100644
> --- a/src/ipa/libipa/camera_sensor_helper.h
> +++ b/src/ipa/libipa/camera_sensor_helper.h
> @@ -88,7 +88,7 @@ public:
>         }
>  
>  private:
> -       std::unique_ptr<CameraSensorHelper> createInstance() const
> +       std::unique_ptr<CameraSensorHelper> createInstance() const override
>         {
>                 return std::make_unique<_Helper>();
>         }
> 
> base-commit: 89227a428a82e724548399d35c98ea89566f9045
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/src/ipa/libipa/camera_sensor_helper.h b/src/ipa/libipa/camera_sensor_helper.h
index 3ea1806cb1fd..1ca9371be6ff 100644
--- a/src/ipa/libipa/camera_sensor_helper.h
+++ b/src/ipa/libipa/camera_sensor_helper.h
@@ -88,7 +88,7 @@  public:
 	}
 
 private:
-	std::unique_ptr<CameraSensorHelper> createInstance() const
+	std::unique_ptr<CameraSensorHelper> createInstance() const override
 	{
 		return std::make_unique<_Helper>();
 	}