From e1ac0c1eb6be906f434bc5f3e0246b15a6898229 Mon Sep 17 00:00:00 2001 From: pavelxdd Date: Sat, 16 Dec 2017 02:20:44 +0300 Subject: options: rename 'error' labels to 'exit' where appropriate --- options/m_option.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/options/m_option.c b/options/m_option.c index b03ad014b8..08f57f89c7 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -1748,7 +1748,7 @@ static int parse_color(struct mp_log *log, const m_option_t *opt, bool is_help = bstr_equals0(param, "help"); if (is_help) - goto error; + goto exit; bstr val = param; struct m_color color = {0}; @@ -1756,11 +1756,11 @@ static int parse_color(struct mp_log *log, const m_option_t *opt, if (bstr_eatstart0(&val, "#")) { // #[AA]RRGGBB if (val.len != 6 && val.len != 8) - goto error; + goto exit; bool has_alpha = val.len == 8; uint32_t c = bstrtoll(val, &val, 16); if (val.len) - goto error; + goto exit; color = (struct m_color) { (c >> 16) & 0xFF, (c >> 8) & 0xFF, @@ -1771,13 +1771,13 @@ static int parse_color(struct mp_log *log, const m_option_t *opt, bstr comp_str[5]; int num = split_char(param, '/', 5, comp_str); if (num < 1 || num > 4) - goto error; + goto exit; double comp[4] = {0, 0, 0, 1}; for (int n = 0; n < num; n++) { bstr rest; double d = bstrtod(comp_str[n], &rest); if (rest.len || !comp_str[n].len || d < 0 || d > 1 || !isfinite(d)) - goto error; + goto exit; comp[n] = d; } if (num == 2) @@ -1793,7 +1793,7 @@ static int parse_color(struct mp_log *log, const m_option_t *opt, return 1; -error: +exit: if (!is_help) { mp_err(log, "Option %.*s: invalid color: '%.*s'\n", BSTR_P(name), BSTR_P(param)); @@ -1964,18 +1964,18 @@ static int parse_geometry(struct mp_log *log, const m_option_t *opt, { bool is_help = bstr_equals0(param, "help"); if (is_help) - goto error; + goto exit; struct m_geometry gm; if (!parse_geometry_str(&gm, param)) - goto error; + goto exit; if (dst) *((struct m_geometry *)dst) = gm; return 1; -error: +exit: if (!is_help) { mp_err(log, "Option %.*s: invalid geometry: '%.*s'\n", BSTR_P(name), BSTR_P(param)); @@ -1998,21 +1998,21 @@ static int parse_size_box(struct mp_log *log, const m_option_t *opt, { bool is_help = bstr_equals0(param, "help"); if (is_help) - goto error; + goto exit; struct m_geometry gm; if (!parse_geometry_str(&gm, param)) - goto error; + goto exit; if (gm.xy_valid) - goto error; + goto exit; if (dst) *((struct m_geometry *)dst) = gm; return 1; -error: +exit: if (!is_help) { mp_err(log, "Option %.*s: invalid size: '%.*s'\n", BSTR_P(name), BSTR_P(param)); -- cgit v1.2.3