Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.h

This commit is contained in:
Felipe Oliveira Carvalho
2015-04-22 19:47:53 -03:00
parent 93bf201119
commit caabcae0b7
37 changed files with 168 additions and 176 deletions

View File

@@ -91,6 +91,7 @@
#endif
static inline bool ascii_iswhite(int c) FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_CONST;
static inline bool ascii_isdigit(int c) FUNC_ATTR_ALWAYS_INLINE FUNC_ATTR_CONST;
/// ascii_iswhite() is used for "^" and the like. It differs from isspace()
/// because it doesn't include <CR> and <LF> and the like.
@@ -99,4 +100,13 @@ static inline bool ascii_iswhite(int c)
return c == ' ' || c == '\t';
}
/// Use our own isdigit() replacement, because on MS-Windows isdigit() returns
/// non-zero for superscript 1. Also avoids that isdigit() crashes for numbers
/// below 0 and above 255.
static inline bool ascii_isdigit(int c)
{
return c >= '0' && c <= '9';
}
#endif /* NVIM_ASCII_H */