diff options
author | ZviRackover <zvirack@gmail.com> | 2018-06-29 22:31:20 +0300 |
---|---|---|
committer | ZviRackover <zvirack@gmail.com> | 2018-08-06 20:48:07 +0300 |
commit | 10b6afd652a896144d87fb0db4389001293e7973 (patch) | |
tree | d77eedbc08dd9d8038c31bdcdfbcacc974157e61 /src/nvim/regexp.c | |
parent | 1593ee7cf21f77168531c959fa9e73933b502d2e (diff) | |
download | rneovim-10b6afd652a896144d87fb0db4389001293e7973.tar.gz rneovim-10b6afd652a896144d87fb0db4389001293e7973.tar.bz2 rneovim-10b6afd652a896144d87fb0db4389001293e7973.zip |
Remove all occurences of the mb_ptr2char macro
First step towards implemening issue #7401.
The same can be done for all deprecated mb_ functions in follow-up
patches.
Diffstat (limited to 'src/nvim/regexp.c')
-rw-r--r-- | src/nvim/regexp.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/nvim/regexp.c b/src/nvim/regexp.c index d76da62c6d..ca4db722ad 100644 --- a/src/nvim/regexp.c +++ b/src/nvim/regexp.c @@ -776,7 +776,7 @@ static int get_equi_class(char_u **pp) l = (*mb_ptr2len)(p + 2); if (p[l + 2] == '=' && p[l + 3] == ']') { if (has_mbyte) - c = mb_ptr2char(p + 2); + c = utf_ptr2char(p + 2); else c = p[2]; *pp += l + 4; @@ -1111,7 +1111,7 @@ static int get_coll_element(char_u **pp) l = (*mb_ptr2len)(p + 2); if (p[l + 2] == '.' && p[l + 3] == ']') { if (has_mbyte) - c = mb_ptr2char(p + 2); + c = utf_ptr2char(p + 2); else c = p[2]; *pp += l + 4; @@ -1300,7 +1300,7 @@ static regprog_T *bt_regcomp(char_u *expr, int re_flags) if (OP(scan) == EXACTLY) { if (has_mbyte) - r->regstart = (*mb_ptr2char)(OPERAND(scan)); + r->regstart = utf_ptr2char(OPERAND(scan)); else r->regstart = *OPERAND(scan); } else if (OP(scan) == BOW @@ -1311,7 +1311,7 @@ static regprog_T *bt_regcomp(char_u *expr, int re_flags) char_u *regnext_scan = regnext(scan); if (OP(regnext_scan) == EXACTLY) { if (has_mbyte) - r->regstart = (*mb_ptr2char)(OPERAND(regnext_scan)); + r->regstart = utf_ptr2char(OPERAND(regnext_scan)); else r->regstart = *OPERAND(regnext_scan); } @@ -2417,7 +2417,7 @@ collection: /* produce a multibyte character, including any * following composing characters */ - startc = mb_ptr2char(regparse); + startc = utf_ptr2char(regparse); len = (*mb_ptr2len)(regparse); if (enc_utf8 && utf_char2len(startc) != len) startc = -1; /* composing chars */ @@ -2907,7 +2907,7 @@ static int peekchr(void) * Then backslashing it won't do anything. */ if (has_mbyte) - curchr = (*mb_ptr2char)(regparse + 1); + curchr = utf_ptr2char(regparse + 1); else curchr = c; } @@ -2916,7 +2916,7 @@ static int peekchr(void) default: if (has_mbyte) - curchr = (*mb_ptr2char)(regparse); + curchr = utf_ptr2char(regparse); } return curchr; @@ -3469,7 +3469,7 @@ static long bt_regexec_both(char_u *line, int c; if (has_mbyte) - c = (*mb_ptr2char)(prog->regmust); + c = utf_ptr2char(prog->regmust); else c = *prog->regmust; s = line + col; @@ -3505,7 +3505,7 @@ static long bt_regexec_both(char_u *line, int c; if (has_mbyte) - c = (*mb_ptr2char)(regline + col); + c = utf_ptr2char(regline + col); else c = regline[col]; if (prog->regstart == NUL @@ -3861,7 +3861,7 @@ regmatch ( if (WITH_NL(op)) op -= ADD_NL; if (has_mbyte) - c = (*mb_ptr2char)(reginput); + c = utf_ptr2char(reginput); else c = *reginput; switch (op) { @@ -5474,7 +5474,7 @@ do_class: } else if (rex.reg_line_lbr && *scan == '\n' && WITH_NL(OP(p))) { scan++; } else if (has_mbyte && (len = (*mb_ptr2len)(scan)) > 1) { - if ((cstrchr(opnd, (*mb_ptr2char)(scan)) == NULL) == testval) { + if ((cstrchr(opnd, utf_ptr2char(scan)) == NULL) == testval) { break; } scan += len; @@ -6783,7 +6783,7 @@ static int vim_regsub_both(char_u *source, typval_T *expr, char_u *dest, c = *src++; } } else if (has_mbyte) - c = mb_ptr2char(src - 1); + c = utf_ptr2char(src - 1); /* Write to buffer, if copy is set. */ if (func_one != (fptr_T)NULL) @@ -6879,7 +6879,7 @@ static int vim_regsub_both(char_u *source, typval_T *expr, char_u *dest, dst += 2; } else { if (has_mbyte) - c = mb_ptr2char(s); + c = utf_ptr2char(s); else c = *s; |