aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.c
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-01-17 14:17:40 +0100
committerGitHub <noreply@github.com>2023-01-17 21:17:40 +0800
commit0344bfad0fc87d2e256ea2b80de7abd069ba1dd2 (patch)
treee42d0318ed1e684bbb468661d8a1fbfe82e819ee /src/nvim/eval/userfunc.c
parent99186508d9a1b7536441112f9bbe48690592b5d7 (diff)
downloadrneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.tar.gz
rneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.tar.bz2
rneovim-0344bfad0fc87d2e256ea2b80de7abd069ba1dd2.zip
refactor: replace char_u with char 22 (#21786)
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/eval/userfunc.c')
-rw-r--r--src/nvim/eval/userfunc.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 1a3fd13fe3..5d3b70b414 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -118,7 +118,7 @@ static int get_function_args(char **argp, char_u endchar, garray_T *newargs, int
while (ASCII_ISALNUM(*p) || *p == '_') {
p++;
}
- if (arg == p || isdigit(*arg)
+ if (arg == p || isdigit((uint8_t)(*arg))
|| (p - arg == 9 && strncmp(arg, "firstline", 9) == 0)
|| (p - arg == 8 && strncmp(arg, "lastline", 8) == 0)) {
if (!skip) {
@@ -1228,7 +1228,7 @@ void call_user_func(ufunc_T *fp, int argcount, typval_T *argvars, typval_T *rett
/// looked up by name.
static bool func_name_refcount(const char_u *name)
{
- return isdigit(*name) || *name == '<';
+ return isdigit((uint8_t)(*name)) || *name == '<';
}
/// Call a user function after checking the arguments.
@@ -2002,7 +2002,7 @@ static void list_functions(regmatch_T *regmatch)
&& (regmatch == NULL
? (!message_filtered((char *)fp->uf_name)
&& !func_name_refcount((char_u *)fp->uf_name))
- : (!isdigit(*fp->uf_name)
+ : (!isdigit((uint8_t)(*fp->uf_name))
&& vim_regexec(regmatch, (char *)fp->uf_name, 0)))) {
list_func_head(fp, false, false);
if (changed != func_hashtab.ht_changed) {
@@ -2792,7 +2792,7 @@ void ex_delfunction(exarg_T *eap)
*p = NUL;
}
- if (isdigit(*name) && fudi.fd_dict == NULL) {
+ if (isdigit((uint8_t)(*name)) && fudi.fd_dict == NULL) {
if (!eap->skip) {
semsg(_(e_invarg2), eap->arg);
}
@@ -2858,7 +2858,7 @@ void func_unref(char_u *name)
}
fp = find_func(name);
- if (fp == NULL && isdigit(*name)) {
+ if (fp == NULL && isdigit((uint8_t)(*name))) {
#ifdef EXITFREE
if (!entered_free_all_mem) {
internal_error("func_unref()");
@@ -2901,7 +2901,7 @@ void func_ref(char_u *name)
fp = find_func(name);
if (fp != NULL) {
(fp->uf_refcount)++;
- } else if (isdigit(*name)) {
+ } else if (isdigit((uint8_t)(*name))) {
// Only give an error for a numbered function.
// Fail silently, when named or lambda function isn't found.
internal_error("func_ref()");