aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.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/regexp.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/regexp.c')
-rw-r--r--src/nvim/regexp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index e396e54ced..54461bfa07 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -456,9 +456,9 @@ static char_u *skip_anyof(char *p)
MB_PTR_ADV(p);
}
} else if (*p == '\\'
- && (vim_strchr(REGEXP_INRANGE, p[1]) != NULL
+ && (vim_strchr(REGEXP_INRANGE, (uint8_t)p[1]) != NULL
|| (!reg_cpo_lit
- && vim_strchr(REGEXP_ABBR, p[1]) != NULL))) {
+ && vim_strchr(REGEXP_ABBR, (uint8_t)p[1]) != NULL))) {
p += 2;
} else if (*p == '[') {
if (get_char_class(&p) == CLASS_NONE
@@ -1399,8 +1399,8 @@ static int cstrncmp(char *s1, char *s2, int *n)
str2 = s2;
c1 = c2 = 0;
while ((int)(str1 - s1) < *n) {
- c1 = mb_ptr2char_adv((const char_u **)&str1);
- c2 = mb_ptr2char_adv((const char_u **)&str2);
+ c1 = mb_ptr2char_adv((const char **)&str1);
+ c2 = mb_ptr2char_adv((const char **)&str2);
// decompose the character if necessary, into 'base' characters
// because I don't care about Arabic, I will hard-code the Hebrew
@@ -1860,7 +1860,7 @@ static int vim_regsub_both(char *source, typval_T *expr, char *dest, int destlen
no = 0;
} else if ('0' <= *src && *src <= '9') {
no = *src++ - '0';
- } else if (vim_strchr("uUlLeE", *src)) {
+ } else if (vim_strchr("uUlLeE", (uint8_t)(*src))) {
switch (*src++) {
case 'u':
func_one = (fptr_T)do_upper;
@@ -2497,9 +2497,9 @@ bool vim_regexec(regmatch_T *rmp, char *line, colnr_T col)
// Like vim_regexec(), but consider a "\n" in "line" to be a line break.
// Note: "rmp->regprog" may be freed and changed.
// Return true if there is a match, false if not.
-bool vim_regexec_nl(regmatch_T *rmp, char_u *line, colnr_T col)
+bool vim_regexec_nl(regmatch_T *rmp, char *line, colnr_T col)
{
- return vim_regexec_string(rmp, line, col, true);
+ return vim_regexec_string(rmp, (char_u *)line, col, true);
}
/// Match a regexp against multiple lines.