[FFmpeg-devel] [PATCH 2/4] Remove final semicolon from some macros

Ronald S. Bultje rsbultje
Thu Feb 10 22:01:33 CET 2011


Hi,

On Thu, Feb 10, 2011 at 9:18 AM, Vladimir Pantelic <vladoman at gmail.com> wrote:
> Mans Rullgard wrote:
>>
>> This avoids double semicolons after macro expansion.
>>
>> Signed-off-by: Mans Rullgard<mans at mansr.com>
>> ---
>> ?libavcodec/adpcm.c ? ? ? | ? ?6 +++---
>> ?libavcodec/dpcm.c ? ? ? ?| ? ?2 +-
>> ?libavcodec/pcm.c ? ? ? ? | ? ?6 +++---
>> ?libavformat/rdt.c ? ? ? ?| ? ?2 +-
>> ?libavformat/rtpdec_asf.c | ? ?2 +-
>> ?libavformat/rtpdec_qt.c ?| ? ?2 +-
>> ?6 files changed, 10 insertions(+), 10 deletions(-)
>>
>> diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
>> index fb5bdc7..826c588 100644
>> --- a/libavcodec/adpcm.c
>> +++ b/libavcodec/adpcm.c
>> @@ -1719,7 +1719,7 @@ AVCodec ff_ ## name ## _encoder = { ? ? ? ? ? ? \
>> ? ? ?NULL, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
>> ? ? ?.sample_fmts = (const enum
>> AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, \
>> ? ? ?.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
>> -};
>> +}
>> ?#else
>> ?#define ADPCM_ENCODER(id,name,long_name_)
>> ?#endif
>> @@ -1736,13 +1736,13 @@ AVCodec ff_ ## name ## _decoder = { ? ? ? ? ? ? \
>> ? ? ?NULL, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
>> ? ? ?adpcm_decode_frame, ? ? ? ? ? ? ? ? ? ? ? ? \
>> ? ? ?.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
>> -};
>> +}
>> ?#else
>> ?#define ADPCM_DECODER(id,name,long_name_)
>> ?#endif
>>
>> ?#define ADPCM_CODEC(id,name,long_name_) ? ? ? ? \
>> - ? ?ADPCM_ENCODER(id,name,long_name_) ADPCM_DECODER(id,name,long_name_)
>> + ? ?ADPCM_ENCODER(id,name,long_name_); ADPCM_DECODER(id,name,long_name_)
>>
>> ?/* Note: Do not forget to add new entries to the Makefile as well. */
>> ?ADPCM_DECODER(CODEC_ID_ADPCM_4XM, adpcm_4xm, "ADPCM 4X Movie");
>> diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
>> index 6053a14..ee8eb6a 100644
>> --- a/libavcodec/dpcm.c
>> +++ b/libavcodec/dpcm.c
>> @@ -309,7 +309,7 @@ AVCodec ff_ ## name ## _decoder = { ? ? ? ? ? ? \
>> ? ? ?NULL, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
>> ? ? ?dpcm_decode_frame, ? ? ? ? ? ? ? ? ? ? ? ? ?\
>> ? ? ?.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
>> -};
>> +}
>>
>> ?DPCM_DECODER(CODEC_ID_INTERPLAY_DPCM, interplay_dpcm, "DPCM Interplay");
>> ?DPCM_DECODER(CODEC_ID_ROQ_DPCM, roq_dpcm, "DPCM id RoQ");
>> diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c
>> index 0785a9d..cdc11f8 100644
>> --- a/libavcodec/pcm.c
>> +++ b/libavcodec/pcm.c
>> @@ -482,7 +482,7 @@ AVCodec ff_ ## name_ ## _encoder = { ? ? ? ? ? ?\
>> ? ? ?.close ? ? ? = pcm_encode_close, ? ? ? ? ? ?\
>> ? ? ?.sample_fmts = (const enum
>> AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
>> ? ? ?.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
>> -};
>> +}
>> ?#else
>> ?#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
>> ?#endif
>> @@ -498,13 +498,13 @@ AVCodec ff_ ## name_ ## _decoder = { ? ? ? ? ? ?\
>> ? ? ?.decode ? ? ? ? = pcm_decode_frame, ? ? ? ? \
>> ? ? ?.sample_fmts = (const enum
>> AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
>> ? ? ?.long_name = NULL_IF_CONFIG_SMALL(long_name_), \
>> -};
>> +}
>> ?#else
>> ?#define PCM_DECODER(id,sample_fmt_,name,long_name_)
>> ?#endif
>>
>> ?#define PCM_CODEC(id, sample_fmt_, name, long_name_) ? ? ? ? \
>> - ? ?PCM_ENCODER(id,sample_fmt_,name,long_name_)
>> PCM_DECODER(id,sample_fmt_,name,long_name_)
>> + ? ?PCM_ENCODER(id,sample_fmt_,name,long_name_);
>> PCM_DECODER(id,sample_fmt_,name,long_name_)
>>
>> ?/* Note: Do not forget to add new entries to the Makefile as well. */
>> ?PCM_CODEC ?(CODEC_ID_PCM_ALAW, ?AV_SAMPLE_FMT_S16, pcm_alaw, "PCM
>> A-law");
>> diff --git a/libavformat/rdt.c b/libavformat/rdt.c
>> index 3428b4d..bb7f278 100644
>> --- a/libavformat/rdt.c
>> +++ b/libavformat/rdt.c
>> @@ -559,7 +559,7 @@ static RTPDynamicProtocolHandler ff_rdt_ ## n ##
>> _handler = { \
>> ? ? ?.open ? ? ? ? ? ? = rdt_new_context, \
>> ? ? ?.close ? ? ? ? ? ?= rdt_free_context, \
>> ? ? ?.parse_packet ? ? = rdt_parse_packet \
>> -};
>> +}
>>
>> ?RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live",
>> AVMEDIA_TYPE_VIDEO);
>> ?RDT_HANDLER(live_audio, "x-pn-multirate-realaudio-live",
>> AVMEDIA_TYPE_AUDIO);
>> diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c
>> index db09f8f..5d52765 100644
>> --- a/libavformat/rtpdec_asf.c
>> +++ b/libavformat/rtpdec_asf.c
>> @@ -288,7 +288,7 @@ RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler
>> = { \
>> ? ? ?.open ? ? ? ? ? ? = asfrtp_new_context, \
>> ? ? ?.close ? ? ? ? ? ?= asfrtp_free_context, \
>> ? ? ?.parse_packet ? ? = asfrtp_parse_packet, ? \
>> -};
>> +}
>>
>> ?RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", ?AVMEDIA_TYPE_VIDEO);
>> ?RTP_ASF_HANDLER(asf_pfa, "x-asf-pf", ?AVMEDIA_TYPE_AUDIO);
>> diff --git a/libavformat/rtpdec_qt.c b/libavformat/rtpdec_qt.c
>> index 28460a7..a1853ef 100644
>> --- a/libavformat/rtpdec_qt.c
>> +++ b/libavformat/rtpdec_qt.c
>> @@ -246,7 +246,7 @@ RTPDynamicProtocolHandler ff_ ## m ## _rtp_ ## n ##
>> _handler = { \
>> ? ? ?.open ? ? ? ? ? ? = qt_rtp_new, ? ?\
>> ? ? ?.close ? ? ? ? ? ?= qt_rtp_free, ? \
>> ? ? ?.parse_packet ? ? = qt_rtp_parse_packet, \
>> -};
>> +}
>>
>> ?RTP_QT_HANDLER(qt, ? ? ? ?vid, "X-QT", ? ? ? ?AVMEDIA_TYPE_VIDEO);
>> ?RTP_QT_HANDLER(qt, ? ? ? ?aud, "X-QT", ? ? ? ?AVMEDIA_TYPE_AUDIO);
>
> LGTM :)

Indeed, same here.

Ronald



More information about the ffmpeg-devel mailing list