From 97cfe1d8bd1968143e2ba9aa46ebe9504a835e24 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sat, 10 Jun 2017 16:45:06 +0200 Subject: Convert all AVClass struct declarations to designated initializers. --- libavutil/eval.c | 9 ++++++++- libavutil/file.c | 8 ++++++-- libavutil/imgutils.c | 9 ++++++++- libavutil/tests/opt.c | 6 +++--- 4 files changed, 25 insertions(+), 7 deletions(-) (limited to 'libavutil') diff --git a/libavutil/eval.c b/libavutil/eval.c index b5d71c6000..7d7c16e927 100644 --- a/libavutil/eval.c +++ b/libavutil/eval.c @@ -52,7 +52,14 @@ typedef struct Parser { double var[VARS]; } Parser; -static const AVClass class = { "Eval", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(Parser,log_offset), offsetof(Parser,log_ctx) }; +static const AVClass class = { + .class_name = "Eval", + .item_name = av_default_item_name, + .option = NULL, + .version = LIBAVUTIL_VERSION_INT, + .log_level_offset_offset = offsetof(Parser, log_offset), + .parent_log_context_offset = offsetof(Parser, log_ctx), +}; static const int8_t si_prefixes['z' - 'E' + 1] = { ['y'-'E']= -24, diff --git a/libavutil/file.c b/libavutil/file.c index 18a110aeeb..05ed2479a2 100644 --- a/libavutil/file.c +++ b/libavutil/file.c @@ -42,8 +42,12 @@ typedef struct FileLogContext { } FileLogContext; static const AVClass file_log_ctx_class = { - "FILE", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, - offsetof(FileLogContext, log_offset), offsetof(FileLogContext, log_ctx) + .class_name = "FILE", + .item_name = av_default_item_name, + .option = NULL, + .version = LIBAVUTIL_VERSION_INT, + .log_level_offset_offset = offsetof(FileLogContext, log_offset), + .parent_log_context_offset = offsetof(FileLogContext, log_ctx), }; int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index 20d06ec175..84abb11656 100644 --- a/libavutil/imgutils.c +++ b/libavutil/imgutils.c @@ -219,7 +219,14 @@ typedef struct ImgUtils { void *log_ctx; } ImgUtils; -static const AVClass imgutils_class = { "IMGUTILS", av_default_item_name, NULL, LIBAVUTIL_VERSION_INT, offsetof(ImgUtils, log_offset), offsetof(ImgUtils, log_ctx) }; +static const AVClass imgutils_class = { + .class_name = "IMGUTILS", + .item_name = av_default_item_name, + .option = NULL, + .version = LIBAVUTIL_VERSION_INT, + .log_level_offset_offset = offsetof(ImgUtils, log_offset), + .parent_log_context_offset = offsetof(ImgUtils, log_ctx), +}; int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx) { diff --git a/libavutil/tests/opt.c b/libavutil/tests/opt.c index 350ce3d820..9ed9d2b6b1 100644 --- a/libavutil/tests/opt.c +++ b/libavutil/tests/opt.c @@ -59,9 +59,9 @@ static const char *test_get_name(void *ctx) } static const AVClass test_class = { - "TestContext", - test_get_name, - test_options + .class_name = "TestContext", + .item_name = test_get_name, + .option = test_options, }; int main(void) -- cgit v1.2.3