various: replace abort() with MP_ASSERT_UNREACHABLE() where appropriate

In debug mode the macro causes an assertion failure.
In release mode it works differently and tells the compiler that it can
assume the codepath will never execute. For this reason I was conversative
in replacing it, e.g. in mpv-internal code that exhausts all valid values
of an enum or when a condition is clear from directly preceding code.
This commit is contained in:
sfan5
2023-01-10 19:26:51 +01:00
parent 7b03cd367d
commit 1201d59f0b
21 changed files with 35 additions and 35 deletions

View File

@@ -429,7 +429,7 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target,
uint32_t, num_elems[i]);
break;
default:
abort();
MP_ASSERT_UNREACHABLE();
}
}
}
@@ -582,7 +582,7 @@ static void ebml_parse_element(struct ebml_parse_ctx *ctx, void *target,
MP_TRACE(ctx, "ebml_id %x\n", (unsigned)*idptr);
break;
default:
abort();
MP_ASSERT_UNREACHABLE();
}
*countptr += 1;
error: