mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
refactor: uncrustify
Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
This commit is contained in:
@@ -973,7 +973,7 @@ int ins_typebuf(char *str, int noremap, int offset, bool nottyped, bool silent)
|
||||
int ins_char_typebuf(int c, int modifiers)
|
||||
{
|
||||
char buf[MB_MAXBYTES * 3 + 4];
|
||||
unsigned int len = special_to_buf(c, modifiers, true, buf);
|
||||
unsigned len = special_to_buf(c, modifiers, true, buf);
|
||||
assert(len < sizeof(buf));
|
||||
buf[len] = NUL;
|
||||
(void)ins_typebuf(buf, KeyNoremap, 0, !KeyTyped, cmd_silent);
|
||||
@@ -1432,7 +1432,7 @@ int vgetc(void)
|
||||
// if peeking records more
|
||||
last_recorded_len -= last_vgetc_recorded_len;
|
||||
|
||||
for (;;) { // this is done twice if there are modifiers
|
||||
while (true) { // this is done twice if there are modifiers
|
||||
bool did_inc = false;
|
||||
if (mod_mask) { // no mapping after modifier has been read
|
||||
no_mapping++;
|
||||
@@ -1670,7 +1670,7 @@ static void getchar_common(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
no_mapping++;
|
||||
allow_keys++;
|
||||
for (;;) {
|
||||
while (true) {
|
||||
if (msg_col > 0) {
|
||||
// Position the cursor. Needed after a message that ends in a space.
|
||||
ui_cursor_goto(msg_row, msg_col);
|
||||
@@ -2363,7 +2363,7 @@ static int vgetorpeek(bool advance)
|
||||
// are sure that it is not a mapped key.
|
||||
// If a mapped key sequence is found we go back to the start to
|
||||
// try re-mapping.
|
||||
for (;;) {
|
||||
while (true) {
|
||||
check_end_reg_executing(advance);
|
||||
// os_breakcheck() is slow, don't use it too often when
|
||||
// inside a mapping. But call it each time for typed
|
||||
@@ -2694,7 +2694,7 @@ static int vgetorpeek(bool advance)
|
||||
typebuf.tb_noremap[typebuf.tb_off + typebuf.tb_len++] = RM_YES;
|
||||
}
|
||||
}
|
||||
} // for (;;)
|
||||
} // while (true)
|
||||
} // if (!character from stuffbuf)
|
||||
|
||||
// if advance is false don't loop on NULs
|
||||
@@ -2813,7 +2813,7 @@ int inchar(uint8_t *buf, int maxlen, long wait_time)
|
||||
#define DUM_LEN (MAXMAPLEN * 3 + 3)
|
||||
uint8_t dum[DUM_LEN + 1];
|
||||
|
||||
for (;;) {
|
||||
while (true) {
|
||||
len = os_inchar(dum, DUM_LEN, 0L, 0, NULL);
|
||||
if (len == 0 || (len == 1 && dum[0] == Ctrl_C)) {
|
||||
break;
|
||||
|
Reference in New Issue
Block a user