diff options
author | NRK <nrk@disroot.org> | 2023-06-30 04:10:00 +0600 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-06-30 10:22:15 +0200 |
commit | 0bfafd2451b25d25d3a8249373dc63b5d5e94379 (patch) | |
tree | df8b8bc8cfde08f142c1fbc8553d53548c49aff4 /options/options.c | |
parent | 39957c251cc1d9ee996badbc01b013489f3247f2 (diff) | |
download | mpv-0bfafd2451b25d25d3a8249373dc63b5d5e94379.tar.bz2 mpv-0bfafd2451b25d25d3a8249373dc63b5d5e94379.tar.xz |
options: drop unnecessary casts
the reason for these casts are unknown but they were presumably to
silence warnings 9 years ago. but it doesn't seem to be necessary
nowadays, so just drop the casts and also drop the `const` from the
compound literal type.
some small technical notes:
1. while string literals aren't `const` in C, writing to them is
undefined (do not ask me why). and so compilers will typically put
string literals into read only section anyways, regardless of
weather `const` was used in the source or not. so this shouldn't make
any difference codegen wise.
2. making the array of pointers `const` on the other hand might affect
codegen, eg: `(char *const []){...}`. however, that'd trigger a lot
of discarded qualifier warnings.
Diffstat (limited to 'options/options.c')
-rw-r--r-- | options/options.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/options/options.c b/options/options.c index f20ca99817..955c1e9e32 100644 --- a/options/options.c +++ b/options/options.c @@ -1033,7 +1033,7 @@ static const struct MPOpts mp_default_opts = { [STREAM_VIDEO] = -2, [STREAM_SUB] = -2, }, }, .stream_lang = { - [STREAM_SUB] = (char**)(const char*[]) {"auto", NULL}, + [STREAM_SUB] = (char *[]){ "auto", NULL }, }, .stream_auto_sel = true, .subs_with_matching_audio = false, @@ -1057,7 +1057,7 @@ static const struct MPOpts mp_default_opts = { .mf_fps = 1.0, - .display_tags = (char **)(const char*[]){ + .display_tags = (char *[]){ "Artist", "Album", "Album_Artist", "Comment", "Composer", "Date", "Description", "Genre", "Performer", "Rating", "Series", "Title", "Track", "icy-title", "service_name", @@ -1067,7 +1067,7 @@ static const struct MPOpts mp_default_opts = { .cuda_device = -1, - .watch_later_options = (char **)(const char*[]){ + .watch_later_options = (char *[]){ "start", "osd-level", "speed", |