summaryrefslogtreecommitdiff
path: root/avprobe.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-08-27 14:07:12 +0300
committerMartin Storsjö <martin@martin.st>2012-08-27 18:59:06 +0300
commitb42be2d56a5abbc8645eac7d4d30f9e3b486dcc0 (patch)
treedd0ab3aa19fdb050289d17110032c247af16b616 /avprobe.c
parentb441a4517be7d399417548738ed8f2671dd0c4ae (diff)
avprobe: Get rid of ugly casts in the options table
This also makes sure the function pointers are stored via the same union member as they are accessed via. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'avprobe.c')
-rw-r--r--avprobe.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/avprobe.c b/avprobe.c
index 00e0ad09e0..cb610d89f9 100644
--- a/avprobe.c
+++ b/avprobe.c
@@ -877,34 +877,35 @@ void show_help_default(const char *opt, const char *arg)
show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM);
}
-static void opt_pretty(void)
+static int opt_pretty(const char *opt, const char *arg)
{
show_value_unit = 1;
use_value_prefix = 1;
use_byte_value_binary_prefix = 1;
use_value_sexagesimal_format = 1;
+ return 0;
}
static const OptionDef real_options[] = {
#include "cmdutils_common_opts.h"
- { "f", HAS_ARG, {(void*)opt_format}, "force format", "format" },
- { "of", HAS_ARG, {(void*)&opt_output_format}, "output the document either as ini or json", "output_format" },
- { "unit", OPT_BOOL, {(void*)&show_value_unit},
+ { "f", HAS_ARG, {.func_arg = opt_format}, "force format", "format" },
+ { "of", HAS_ARG, {.func_arg = opt_output_format}, "output the document either as ini or json", "output_format" },
+ { "unit", OPT_BOOL, {&show_value_unit},
"show unit of the displayed values" },
- { "prefix", OPT_BOOL, {(void*)&use_value_prefix},
+ { "prefix", OPT_BOOL, {&use_value_prefix},
"use SI prefixes for the displayed values" },
- { "byte_binary_prefix", OPT_BOOL, {(void*)&use_byte_value_binary_prefix},
+ { "byte_binary_prefix", OPT_BOOL, {&use_byte_value_binary_prefix},
"use binary prefixes for byte units" },
- { "sexagesimal", OPT_BOOL, {(void*)&use_value_sexagesimal_format},
+ { "sexagesimal", OPT_BOOL, {&use_value_sexagesimal_format},
"use sexagesimal format HOURS:MM:SS.MICROSECONDS for time units" },
- { "pretty", 0, {(void*)&opt_pretty},
+ { "pretty", 0, {.func_arg = opt_pretty},
"prettify the format of displayed values, make it more human readable" },
- { "show_format", OPT_BOOL, {(void*)&do_show_format} , "show format/container info" },
- { "show_format_entry", HAS_ARG, {(void*)opt_show_format_entry},
+ { "show_format", OPT_BOOL, {&do_show_format} , "show format/container info" },
+ { "show_format_entry", HAS_ARG, {.func_arg = opt_show_format_entry},
"show a particular entry from the format/container info", "entry" },
- { "show_packets", OPT_BOOL, {(void*)&do_show_packets}, "show packets info" },
- { "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" },
- { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default},
+ { "show_packets", OPT_BOOL, {&do_show_packets}, "show packets info" },
+ { "show_streams", OPT_BOOL, {&do_show_streams}, "show streams info" },
+ { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg = opt_default},
"generic catch all option", "" },
{ NULL, },
};