mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 02:46:31 +00:00
Use abort() instead of assert(false) for things that should never happen
assert() is compiled out for release builds, but we don't want to continue running in these impossible situations. This also resolves the "implicit fallthrough" warnings for the asserts in switch cases.
This commit is contained in:
@@ -1747,7 +1747,7 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len,
|
||||
goto vim_str2nr_dec;
|
||||
}
|
||||
default: {
|
||||
assert(false);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
} else if ((what & (STR2NR_HEX|STR2NR_OCT|STR2NR_BIN))
|
||||
@@ -1788,7 +1788,7 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len,
|
||||
}
|
||||
|
||||
// Do the string-to-numeric conversion "manually" to avoid sscanf quirks.
|
||||
assert(false); // Should’ve used goto earlier.
|
||||
abort(); // Should’ve used goto earlier.
|
||||
#define PARSE_NUMBER(base, cond, conv) \
|
||||
do { \
|
||||
while (!STRING_ENDED(ptr) && (cond)) { \
|
||||
|
Reference in New Issue
Block a user