[FFmpeg-soc] [soc] libavsequencer [PATCH 01/08] Music module public API header file.

Sebastian Vater cdgs.basty at googlemail.com
Thu Jul 15 21:12:27 CEST 2010


Ronald S. Bultje a écrit :
> Hi,
>
> On Thu, Jul 15, 2010 at 8:28 AM, Sebastian Vater
> <cdgs.basty at googlemail.com> wrote:
>   
>> Vitor Sessak a écrit :
>>     
>>> #define AVSEQ_TRACK_EFFECT_CMD_T_TREMO_ONCE  0x2F
>>> #define AVSEQ_TRACK_EFFECT_CMD_STOP_FX       0x1D
>>>
>>> by
>>>
>>> enum Whatever {
>>>     AVSEQ_TRACK_EFFECT_CMD_T_TREMO_ONCE = 0x2F,
>>>     AVSEQ_TRACK_EFFECT_CMD_STOP_FX      = 0x1D,
>>> }
>>>
>>> breaks?
>>>       
>> I access them like:
>> if (flags & AVSEQ_TRACK_EFFECT_CMD_STOP_FX) { .. }
>>
>> Won't have change that to:
>> if (flags & Whatever.AVSEQ_TRACK_EFFECT_CMD_STOP_FX) { .. }
>>
>> then?
>>     
>
> Only in C++. Not in C. :-).
>
>   

I see, haven read the two replys from Martin and Vitor already. That's
great and saves a lot of time.

Just a question for understanding...what's the advantage of using enum's
then? The only one I see straight away is that there is less space
required (saving 4 characters by replacing '#define ' with '    ').

What's also clear is that is enum is processed as a compile task after
preprocessor stuff.

Sorry, I know that really sounds like a stupid question, but I never
worked with enum's, always did the #define stuff (you know, never change
a running system and such things).

I mean, if you want me to change this, there must actually be a good
reason for this...which one this is? Just for informative tasks...

-- 

Best regards,
                   :-) Basty/CDGS (-:



More information about the FFmpeg-soc mailing list