[vlc-devel] [PATCH 3/3] core: respect ODR for access_sys_t

Rémi Denis-Courmont remi at remlab.net
Tue Apr 24 13:07:02 CEST 2018


Le 24 avril 2018 12:59:57 GMT+03:00, Marvin Scholz <epirat07 at gmail.com> a écrit :
>
>
>On 24 Apr 2018, at 11:56, Jean-Baptiste Kempf wrote:
>
>> On Tue, 24 Apr 2018, at 11:53, Steve Lhomme wrote:
>>> Le 24/04/2018 à 11:23, Romain Vimont a écrit :
>>>
>>>> On Mon, Apr 23, 2018 at 03:40:00PM +0300, Rémi Denis-Courmont
>wrote:
>>>>
>>>>> And I would separate patches converting to void, from namespacing
>>>>> patches.
>>>>>
>>>> You're right. I just did that.
>>>>>
>>> What I don't understand is if the problem is only for C++ why do we
>>> force a void* on C parts of the code as well.>
>>>  Can't we just #ifdef __cplusplus these changes ? And keep the
>>>  xxx_sys_t for C ?
>> Technically, we could, but I don't think it is a good idea. Too
>messy.
>
>IMO it being void* is better as it allows to simplify things in some
>cases,
>if not forced to use a struct.
>
>And just using void* in a specific case (C++) would be very confusing.
>
>>
>> -- 
>> Jean-Baptiste Kempf -  President
>> +33 672 704 734
>>
>>
>>
>> _______________________________________________
>> 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

Yes. Opaque data in C is represented by void pointers. Using anything else is an ugly hack.

It makes even more sense to use void * in C, where it is norm, than in C++, where it is a contingency.
-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


More information about the vlc-devel mailing list