aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2022-04-25 04:18:43 +0200
committerGitHub <noreply@github.com>2022-04-24 20:18:43 -0600
commit0648100fed65cbe8efe774ae997ab841cae01872 (patch)
tree4b2b5a41f58ddf442a69726f6a315c393317714b /src/nvim/eval
parent7813fa2f8cc3885788abc5c5dceea6638d8416e6 (diff)
downloadrneovim-0648100fed65cbe8efe774ae997ab841cae01872.tar.gz
rneovim-0648100fed65cbe8efe774ae997ab841cae01872.tar.bz2
rneovim-0648100fed65cbe8efe774ae997ab841cae01872.zip
refactor: convert macros to all-caps (#17895)
Closes https://github.com/neovim/neovim/issues/6297
Diffstat (limited to 'src/nvim/eval')
-rw-r--r--src/nvim/eval/encode.c4
-rw-r--r--src/nvim/eval/userfunc.c2
2 files changed, 2 insertions, 4 deletions
diff --git a/src/nvim/eval/encode.c b/src/nvim/eval/encode.c
index 6f4357421b..b04e3c04d6 100644
--- a/src/nvim/eval/encode.c
+++ b/src/nvim/eval/encode.c
@@ -29,8 +29,6 @@
#include "nvim/message.h"
#include "nvim/vim.h" // For _()
-#define utf_char2len(b) ((size_t)utf_char2len(b))
-
const char *const encode_bool_var_names[] = {
[kBoolVarTrue] = "true",
[kBoolVarFalse] = "false",
@@ -653,7 +651,7 @@ static inline int convert_to_json_string(garray_T *const gap, const char *const
ga_grow(gap, (int)str_len);
for (size_t i = 0; i < utf_len;) {
const int ch = utf_ptr2char((char_u *)utf_buf + i);
- const size_t shift = (ch == 0? 1: utf_char2len(ch));
+ const size_t shift = (ch == 0 ? 1 : ((size_t)utf_char2len(ch)));
assert(shift > 0);
// Is false on invalid unicode, but this should already be handled.
assert(ch == 0 || shift == ((size_t)utf_ptr2len((char_u *)utf_buf + i)));
diff --git a/src/nvim/eval/userfunc.c b/src/nvim/eval/userfunc.c
index 0fadc0d220..340b731312 100644
--- a/src/nvim/eval/userfunc.c
+++ b/src/nvim/eval/userfunc.c
@@ -2503,7 +2503,7 @@ void ex_function(exarg_T *eap)
p = vim_strchr(scriptname, '/');
plen = (int)STRLEN(p);
slen = (int)STRLEN(sourcing_name);
- if (slen > plen && fnamecmp(p,
+ if (slen > plen && FNAMECMP(p,
sourcing_name + slen - plen) == 0) {
j = OK;
}