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

@@ -87,10 +87,12 @@ typedef struct insert_state {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "edit.c.generated.h"
#endif
#define BACKSPACE_CHAR 1
#define BACKSPACE_WORD 2
#define BACKSPACE_WORD_NOT_SPACE 3
#define BACKSPACE_LINE 4
enum {
BACKSPACE_CHAR = 1,
BACKSPACE_WORD = 2,
BACKSPACE_WORD_NOT_SPACE = 3,
BACKSPACE_LINE = 4,
};
/// Set when doing something for completion that may call edit() recursively,
/// which is not allowed.
@@ -1227,9 +1229,8 @@ bool edit(int cmdchar, bool startln, long count)
restart_edit = 'i';
force_restart_edit = true;
return false;
} else {
return terminal_enter();
}
return terminal_enter();
}
// Don't allow inserting in the sandbox.