Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
f6e1176f
Commit
f6e1176f
authored
Jan 21, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/CharUtil: remove redundant `inline` keywords from `constexpr` functions
parent
e4700c0a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
26 deletions
+13
-26
CharUtil.hxx
src/util/CharUtil.hxx
+13
-26
No files found.
src/util/CharUtil.hxx
View file @
f6e1176f
...
@@ -34,29 +34,25 @@
...
@@ -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)
...
@@ -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)
...
@@ -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)
...
@@ -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'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment