diff options
author | wm4 <wm4@nowhere> | 2013-03-01 11:21:13 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-03-01 11:21:13 +0100 |
commit | 9180263c4d7174def26d07eb3e91fe4b459d9698 (patch) | |
tree | 186d74c496949241dd7226b5dc43273add7aabf0 /core/options.h | |
parent | fdc1560a0ed31f0c275c47ac8cb7521c0c636ddf (diff) | |
download | mpv-9180263c4d7174def26d07eb3e91fe4b459d9698.tar.bz2 mpv-9180263c4d7174def26d07eb3e91fe4b459d9698.tar.xz |
m_options: more typesafety
Change the option definition macros so that they cause compiler warnings
if the type of the referenced option struct member doesn't match the
type implied by the macro. The compiler warning printed isn't very
telling, but it's better than silently invoking undefined behavior by
violating the C strict aliasing rules.
Also fix some minor cases that violate the type rules. For the option
"no-aspect" we have to add a new option type to handle it properly.
Some option types are hard to check, so we don't in these cases.
Diffstat (limited to 'core/options.h')
-rw-r--r-- | core/options.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/options.h b/core/options.h index f23ff51e44..a5f4c4023b 100644 --- a/core/options.h +++ b/core/options.h @@ -158,9 +158,9 @@ typedef struct MPOpts { } lavc_param; struct lavfdopts { - unsigned int probesize; + int probesize; int probescore; - unsigned int analyzeduration; + int analyzeduration; char *format; char *cryptokey; char *avopt; @@ -169,8 +169,8 @@ typedef struct MPOpts { struct input_conf { char *config_file; int key_fifo_size; - unsigned int ar_delay; - unsigned int ar_rate; + int ar_delay; + int ar_rate; char *js_dev; char *ar_dev; char *in_file; |