[RFC,v2,1/3] libcamera: device_enumerator_udev: Add `override`
diff mbox series

Message ID 20251208110035.248881-1-barnabas.pocze@ideasonboard.com
State Deferred
Headers show
Series
  • [RFC,v2,1/3] libcamera: device_enumerator_udev: Add `override`
Related show

Commit Message

Barnabás Pőcze Dec. 8, 2025, 11 a.m. UTC
Mark the overridden virtual functions as "override".

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 include/libcamera/internal/device_enumerator_udev.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jacopo Mondi Dec. 11, 2025, 11:58 a.m. UTC | #1
Hi Barnabás

On Mon, Dec 08, 2025 at 12:00:33PM +0100, Barnabás Pőcze wrote:
> Mark the overridden virtual functions as "override".
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  include/libcamera/internal/device_enumerator_udev.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/libcamera/internal/device_enumerator_udev.h b/include/libcamera/internal/device_enumerator_udev.h
> index 1378c1906d..fb0005921a 100644
> --- a/include/libcamera/internal/device_enumerator_udev.h
> +++ b/include/libcamera/internal/device_enumerator_udev.h

Does device_enumerator_sysfs.h deserve the same ?

> @@ -32,8 +32,8 @@ public:
>  	DeviceEnumeratorUdev();
>  	~DeviceEnumeratorUdev();
>
> -	int init();
> -	int enumerate();
> +	int init() override;
> +	int enumerate() override;
>
>  private:
>  	using DependencyMap = std::map<dev_t, std::list<MediaEntity *>>;
> --
> 2.52.0
>
Barnabás Pőcze Dec. 11, 2025, 12:07 p.m. UTC | #2
2025. 12. 11. 12:58 keltezéssel, Jacopo Mondi írta:
> Hi Barnabás
> 
> On Mon, Dec 08, 2025 at 12:00:33PM +0100, Barnabás Pőcze wrote:
>> Mark the overridden virtual functions as "override".
>>
>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>> ---
>>   include/libcamera/internal/device_enumerator_udev.h | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/libcamera/internal/device_enumerator_udev.h b/include/libcamera/internal/device_enumerator_udev.h
>> index 1378c1906d..fb0005921a 100644
>> --- a/include/libcamera/internal/device_enumerator_udev.h
>> +++ b/include/libcamera/internal/device_enumerator_udev.h
> 
> Does device_enumerator_sysfs.h deserve the same ?

Yes But maybe I should drop this change and wait until clang-tidy is enabled
and does the `modernize-use-override` check, which would warn about these cases.


> 
>> @@ -32,8 +32,8 @@ public:
>>   	DeviceEnumeratorUdev();
>>   	~DeviceEnumeratorUdev();
>>
>> -	int init();
>> -	int enumerate();
>> +	int init() override;
>> +	int enumerate() override;
>>
>>   private:
>>   	using DependencyMap = std::map<dev_t, std::list<MediaEntity *>>;
>> --
>> 2.52.0
>>

Patch
diff mbox series

diff --git a/include/libcamera/internal/device_enumerator_udev.h b/include/libcamera/internal/device_enumerator_udev.h
index 1378c1906d..fb0005921a 100644
--- a/include/libcamera/internal/device_enumerator_udev.h
+++ b/include/libcamera/internal/device_enumerator_udev.h
@@ -32,8 +32,8 @@  public:
 	DeviceEnumeratorUdev();
 	~DeviceEnumeratorUdev();
 
-	int init();
-	int enumerate();
+	int init() override;
+	int enumerate() override;
 
 private:
 	using DependencyMap = std::map<dev_t, std::list<MediaEntity *>>;