aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval/userfunc.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-09-12 21:50:31 +0200
committerGitHub <noreply@github.com>2022-09-12 21:50:31 +0200
commitf6232e160b96e2607edcd5afa7207a1e4aadf805 (patch)
tree41fa053ec7eff6b7edd278ec892392896f984722 /src/nvim/eval/userfunc.c
parentfd70e2bff2440181f63fe124738cf2a025d1e6a5 (diff)
parent3ff46544c9872b4161fd098569c30b55fe3abd36 (diff)
downloadrneovim-f6232e160b96e2607edcd5afa7207a1e4aadf805.tar.gz
rneovim-f6232e160b96e2607edcd5afa7207a1e4aadf805.tar.bz2
rneovim-f6232e160b96e2607edcd5afa7207a1e4aadf805.zip
Merge pull request #20077 from dundargoc/refactor/char_u/11
refactor: replace char_u with char 11: remove `STRLEN` part 1
Diffstat (limited to 'src/nvim/eval/userfunc.c')
-rw-r--r--src/nvim/eval/userfunc.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 70c9e02d5c..283dc23793 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -528,14 +528,14 @@ static char *fname_trans_sid(const char *const name, char *const fname_buf, char
} else {
snprintf(fname_buf + i, (size_t)(FLEN_FIXED + 1 - i), "%" PRId64 "_",
(int64_t)current_sctx.sc_sid);
- i = (int)STRLEN(fname_buf);
+ i = (int)strlen(fname_buf);
}
}
- if ((size_t)i + STRLEN(name + llen) < FLEN_FIXED) {
+ if ((size_t)i + strlen(name + llen) < FLEN_FIXED) {
STRCPY(fname_buf + i, name + llen);
fname = fname_buf;
} else {
- fname = xmalloc((size_t)i + STRLEN(name + llen) + 1);
+ fname = xmalloc((size_t)i + strlen(name + llen) + 1);
*tofree = fname;
memmove(fname, fname_buf, (size_t)i);
STRCPY(fname + i, name + llen);
@@ -1516,7 +1516,7 @@ int call_func(const char *funcname, int len, typval_T *rettv, int argcount_in, t
fp = find_func((char_u *)rfname);
}
// Try loading a package.
- if (fp == NULL && script_autoload((const char *)rfname, STRLEN(rfname),
+ if (fp == NULL && script_autoload((const char *)rfname, strlen(rfname),
true) && !aborting()) {
// Loaded a package, search for the function again.
fp = find_func((char_u *)rfname);
@@ -2167,7 +2167,7 @@ void ex_function(exarg_T *eap)
theline = line_arg;
p = vim_strchr(theline, '\n');
if (p == NULL) {
- line_arg += STRLEN(line_arg);
+ line_arg += strlen(line_arg);
} else {
*p = NUL;
line_arg = p + 1;
@@ -2209,14 +2209,14 @@ void ex_function(exarg_T *eap)
if (heredoc_trimmed == NULL
|| (is_heredoc && skipwhite(theline) == theline)
|| STRNCMP(theline, heredoc_trimmed,
- STRLEN(heredoc_trimmed)) == 0) {
+ strlen(heredoc_trimmed)) == 0) {
if (heredoc_trimmed == NULL) {
p = theline;
} else if (is_heredoc) {
p = skipwhite(theline) == theline
- ? theline : theline + STRLEN(heredoc_trimmed);
+ ? theline : theline + strlen(heredoc_trimmed);
} else {
- p = theline + STRLEN(heredoc_trimmed);
+ p = theline + strlen(heredoc_trimmed);
}
if (strcmp(p, skip_until) == 0) {
XFREE_CLEAR(skip_until);
@@ -2383,7 +2383,7 @@ void ex_function(exarg_T *eap)
// If there are no errors, add the function
if (fudi.fd_dict == NULL) {
- v = find_var((const char *)name, STRLEN(name), &ht, false);
+ v = find_var((const char *)name, strlen(name), &ht, false);
if (v != NULL && v->di_tv.v_type == VAR_FUNC) {
emsg_funcname(N_("E707: Function name conflicts with variable: %s"),
(char_u *)name);
@@ -2458,7 +2458,7 @@ void ex_function(exarg_T *eap)
// Check that the autoload name matches the script name.
int j = FAIL;
if (SOURCING_NAME != NULL) {
- scriptname = (char_u *)autoload_name((const char *)name, STRLEN(name));
+ scriptname = (char_u *)autoload_name((const char *)name, strlen(name));
p = vim_strchr((char *)scriptname, '/');
plen = (int)STRLEN(p);
slen = (int)STRLEN(SOURCING_NAME);
@@ -2474,7 +2474,7 @@ void ex_function(exarg_T *eap)
}
}
- fp = xcalloc(1, offsetof(ufunc_T, uf_name) + STRLEN(name) + 1);
+ fp = xcalloc(1, offsetof(ufunc_T, uf_name) + strlen(name) + 1);
if (fudi.fd_dict != NULL) {
if (fudi.fd_di == NULL) {
@@ -3085,7 +3085,7 @@ char *get_return_cmd(void *rettv)
STRCPY(IObuff, ":return ");
STRLCPY(IObuff + 8, s, IOSIZE - 8);
- if (STRLEN(s) + 8 >= IOSIZE) {
+ if (strlen(s) + 8 >= IOSIZE) {
STRCPY(IObuff + IOSIZE - 4, "...");
}
xfree(tofree);