mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user