diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-06-26 23:26:04 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-01 08:45:19 -0400 |
commit | 3e4a058b01db779e087eaf97826cee545de2a923 (patch) | |
tree | 34776ed9d7465f43a4692ebb4187b3030312bade /src | |
parent | 6ff892165a6e3edd20ce31ba7c9a4af458684aca (diff) | |
download | rneovim-3e4a058b01db779e087eaf97826cee545de2a923.tar.gz rneovim-3e4a058b01db779e087eaf97826cee545de2a923.tar.bz2 rneovim-3e4a058b01db779e087eaf97826cee545de2a923.zip |
test: port kword_test to Lua for utf_char2bytes()
Use LuaJIT FFI to create char pointer.
Validate output with utf_ptr2char(), vim_iswordc() and vim_iswordp().
Use const for LuaJIT string-to-char conversion.
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/charset.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index d1d9de5487..ab20996df7 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -826,7 +826,7 @@ bool vim_isIDc(int c) /// For multi-byte characters mb_get_class() is used (builtin rules). /// /// @param c character to check -bool vim_iswordc(int c) +bool vim_iswordc(const int c) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT { return vim_iswordc_buf(c, curbuf); @@ -852,7 +852,7 @@ bool vim_iswordc_tab(const int c, const uint64_t *const chartab) /// /// @param c character to check /// @param buf buffer whose keywords to use -bool vim_iswordc_buf(int c, buf_T *buf) +bool vim_iswordc_buf(const int c, buf_T *const buf) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ARG(2) { return vim_iswordc_tab(c, buf->b_chartab); @@ -863,7 +863,7 @@ bool vim_iswordc_buf(int c, buf_T *buf) /// @param p pointer to the multi-byte character /// /// @return true if "p" points to a keyword character. -bool vim_iswordp(char_u *p) +bool vim_iswordp(const char_u *const p) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { return vim_iswordp_buf(p, curbuf); @@ -876,7 +876,7 @@ bool vim_iswordp(char_u *p) /// @param buf buffer whose keywords to use /// /// @return true if "p" points to a keyword character. -bool vim_iswordp_buf(char_u *p, buf_T *buf) +bool vim_iswordp_buf(const char_u *const p, buf_T *const buf) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL { int c = *p; |