From f6e1176f973768d85cf24015987693de310bcca7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 21 Jan 2019 21:18:23 +0100 Subject: [PATCH] util/CharUtil: remove redundant `inline` keywords from `constexpr` functions --- src/util/CharUtil.hxx | 39 +++++++++++++-------------------------- 1 file changed, 13 insertions(+), 26 deletions(-) diff --git a/src/util/CharUtil.hxx b/src/util/CharUtil.hxx index 7c28b694c..c1e1c1489 100644 --- a/src/util/CharUtil.hxx +++ b/src/util/CharUtil.hxx @@ -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'