[vlc-devel] [PATCH] object: Pass a non const pointer to vlc_object_get_name

Hugo Beauzée-Luyssen hugo at beauzee.fr
Thu Sep 15 09:11:09 CEST 2016


On 09/15/2016 08:29 AM, Steve Lhomme wrote:
> Why ? The content of the object is not modified.
> If anything vlc_object_internals_t *priv should be const.
>
> On Wed, Sep 14, 2016 at 6:30 PM, Hugo Beauzée-Luyssen <hugo at beauzee.fr> wrote:
>> ---
>>  include/vlc_objects.h | 2 +-
>>  src/misc/objects.c    | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/vlc_objects.h b/include/vlc_objects.h
>> index 12f754a..605a4e0 100644
>> --- a/include/vlc_objects.h
>> +++ b/include/vlc_objects.h
>> @@ -52,7 +52,7 @@ VLC_API void * vlc_object_hold( vlc_object_t * );
>>  VLC_API void vlc_object_release( vlc_object_t * );
>>  VLC_API vlc_list_t *vlc_list_children( vlc_object_t * ) VLC_USED;
>>  VLC_API void vlc_list_release( vlc_list_t * );
>> -VLC_API char *vlc_object_get_name( const vlc_object_t * ) VLC_USED;
>> +VLC_API char *vlc_object_get_name( vlc_object_t * ) VLC_USED;
>>  #define vlc_object_get_name(o) vlc_object_get_name(VLC_OBJECT(o))
>>
>>  #define vlc_object_create(a,b) vlc_object_create( VLC_OBJECT(a), b )
>> diff --git a/src/misc/objects.c b/src/misc/objects.c
>> index 3ed5271..e899c48 100644
>> --- a/src/misc/objects.c
>> +++ b/src/misc/objects.c
>> @@ -294,7 +294,7 @@ int vlc_object_set_name(vlc_object_t *obj, const char *name)
>>  }
>>
>>  #undef vlc_object_get_name
>> -char *vlc_object_get_name(const vlc_object_t *obj)
>> +char *vlc_object_get_name(vlc_object_t *obj)
>>  {
>>      vlc_object_internals_t *priv = vlc_internals(obj);
>>      char *name;
>> --
>> 2.9.3
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
That was based on Rémi's comment about vlc_object_t being expected as a 
non-const object. But since the other patch was pushed, consider this 
patch as irrelevant.


More information about the vlc-devel mailing list