diff options
Diffstat (limited to 'src/nvim/charset.c')
-rw-r--r-- | src/nvim/charset.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 55dee08090..37e7e6516b 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -177,7 +177,7 @@ int buf_init_chartab(buf_T *buf, int global) ++p; } - if (VIM_ISDIGIT(*p)) { + if (ascii_isdigit(*p)) { c = getdigits_int(&p); } else if (has_mbyte) { c = mb_ptr2char_adv(&p); @@ -189,7 +189,7 @@ int buf_init_chartab(buf_T *buf, int global) if ((*p == '-') && (p[1] != NUL)) { ++p; - if (VIM_ISDIGIT(*p)) { + if (ascii_isdigit(*p)) { c2 = getdigits_int(&p); } else if (has_mbyte) { c2 = mb_ptr2char_adv(&p); @@ -1422,7 +1422,7 @@ char_u* skipwhite(char_u *q) char_u* skipdigits(char_u *q) { char_u *p = q; - while (VIM_ISDIGIT(*p)) { + while (ascii_isdigit(*p)) { // skip to next non-digit p++; } @@ -1453,7 +1453,7 @@ char_u* skiphex(char_u *q) char_u* skiptodigit(char_u *q) { char_u *p = q; - while (*p != NUL && !VIM_ISDIGIT(*p)) { + while (*p != NUL && !ascii_isdigit(*p)) { // skip to next digit p++; } @@ -1475,19 +1475,6 @@ char_u* skiptohex(char_u *q) return p; } -/// Variant of isdigit() that can handle characters > 0x100. -/// We don't use isdigit() here, because on some systems it also considers -/// superscript 1 to be a digit. -/// Use the VIM_ISDIGIT() macro for simple arguments. -/// -/// @param c -/// -/// @return TRUE if the character is a digit. -int vim_isdigit(int c) -{ - return c >= '0' && c <= '9'; -} - /// Variant of isxdigit() that can handle characters > 0x100. /// We don't use isxdigit() here, because on some systems it also considers /// superscript 1 to be a digit. @@ -1773,7 +1760,7 @@ void vim_str2nr(char_u *start, int *hexp, int *len, int dooct, int dohex, if (dooct) { // Don't interpret "0", "08" or "0129" as octal. - for (n = 1; VIM_ISDIGIT(ptr[n]); ++n) { + for (n = 1; ascii_isdigit(ptr[n]); ++n) { if (ptr[n] > '7') { // can't be octal hex = 0; @@ -1804,7 +1791,7 @@ void vim_str2nr(char_u *start, int *hexp, int *len, int dooct, int dohex, } } else { // decimal - while (VIM_ISDIGIT(*ptr)) { + while (ascii_isdigit(*ptr)) { un = 10 * un + (unsigned long)(*ptr - '0'); ptr++; } |