diff options
-rw-r--r-- | src/nvim/buffer.c | 4 | ||||
-rw-r--r-- | src/nvim/charset.c | 2 | ||||
-rw-r--r-- | src/nvim/ex_cmds.c | 8 | ||||
-rw-r--r-- | src/nvim/ex_getln.c | 4 | ||||
-rw-r--r-- | src/nvim/fileio.c | 2 | ||||
-rw-r--r-- | src/nvim/ops.c | 1 | ||||
-rw-r--r-- | src/nvim/os/env.c | 4 | ||||
-rw-r--r-- | src/nvim/quickfix.c | 2 | ||||
-rw-r--r-- | src/nvim/screen.c | 2 | ||||
-rw-r--r-- | src/nvim/syntax.c | 2 | ||||
-rw-r--r-- | src/nvim/tui/tui.c | 3 |
11 files changed, 16 insertions, 18 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index a4ba30337d..ba63822837 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2918,7 +2918,7 @@ void maketitle(void) int save_called_emsg = called_emsg; use_sandbox = was_set_insecurely((char_u *)"titlestring", 0); - called_emsg = FALSE; + called_emsg = false; build_stl_str_hl(curwin, (char_u *)buf, sizeof(buf), p_titlestring, use_sandbox, 0, maxlen, NULL, NULL); @@ -3005,7 +3005,7 @@ void maketitle(void) append_arg_number(curwin, (char_u *)buf_p, (int)(SPACE_FOR_ARGNR - (size_t)(buf_p - buf)), false); - strcat(buf_p, " - NVIM"); + xstrlcat(buf_p, " - NVIM", (sizeof(buf) - (size_t)(buf_p - buf))); if (maxlen > 0) { // Make it shorter by removing a bit in the middle. diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 9c1dc9f4a2..7d5f80c531 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -543,7 +543,7 @@ char_u *transchar(int c) // printable character transchar_buf[i] = (char_u)c; transchar_buf[i + 1] = NUL; - } else if (c <= 0xFF){ + } else if (c <= 0xFF) { transchar_nonprint(transchar_buf + i, c); } else { transchar_hex((char *)transchar_buf + i, c); diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index f3b1aa633d..f575d58f05 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -178,10 +178,10 @@ void do_ascii(const exarg_T *const eap) } iobuff_len += utf_char2bytes(c, IObuff + iobuff_len); iobuff_len += ( - vim_snprintf((char *)IObuff + iobuff_len, sizeof(IObuff) - iobuff_len, - (c < 0x10000 - ? _("> %d, Hex %04x, Octal %o") - : _("> %d, Hex %08x, Octal %o")), c, c, c)); + vim_snprintf((char *)IObuff + iobuff_len, sizeof(IObuff) - iobuff_len, + (c < 0x10000 + ? _("> %d, Hex %04x, Octal %o") + : _("> %d, Hex %08x, Octal %o")), c, c, c)); if (ci == MAX_MCO) { break; } diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index a7efe5f533..e1198d6f1c 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -4851,10 +4851,10 @@ void ExpandGeneric( count = 0; for (i = 0;; i++) { str = (*func)(xp, i); - if (str == NULL) { // end of list + if (str == NULL) { // End of list. break; } - if (*str == NUL) { // skip empty strings + if (*str == NUL) { // Skip empty strings. continue; } if (vim_regexec(regmatch, str, (colnr_T)0)) { diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 451f924c28..c34b52cf27 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -286,7 +286,7 @@ readfile ( off_T filesize = 0; int skip_read = false; context_sha256_T sha_ctx; - int read_undo_file = FALSE; + int read_undo_file = false; linenr_T linecnt; int error = FALSE; /* errors encountered */ int ff_error = EOL_UNKNOWN; /* file format with errors */ diff --git a/src/nvim/ops.c b/src/nvim/ops.c index c4790653b8..b39b139f9b 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -3595,7 +3595,6 @@ int do_join(size_t count, // We don't want to remove the comment leader if the // previous line is not a comment. if (t > 0 && prev_was_comment) { - char_u *new_curr = skip_comment(curr, true, insert_space, &prev_was_comment); comments[t] = (int)(new_curr - curr); diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c index 096a90cb21..7fb4a93b54 100644 --- a/src/nvim/os/env.c +++ b/src/nvim/os/env.c @@ -822,11 +822,11 @@ size_t home_replace(const buf_T *const buf, const char_u *src, // if (!one) skip to separator: space or comma. while (*src && (one || (*src != ',' && *src != ' ')) && --dstlen > 0) { - *dst_p++ = (char)*src++; + *dst_p++ = (char)(*src++); } // Skip separator. while ((*src == ' ' || *src == ',') && --dstlen > 0) { - *dst_p++ = (char)*src++; + *dst_p++ = (char)(*src++); } } // If (dstlen == 0) out of space, what to do??? diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index cbab8eb05b..fb7a9ecf5f 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -4738,7 +4738,7 @@ void ex_helpgrep(exarg_T *eap) regmatch.regprog = vim_regcomp(eap->arg, RE_MAGIC + RE_STRING); regmatch.rm_ic = FALSE; if (regmatch.regprog != NULL) { - /* create a new quickfix list */ + // Create a new quickfix list. qf_new_list(qi, *eap->cmdlinep); /* Go through all directories in 'runtimepath' */ diff --git a/src/nvim/screen.c b/src/nvim/screen.c index 8f2b7b1f04..6dbba30cf2 100644 --- a/src/nvim/screen.c +++ b/src/nvim/screen.c @@ -6367,7 +6367,7 @@ static void linecopy(int to, int from, win_T *wp) wp->w_width * sizeof(ScreenLines[0])); memmove(ScreenLinesUC + off_to, ScreenLinesUC + off_from, - wp->w_width * sizeof(u8char_T)); + wp->w_width * sizeof(ScreenLinesUC[0])); for (int i = 0; i < p_mco; i++) { memmove(ScreenLinesC[i] + off_to, ScreenLinesC[i] + off_from, wp->w_width * sizeof(ScreenLinesC[0])); diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index e229a1f428..55992f8785 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -4561,7 +4561,7 @@ syn_cmd_region ( item = ITEM_END; } else if (STRCMP(key, "SKIP") == 0) { if (pat_ptrs[ITEM_SKIP] != NULL) { // One skip pattern allowed. - illegal = TRUE; + illegal = true; break; } item = ITEM_SKIP; diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index 57c7e29c1e..87f3cc2354 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -605,8 +605,7 @@ static void cursor_goto(UI *ui, int row, int col) int n = col - grid->col; if (n <= (row == grid->row ? 4 : 2) && cheap_to_print(ui, grid->row, grid->col, n)) { - UGRID_FOREACH_CELL(grid, grid->row, grid->row, - grid->col, col - 1, { + UGRID_FOREACH_CELL(grid, grid->row, grid->row, grid->col, col - 1, { print_cell(ui, cell); }); } |