History

avcodec/avcodec: remove usage of __typeof__()

It's non-standard C.

James Almer committed 2 years ago

Commit fdf80251 parent b4e91821 file · +7 −7Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/avcodec.c+7−7
@@ -708,9 +708,9 @@ int attribute_align_arg avcodec_receive_frame(AVCodecContext *avctx, AVFrame *fr · 707 unmodified lines
708708 return ff_encode_receive_frame(avctx, frame);
709709 }
710710
711−#define WRAP_CONFIG(allowed_type, field, terminator) \
711+#define WRAP_CONFIG(allowed_type, field, field_type, terminator) \
712712 do { \
713− static const __typeof__(*(field)) end = terminator; \
713+ static const field_type end = terminator; \
714714 if (codec->type != (allowed_type)) \
715715 return AVERROR(EINVAL); \
716716 *out_configs = (field); \
@@ -753,15 +753,15 @@ int ff_default_get_supported_config(const AVCodecContext *avctx, · 36 unmodified lines
753753 switch (config) {
754754 FF_DISABLE_DEPRECATION_WARNINGS
755755 case AV_CODEC_CONFIG_PIX_FORMAT:
756− WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->pix_fmts, AV_PIX_FMT_NONE);
756+ WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->pix_fmts, enum AVPixelFormat, AV_PIX_FMT_NONE);
757757 case AV_CODEC_CONFIG_FRAME_RATE:
758− WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, (AVRational){0});
758+ WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, codec->supported_framerates, AVRational, {0});
759759 case AV_CODEC_CONFIG_SAMPLE_RATE:
760− WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->supported_samplerates, 0);
760+ WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->supported_samplerates, int, 0);
761761 case AV_CODEC_CONFIG_SAMPLE_FORMAT:
762− WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->sample_fmts, AV_SAMPLE_FMT_NONE);
762+ WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->sample_fmts, enum AVSampleFormat, AV_SAMPLE_FMT_NONE);
763763 case AV_CODEC_CONFIG_CHANNEL_LAYOUT:
764− WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, (AVChannelLayout){0});
764+ WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, codec->ch_layouts, AVChannelLayout, {0});
765765 FF_ENABLE_DEPRECATION_WARNINGS
766766
767767 case AV_CODEC_CONFIG_COLOR_RANGE:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t