History

msg: change hack to silence command line pre-parse error messages

mp_msg_levels[] will go away.

wm4 committed 12 years ago

Commit 591a6721 parent 78292053 files · +6 −6Browse files

Showing the changes to options/parse_commandline.c (1 of 3 files). Show all

Unified · Split

options/parse_commandline.c+2−5
@@ -265,8 +265,6 @@ err_out: · 264 unmodified lines
265 return ret;265 return ret;
266}266}
267 267
268extern int mp_msg_levels[];
269
270/* Parse some command line options early before main parsing.268/* Parse some command line options early before main parsing.
271 * --no-config prevents reading configuration files (otherwise done before269 * --no-config prevents reading configuration files (otherwise done before
272 * command line parsing), and --really-quiet suppresses messages printed270 * command line parsing), and --really-quiet suppresses messages printed
@@ -275,8 +273,7 @@ extern int mp_msg_levels[]; · 2 unmodified lines
275void m_config_preparse_command_line(m_config_t *config, int argc, char **argv)273void m_config_preparse_command_line(m_config_t *config, int argc, char **argv)
276{274{
277 // Hack to shut up parser error messages275 // Hack to shut up parser error messages
278 int msg_lvl_backup = mp_msg_levels[MSGT_CFGPARSER];276 mp_msg_mute = true;
279 mp_msg_levels[MSGT_CFGPARSER] = -11;
280 277
281 struct parse_state p = {config, argc, argv};278 struct parse_state p = {config, argc, argv};
282 while (split_opt_silent(&p) == 0) {279 while (split_opt_silent(&p) == 0) {
@@ -290,5 +287,5 @@ void m_config_preparse_command_line(m_config_t *config, int argc, char **argv) · 7 unmodified lines
290 }287 }
291 }288 }
292 289
293 mp_msg_levels[MSGT_CFGPARSER] = msg_lvl_backup;290 mp_msg_mute = false;
294}291}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t