mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 01:08:20 +00:00
Replace VIM_ISDIGIT() and vim_isdigit() with ascii_isdigit() defined in ascii.h
This commit is contained in:
@@ -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 */
|
||||
|
Reference in New Issue
Block a user