diff options
author | Timothy Gu <timothygu99@gmail.com> | 2015-11-21 07:48:06 +0300 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2015-11-24 05:30:25 +0300 |
commit | 7c91b3021c7af9bea6b65f51d645f7574a883870 (patch) | |
tree | c9490dd9d6f8544a08fec2b1535f526ac4e09b53 | |
parent | e4bfc726cd9c68c6ad3b8f5d9633f32ae2d6a943 (diff) |
imgutils: Use designated initializers for AVClass
More readable and less breakable.
-rw-r--r-- | libavutil/imgutils.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index 8956ae31ec..783fdb4176 100644 --- a/libavutil/imgutils.c +++ b/libavutil/imgutils.c @@ -236,11 +236,21 @@ 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, + .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) { - ImgUtils imgutils = { &imgutils_class, log_offset, log_ctx }; + ImgUtils imgutils = { + .class = &imgutils_class, + .log_offset = log_offset, + .log_ctx = log_ctx, + }; if ((int)w>0 && (int)h>0 && (w+128)*(uint64_t)(h+128) < INT_MAX/8) return 0; |