aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/regexp.c
diff options
context:
space:
mode:
authorDundar Goc <gocdundar@gmail.com>2022-07-31 16:20:57 +0200
committerdundargoc <gocundar@gmail.com>2022-08-12 14:22:02 +0200
commit094cdf2d691bc005dadb5a22bb83b85f3b6dff49 (patch)
treef09ca6baf124ceaeaef27c095fee1e30ecb772b0 /src/nvim/regexp.c
parentf79773a3b4b3ce5a3b37652a72b12089880f32a4 (diff)
downloadrneovim-094cdf2d691bc005dadb5a22bb83b85f3b6dff49.tar.gz
rneovim-094cdf2d691bc005dadb5a22bb83b85f3b6dff49.tar.bz2
rneovim-094cdf2d691bc005dadb5a22bb83b85f3b6dff49.zip
refactor: replace char_u with char
Work on https://github.com/neovim/neovim/issues/459
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r--src/nvim/regexp.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c
index 4f0911af6c..460ffe3bb1 100644
--- a/src/nvim/regexp.c
+++ b/src/nvim/regexp.c
@@ -482,16 +482,14 @@ static char_u *skip_anyof(char *p)
return (char_u *)p;
}
-/*
- * Skip past regular expression.
- * Stop at end of "startp" or where "dirc" is found ('/', '?', etc).
- * Take care of characters with a backslash in front of it.
- * Skip strings inside [ and ].
- * When "newp" is not NULL and "dirc" is '?', make an allocated copy of the
- * expression and change "\?" to "?". If "*newp" is not NULL the expression
- * is changed in-place.
- */
-char_u *skip_regexp(char_u *startp, int dirc, int magic, char_u **newp)
+/// Skip past regular expression.
+/// Stop at end of "startp" or where "dirc" is found ('/', '?', etc).
+/// Take care of characters with a backslash in front of it.
+/// Skip strings inside [ and ].
+/// When "newp" is not NULL and "dirc" is '?', make an allocated copy of the
+/// expression and change "\?" to "?". If "*newp" is not NULL the expression
+/// is changed in-place.
+char_u *skip_regexp(char_u *startp, int dirc, int magic, char **newp)
{
int mymagic;
char_u *p = startp;
@@ -517,8 +515,8 @@ char_u *skip_regexp(char_u *startp, int dirc, int magic, char_u **newp)
if (dirc == '?' && newp != NULL && p[1] == '?') {
// change "\?" to "?", make a copy first.
if (*newp == NULL) {
- *newp = vim_strsave(startp);
- p = *newp + (p - startp);
+ *newp = (char *)vim_strsave(startp);
+ p = (char_u *)(*newp) + (p - startp);
}
STRMOVE(p, p + 1);
} else {