mirror of
https://github.com/neovim/neovim.git
synced 2025-10-01 07:28:34 +00:00
refactor: replace char_u
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -1400,7 +1400,7 @@ int do_set(char *arg, int opt_flags)
|
||||
*/
|
||||
else if (varp == (char_u *)&p_bs
|
||||
&& ascii_isdigit(**(char_u **)varp)) {
|
||||
i = getdigits_int((char_u **)varp, true, 0);
|
||||
i = getdigits_int((char **)varp, true, 0);
|
||||
switch (i) {
|
||||
case 0:
|
||||
*(char_u **)varp = empty_option;
|
||||
@@ -1435,7 +1435,7 @@ int do_set(char *arg, int opt_flags)
|
||||
else if (varp == (char_u *)&p_ww
|
||||
&& ascii_isdigit(*arg)) {
|
||||
*errbuf = NUL;
|
||||
i = getdigits_int((char_u **)&arg, true, 0);
|
||||
i = getdigits_int(&arg, true, 0);
|
||||
if (i & 1) {
|
||||
STRLCAT(errbuf, "b,", sizeof(errbuf));
|
||||
}
|
||||
@@ -1728,7 +1728,7 @@ skip:
|
||||
IObuff[i + ((char_u *)arg - startarg)] = NUL;
|
||||
}
|
||||
// make sure all characters are printable
|
||||
trans_characters(IObuff, IOSIZE);
|
||||
trans_characters((char *)IObuff, IOSIZE);
|
||||
|
||||
no_wait_return++; // wait_return done later
|
||||
emsg((char *)IObuff); // show error highlighted
|
||||
@@ -2941,7 +2941,7 @@ ambw_end:
|
||||
if (*++s == '-') { // ignore a '-'
|
||||
s++;
|
||||
}
|
||||
wid = getdigits_int(&s, true, 0);
|
||||
wid = getdigits_int((char **)&s, true, 0);
|
||||
if (wid && *s == '(' && (errmsg = check_stl_option((char *)p_ruf)) == NULL) {
|
||||
ru_wid = wid;
|
||||
} else {
|
||||
@@ -3457,7 +3457,7 @@ char *check_colorcolumn(win_T *wp)
|
||||
if (!ascii_isdigit(*s)) {
|
||||
return e_invarg;
|
||||
}
|
||||
col = col * getdigits_int(&s, true, 0);
|
||||
col = col * getdigits_int((char **)&s, true, 0);
|
||||
if (wp->w_buffer->b_p_tw == 0) {
|
||||
goto skip; // 'textwidth' not set, skip this item
|
||||
}
|
||||
@@ -3472,7 +3472,7 @@ char *check_colorcolumn(win_T *wp)
|
||||
goto skip;
|
||||
}
|
||||
} else if (ascii_isdigit(*s)) {
|
||||
col = getdigits_int(&s, true, 0);
|
||||
col = getdigits_int((char **)&s, true, 0);
|
||||
} else {
|
||||
return e_invarg;
|
||||
}
|
||||
@@ -5650,7 +5650,7 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, uint6
|
||||
if (fprintf(fd, "%s %s+=", cmd, name) < 0) {
|
||||
goto fail;
|
||||
}
|
||||
(void)copy_option_part(&p, part, size, ",");
|
||||
(void)copy_option_part((char **)&p, (char *)part, size, ",");
|
||||
if (put_escstr(fd, part, 2) == FAIL || put_eol(fd) == FAIL) {
|
||||
goto fail;
|
||||
}
|
||||
@@ -6921,7 +6921,7 @@ int ExpandSettings(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***
|
||||
if (xp->xp_context != EXPAND_BOOL_SETTINGS) {
|
||||
for (match = 0; match < (int)ARRAY_SIZE(names);
|
||||
match++) {
|
||||
if (vim_regexec(regmatch, (char_u *)names[match], (colnr_T)0)) {
|
||||
if (vim_regexec(regmatch, names[match], (colnr_T)0)) {
|
||||
if (loop == 0) {
|
||||
num_normal++;
|
||||
} else {
|
||||
@@ -6940,10 +6940,10 @@ int ExpandSettings(expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***
|
||||
continue;
|
||||
}
|
||||
match = false;
|
||||
if (vim_regexec(regmatch, str, (colnr_T)0)
|
||||
if (vim_regexec(regmatch, (char *)str, (colnr_T)0)
|
||||
|| (options[opt_idx].shortname != NULL
|
||||
&& vim_regexec(regmatch,
|
||||
(char_u *)options[opt_idx].shortname,
|
||||
options[opt_idx].shortname,
|
||||
(colnr_T)0))) {
|
||||
match = true;
|
||||
}
|
||||
@@ -7460,7 +7460,7 @@ void save_file_ff(buf_T *buf)
|
||||
if (buf->b_start_fenc == NULL
|
||||
|| STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0) {
|
||||
xfree(buf->b_start_fenc);
|
||||
buf->b_start_fenc = vim_strsave(buf->b_p_fenc);
|
||||
buf->b_start_fenc = (char *)vim_strsave(buf->b_p_fenc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7827,10 +7827,10 @@ static bool briopt_check(win_T *wp)
|
||||
if (STRNCMP(p, "shift:", 6) == 0
|
||||
&& ((p[6] == '-' && ascii_isdigit(p[7])) || ascii_isdigit(p[6]))) {
|
||||
p += 6;
|
||||
bri_shift = getdigits_int(&p, true, 0);
|
||||
bri_shift = getdigits_int((char **)&p, true, 0);
|
||||
} else if (STRNCMP(p, "min:", 4) == 0 && ascii_isdigit(p[4])) {
|
||||
p += 4;
|
||||
bri_min = getdigits_int(&p, true, 0);
|
||||
bri_min = getdigits_int((char **)&p, true, 0);
|
||||
} else if (STRNCMP(p, "sbr", 3) == 0) {
|
||||
p += 3;
|
||||
bri_sbr = true;
|
||||
@@ -7991,10 +7991,10 @@ char_u *skip_to_option_part(const char_u *p)
|
||||
/// @param[in] sep_chars chars that separate the option parts
|
||||
///
|
||||
/// @return length of `*option`
|
||||
size_t copy_option_part(char_u **option, char_u *buf, size_t maxlen, char *sep_chars)
|
||||
size_t copy_option_part(char **option, char *buf, size_t maxlen, char *sep_chars)
|
||||
{
|
||||
size_t len = 0;
|
||||
char_u *p = *option;
|
||||
char *p = *option;
|
||||
|
||||
// skip '.' at start of option part, for 'suffixes'
|
||||
if (*p == '.') {
|
||||
@@ -8015,7 +8015,7 @@ size_t copy_option_part(char_u **option, char_u *buf, size_t maxlen, char *sep_c
|
||||
if (*p != NUL && *p != ',') { // skip non-standard separator
|
||||
p++;
|
||||
}
|
||||
p = skip_to_option_part(p); // p points to next file name
|
||||
p = (char *)skip_to_option_part((char_u *)p); // p points to next file name
|
||||
|
||||
*option = p;
|
||||
return len;
|
||||
|
Reference in New Issue
Block a user