[vlc-devel] [vlc-commits] VLCKit: Remove typedef after enum declaration

Rafaël Carré funman at videolan.org
Thu Jun 7 20:38:39 CEST 2012


Le 07/06/2012 14:11, Felix Kühne a écrit :
> On Thu, Jun 7, 2012 at 2:29 AM, Rafaël Carré <funman at videolan.org> wrote:
>> Le 06/06/2012 19:44, Andrey Utkin a écrit :
>>> vlc | branch: master | Andrey Utkin <andrey.krieger.utkin at gmail.com> | Thu Jun  7 01:41:58 2012 +0200| [eeb2dbd78d74421306d88d5c6e0792a40e7fe6f9] | committer: Felix Paul Kühne
>>>
>>> VLCKit: Remove typedef after enum declaration
>>>
>>> Signed-off-by: Felix Paul Kühne <fkuehne at videolan.org>
>>>
>>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eeb2dbd78d74421306d88d5c6e0792a40e7fe6f9
>>
>> In file included from
>> /Users/buildbot/slave/nb-i686-osx-vlckit/build/projects/macosx/framework/Sources/VLCMediaListPlayer.m:27:
>> /Users/buildbot/slave/nb-i686-osx-vlckit/build/projects/macosx/framework/Headers/Public/VLCMediaListPlayer.h:44:5:
>> error: must use 'enum' tag to refer to type 'VLCRepeatMode' [1]
>>     VLCRepeatMode _repeatMode;
>>
>> Untested?
> 
> Thanks for the feedback. This patch shouldn't have been committed by
> my sleepy head last night, since the existing code was and still is
> absolutely correct.

I think it is not correct actually,

VLCRepeatMode is defined both as an enum and as a NSInteger.

I don't know for x86/x86_64 but enums can have a different size
depending on their range, an enum that goes from 0 to 255 only could
have a storage size of char.

I think the fix would be to remove the name from the enum and keep the
typedef.

That way the storage size is always constant, but otoh we lose range
checking (to see if a certain value is defined inside the enum)



More information about the vlc-devel mailing list