m_option: remove unused error code

The situation in the str_list_* functions can never happen, and they
were the only users of this error code.
This commit is contained in:
wm4 2017-07-02 13:52:36 +02:00
parent 1097c1416f
commit d24f4587a7
2 changed files with 1 additions and 9 deletions

View File

@ -67,7 +67,6 @@ char *m_option_strerror(int code)
return "parameter is outside values allowed for option";
case M_OPT_DISALLOW_PARAM:
return "option doesn't take a parameter";
case M_OPT_PARSER_ERR:
default:
return "parser error";
}
@ -1109,8 +1108,6 @@ static void free_str_list(void *dst)
static int str_list_add(char **add, int n, void *dst, int pre)
{
if (!dst)
return M_OPT_PARSER_ERR;
char **lst = VAL(dst);
int ln;
@ -1140,8 +1137,6 @@ static int str_list_del(struct mp_log *log, char **del, int n, void *dst)
int i, ln, s;
long idx;
if (!dst)
return M_OPT_PARSER_ERR;
lst = VAL(dst);
for (ln = 0; lst && lst[ln]; ln++)

View File

@ -458,11 +458,8 @@ struct m_option {
// The option doesn't take a parameter.
#define M_OPT_DISALLOW_PARAM -5
// Returned if the parser failed for any other reason than a bad parameter.
#define M_OPT_PARSER_ERR -6
// Returned when MPlayer should exit. Used by various help stuff.
#define M_OPT_EXIT -7
#define M_OPT_EXIT -6
char *m_option_strerror(int code);