mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
This commit is contained in:
@@ -539,7 +539,7 @@ static char *find_dup_item(char *origval, const char *newval, uint32_t flags)
|
||||
const size_t newlen = strlen(newval);
|
||||
for (char *s = origval; *s != NUL; s++) {
|
||||
if ((!(flags & P_COMMA) || s == origval || (s[-1] == ',' && !(bs & 1)))
|
||||
&& STRNCMP(s, newval, newlen) == 0
|
||||
&& strncmp(s, newval, newlen) == 0
|
||||
&& (!(flags & P_COMMA) || s[newlen] == ',' || s[newlen] == NUL)) {
|
||||
return s;
|
||||
}
|
||||
@@ -1144,7 +1144,7 @@ int do_set(char *arg, int opt_flags)
|
||||
errmsg = NULL;
|
||||
startarg = arg; // remember for error message
|
||||
|
||||
if (STRNCMP(arg, "all", 3) == 0 && !isalpha(arg[3])
|
||||
if (strncmp(arg, "all", 3) == 0 && !isalpha(arg[3])
|
||||
&& !(opt_flags & OPT_MODELINE)) {
|
||||
// ":set all" show all options.
|
||||
// ":set all&" set all options to their default value.
|
||||
@@ -1163,10 +1163,10 @@ int do_set(char *arg, int opt_flags)
|
||||
}
|
||||
} else {
|
||||
prefix = 1;
|
||||
if (STRNCMP(arg, "no", 2) == 0) {
|
||||
if (strncmp(arg, "no", 2) == 0) {
|
||||
prefix = 0;
|
||||
arg += 2;
|
||||
} else if (STRNCMP(arg, "inv", 3) == 0) {
|
||||
} else if (strncmp(arg, "inv", 3) == 0) {
|
||||
prefix = 2;
|
||||
arg += 3;
|
||||
}
|
||||
@@ -2714,7 +2714,7 @@ int findoption_len(const char *const arg, const size_t len)
|
||||
opt_idx = -1;
|
||||
} else {
|
||||
// Nvim: handle option aliases.
|
||||
if (STRNCMP(options[opt_idx].fullname, "viminfo", 7) == 0) {
|
||||
if (strncmp(options[opt_idx].fullname, "viminfo", 7) == 0) {
|
||||
if (strlen(options[opt_idx].fullname) == 7) {
|
||||
return findoption_len("shada", 5);
|
||||
}
|
||||
@@ -4602,11 +4602,11 @@ void set_context_in_set_cmd(expand_T *xp, char *arg, int opt_flags)
|
||||
}
|
||||
p--;
|
||||
}
|
||||
if (STRNCMP(p, "no", 2) == 0) {
|
||||
if (strncmp(p, "no", 2) == 0) {
|
||||
xp->xp_context = EXPAND_BOOL_SETTINGS;
|
||||
p += 2;
|
||||
}
|
||||
if (STRNCMP(p, "inv", 3) == 0) {
|
||||
if (strncmp(p, "inv", 3) == 0) {
|
||||
xp->xp_context = EXPAND_BOOL_SETTINGS;
|
||||
p += 3;
|
||||
}
|
||||
@@ -4734,7 +4734,7 @@ void set_context_in_set_cmd(expand_T *xp, char *arg, int opt_flags)
|
||||
|
||||
// for 'spellsuggest' start at "file:"
|
||||
if (options[opt_idx].var == (char_u *)&p_sps
|
||||
&& STRNCMP(p, "file:", 5) == 0) {
|
||||
&& strncmp(p, "file:", 5) == 0) {
|
||||
xp->xp_pattern = p + 5;
|
||||
break;
|
||||
}
|
||||
@@ -5116,16 +5116,16 @@ int fill_culopt_flags(char *val, win_T *wp)
|
||||
p = val;
|
||||
}
|
||||
while (*p != NUL) {
|
||||
if (STRNCMP(p, "line", 4) == 0) {
|
||||
if (strncmp(p, "line", 4) == 0) {
|
||||
p += 4;
|
||||
culopt_flags_new |= CULOPT_LINE;
|
||||
} else if (STRNCMP(p, "both", 4) == 0) {
|
||||
} else if (strncmp(p, "both", 4) == 0) {
|
||||
p += 4;
|
||||
culopt_flags_new |= CULOPT_LINE | CULOPT_NBR;
|
||||
} else if (STRNCMP(p, "number", 6) == 0) {
|
||||
} else if (strncmp(p, "number", 6) == 0) {
|
||||
p += 6;
|
||||
culopt_flags_new |= CULOPT_NBR;
|
||||
} else if (STRNCMP(p, "screenline", 10) == 0) {
|
||||
} else if (strncmp(p, "screenline", 10) == 0) {
|
||||
p += 10;
|
||||
culopt_flags_new |= CULOPT_SCRLINE;
|
||||
}
|
||||
@@ -5159,8 +5159,8 @@ int option_set_callback_func(char *optval, Callback *optcb)
|
||||
|
||||
typval_T *tv;
|
||||
if (*optval == '{'
|
||||
|| (STRNCMP(optval, "function(", 9) == 0)
|
||||
|| (STRNCMP(optval, "funcref(", 8) == 0)) {
|
||||
|| (strncmp(optval, "function(", 9) == 0)
|
||||
|| (strncmp(optval, "funcref(", 8) == 0)) {
|
||||
// Lambda expression or a funcref
|
||||
tv = eval_expr(optval);
|
||||
if (tv == NULL) {
|
||||
|
Reference in New Issue
Block a user