OSDN Git Service

opt-test: Merge struct declaration and initialization
authorDiego Biurrun <diego@biurrun.de>
Mon, 21 Mar 2016 18:27:49 +0000 (19:27 +0100)
committerDiego Biurrun <diego@biurrun.de>
Wed, 23 Mar 2016 09:14:43 +0000 (10:14 +0100)
libavutil/opt.c

index 168d3dc..f2e3e6d 100644 (file)
@@ -801,7 +801,7 @@ static const AVClass test_class = {
 int main(void)
 {
     int i;
-    TestContext test_ctx;
+    TestContext test_ctx = { .class = &test_class };
     const char *options[] = {
         "",
         ":",
@@ -824,8 +824,6 @@ int main(void)
         "rational=-1/0",
     };
 
-    test_ctx.class = &test_class;
-
     printf("\nTesting av_set_options_string()\n");
 
     av_opt_set_defaults(&test_ctx);