util/CharUtil: remove redundant `inline` keywords from `constexpr` functions

This commit is contained in:
Max Kellermann 2019-01-21 21:18:23 +01:00
parent e4700c0a27
commit f6e1176f97
1 changed files with 13 additions and 26 deletions

View File

@ -34,29 +34,25 @@
#include "WCharUtil.hxx"
#endif
constexpr
static inline bool
constexpr bool
IsASCII(const unsigned char ch)
{
return ch < 0x80;
}
constexpr
static inline bool
constexpr bool
IsASCII(const char ch)
{
return IsASCII((unsigned char)ch);
}
constexpr
static inline bool
constexpr bool
IsWhitespaceOrNull(const char ch)
{
return (unsigned char)ch <= 0x20;
}
constexpr
static inline bool
constexpr bool
IsWhitespaceNotNull(const char ch)
{
return ch > 0 && ch <= 0x20;
@ -68,50 +64,43 @@ IsWhitespaceNotNull(const char ch)
* want the fastest implementation, and you don't care if a null byte
* matches.
*/
constexpr
static inline bool
constexpr bool
IsWhitespaceFast(const char ch)
{
return IsWhitespaceOrNull(ch);
}
constexpr
static inline bool
constexpr bool
IsPrintableASCII(char ch)
{
return (signed char)ch >= 0x20;
}
constexpr
static inline bool
constexpr bool
IsDigitASCII(char ch)
{
return ch >= '0' && ch <= '9';
}
constexpr
static inline bool
constexpr bool
IsUpperAlphaASCII(char ch)
{
return ch >= 'A' && ch <= 'Z';
}
constexpr
static inline bool
constexpr bool
IsLowerAlphaASCII(char ch)
{
return ch >= 'a' && ch <= 'z';
}
constexpr
static inline bool
constexpr bool
IsAlphaASCII(char ch)
{
return IsUpperAlphaASCII(ch) || IsLowerAlphaASCII(ch);
}
constexpr
static inline bool
constexpr bool
IsAlphaNumericASCII(char ch)
{
return IsAlphaASCII(ch) || IsDigitASCII(ch);
@ -121,8 +110,7 @@ IsAlphaNumericASCII(char ch)
* Convert the specified ASCII character (0x00..0x7f) to upper case.
* Unlike toupper(), it ignores the system locale.
*/
constexpr
static inline char
constexpr char
ToUpperASCII(char ch)
{
return ch >= 'a' && ch <= 'z'
@ -134,8 +122,7 @@ ToUpperASCII(char ch)
* Convert the specified ASCII character (0x00..0x7f) to lower case.
* Unlike tolower(), it ignores the system locale.
*/
constexpr
static inline char
constexpr char
ToLowerASCII(char ch)
{
return ch >= 'A' && ch <= 'Z'