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
d6660bad
Commit
d6660bad
authored
Jul 05, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/WCharUtil: remove redundant `inline` keywords from `constexpr` functions
parent
9d74b1a2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
25 deletions
+13
-25
WCharUtil.hxx
src/util/WCharUtil.hxx
+13
-25
No files found.
src/util/WCharUtil.hxx
View file @
d6660bad
/*
/*
* Copyright
(C) 2011-2017
Max Kellermann <max.kellermann@gmail.com>
* Copyright
2011-2019
Max Kellermann <max.kellermann@gmail.com>
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* modification, are permitted provided that the following conditions
...
@@ -32,22 +32,19 @@
...
@@ -32,22 +32,19 @@
#include <wchar.h>
#include <wchar.h>
constexpr
constexpr
bool
static
inline
bool
IsASCII
(
const
wchar_t
ch
)
IsASCII
(
const
wchar_t
ch
)
{
{
return
(
ch
&
~
0x7f
)
==
0
;
return
(
ch
&
~
0x7f
)
==
0
;
}
}
constexpr
constexpr
bool
static
inline
bool
IsWhitespaceOrNull
(
const
wchar_t
ch
)
IsWhitespaceOrNull
(
const
wchar_t
ch
)
{
{
return
(
unsigned
)
ch
<=
0x20
;
return
(
unsigned
)
ch
<=
0x20
;
}
}
constexpr
constexpr
bool
static
inline
bool
IsWhitespaceNotNull
(
const
wchar_t
ch
)
IsWhitespaceNotNull
(
const
wchar_t
ch
)
{
{
return
ch
>
0
&&
ch
<=
0x20
;
return
ch
>
0
&&
ch
<=
0x20
;
...
@@ -59,50 +56,43 @@ IsWhitespaceNotNull(const wchar_t ch)
...
@@ -59,50 +56,43 @@ IsWhitespaceNotNull(const wchar_t 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
wchar_t
ch
)
IsWhitespaceFast
(
const
wchar_t
ch
)
{
{
return
IsWhitespaceOrNull
(
ch
);
return
IsWhitespaceOrNull
(
ch
);
}
}
constexpr
constexpr
bool
static
inline
bool
IsPrintableASCII
(
wchar_t
ch
)
IsPrintableASCII
(
wchar_t
ch
)
{
{
return
IsASCII
(
ch
)
&&
ch
>=
0x20
;
return
IsASCII
(
ch
)
&&
ch
>=
0x20
;
}
}
constexpr
constexpr
bool
static
inline
bool
IsDigitASCII
(
wchar_t
ch
)
IsDigitASCII
(
wchar_t
ch
)
{
{
return
ch
>=
'0'
&&
ch
<=
'9'
;
return
ch
>=
'0'
&&
ch
<=
'9'
;
}
}
constexpr
constexpr
bool
static
inline
bool
IsUpperAlphaASCII
(
wchar_t
ch
)
IsUpperAlphaASCII
(
wchar_t
ch
)
{
{
return
ch
>=
'A'
&&
ch
<=
'Z'
;
return
ch
>=
'A'
&&
ch
<=
'Z'
;
}
}
constexpr
constexpr
bool
static
inline
bool
IsLowerAlphaASCII
(
wchar_t
ch
)
IsLowerAlphaASCII
(
wchar_t
ch
)
{
{
return
ch
>=
'a'
&&
ch
<=
'z'
;
return
ch
>=
'a'
&&
ch
<=
'z'
;
}
}
constexpr
constexpr
bool
static
inline
bool
IsAlphaASCII
(
wchar_t
ch
)
IsAlphaASCII
(
wchar_t
ch
)
{
{
return
IsUpperAlphaASCII
(
ch
)
||
IsLowerAlphaASCII
(
ch
);
return
IsUpperAlphaASCII
(
ch
)
||
IsLowerAlphaASCII
(
ch
);
}
}
constexpr
constexpr
bool
static
inline
bool
IsAlphaNumericASCII
(
wchar_t
ch
)
IsAlphaNumericASCII
(
wchar_t
ch
)
{
{
return
IsAlphaASCII
(
ch
)
||
IsDigitASCII
(
ch
);
return
IsAlphaASCII
(
ch
)
||
IsDigitASCII
(
ch
);
...
@@ -112,8 +102,7 @@ IsAlphaNumericASCII(wchar_t ch)
...
@@ -112,8 +102,7 @@ IsAlphaNumericASCII(wchar_t 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
wchar_t
static
inline
wchar_t
ToUpperASCII
(
wchar_t
ch
)
ToUpperASCII
(
wchar_t
ch
)
{
{
return
ch
>=
'a'
&&
ch
<=
'z'
return
ch
>=
'a'
&&
ch
<=
'z'
...
@@ -125,8 +114,7 @@ ToUpperASCII(wchar_t ch)
...
@@ -125,8 +114,7 @@ ToUpperASCII(wchar_t 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
wchar_t
static
inline
wchar_t
ToLowerASCII
(
wchar_t
ch
)
ToLowerASCII
(
wchar_t
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