summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpavelxdd <pavel.otchertsov@gmail.com>2017-12-16 02:20:44 +0300
committerpavelxdd <pavel.otchertsov@gmail.com>2017-12-16 02:20:44 +0300
commite1ac0c1eb6be906f434bc5f3e0246b15a6898229 (patch)
tree1b5dad5843a61284eb2a358b60912048f4498b2f
parent7fc9ff54d37aa7def8bf3cf5eb7b86b29722c129 (diff)
downloadmpv-e1ac0c1eb6be906f434bc5f3e0246b15a6898229.tar.bz2
mpv-e1ac0c1eb6be906f434bc5f3e0246b15a6898229.tar.xz
options: rename 'error' labels to 'exit' where appropriate
-rw-r--r--options/m_option.c26
1 files 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));