*: Fix clint errors

This commit is contained in:
ZyX
2018-04-22 20:31:40 +03:00
parent 4b41680828
commit 4bab9d34e6
11 changed files with 16 additions and 18 deletions

View File

@@ -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.

View File

@@ -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);

View File

@@ -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;
}

View File

@@ -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)) {

View File

@@ -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 */

View File

@@ -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);

View File

@@ -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???

View File

@@ -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' */

View File

@@ -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]));

View File

@@ -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;

View File

@@ -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);
});
}