mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
39957c251c
commit
0bfafd2451
|
@ -1033,7 +1033,7 @@ static const struct MPOpts mp_default_opts = {
|
||||||
[STREAM_VIDEO] = -2,
|
[STREAM_VIDEO] = -2,
|
||||||
[STREAM_SUB] = -2, }, },
|
[STREAM_SUB] = -2, }, },
|
||||||
.stream_lang = {
|
.stream_lang = {
|
||||||
[STREAM_SUB] = (char**)(const char*[]) {"auto", NULL},
|
[STREAM_SUB] = (char *[]){ "auto", NULL },
|
||||||
},
|
},
|
||||||
.stream_auto_sel = true,
|
.stream_auto_sel = true,
|
||||||
.subs_with_matching_audio = false,
|
.subs_with_matching_audio = false,
|
||||||
|
@ -1057,7 +1057,7 @@ static const struct MPOpts mp_default_opts = {
|
||||||
|
|
||||||
.mf_fps = 1.0,
|
.mf_fps = 1.0,
|
||||||
|
|
||||||
.display_tags = (char **)(const char*[]){
|
.display_tags = (char *[]){
|
||||||
"Artist", "Album", "Album_Artist", "Comment", "Composer",
|
"Artist", "Album", "Album_Artist", "Comment", "Composer",
|
||||||
"Date", "Description", "Genre", "Performer", "Rating",
|
"Date", "Description", "Genre", "Performer", "Rating",
|
||||||
"Series", "Title", "Track", "icy-title", "service_name",
|
"Series", "Title", "Track", "icy-title", "service_name",
|
||||||
|
@ -1067,7 +1067,7 @@ static const struct MPOpts mp_default_opts = {
|
||||||
|
|
||||||
.cuda_device = -1,
|
.cuda_device = -1,
|
||||||
|
|
||||||
.watch_later_options = (char **)(const char*[]){
|
.watch_later_options = (char *[]){
|
||||||
"start",
|
"start",
|
||||||
"osd-level",
|
"osd-level",
|
||||||
"speed",
|
"speed",
|
||||||
|
|
Loading…
Reference in New Issue