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