refactor: fix clang-tidy warnings

Enable and fix bugprone-misplaced-widening-cast warning.

Fix some modernize-macro-to-enum and readability-else-after-return
warnings, but don't enable them. While the warnings can be useful, they
are in general too noisy to enable.
This commit is contained in:
dundargoc
2022-10-22 12:36:38 +02:00
parent a79d28e4d7
commit 731cdde28e
56 changed files with 558 additions and 555 deletions

View File

@@ -110,15 +110,14 @@ Window nvim_tabpage_get_win(Tabpage tabpage, Error *err)
if (tab == curtab) {
return nvim_get_current_win();
} else {
FOR_ALL_WINDOWS_IN_TAB(wp, tab) {
if (wp == tab->tp_curwin) {
return wp->handle;
}
}
// There should always be a current window for a tabpage
abort();
}
FOR_ALL_WINDOWS_IN_TAB(wp, tab) {
if (wp == tab->tp_curwin) {
return wp->handle;
}
}
// There should always be a current window for a tabpage
abort();
}
/// Gets the tabpage number