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
cadfccfd
Commit
cadfccfd
authored
Oct 14, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/UTF8: add `noexcept`
parent
c89c7f71
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
14 deletions
+14
-14
UTF8.cxx
src/util/UTF8.cxx
+13
-13
UTF8.hxx
src/util/UTF8.hxx
+1
-1
No files found.
src/util/UTF8.cxx
View file @
cadfccfd
/*
/*
* Copyright
(C) 2011-2014
Max Kellermann <max.kellermann@gmail.com>
* Copyright
2011-2019
Max Kellermann <max.kellermann@gmail.com>
* http://www.musicpd.org
* http://www.musicpd.org
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
...
@@ -37,13 +37,13 @@
...
@@ -37,13 +37,13 @@
* Is this a leading byte that is followed by 1 continuation byte?
* Is this a leading byte that is followed by 1 continuation byte?
*/
*/
static
constexpr
bool
static
constexpr
bool
IsLeading1
(
unsigned
char
ch
)
IsLeading1
(
unsigned
char
ch
)
noexcept
{
{
return
(
ch
&
0xe0
)
==
0xc0
;
return
(
ch
&
0xe0
)
==
0xc0
;
}
}
static
constexpr
unsigned
char
static
constexpr
unsigned
char
MakeLeading1
(
unsigned
char
value
)
MakeLeading1
(
unsigned
char
value
)
noexcept
{
{
return
0xc0
|
value
;
return
0xc0
|
value
;
}
}
...
@@ -52,13 +52,13 @@ MakeLeading1(unsigned char value)
...
@@ -52,13 +52,13 @@ MakeLeading1(unsigned char value)
* Is this a leading byte that is followed by 2 continuation byte?
* Is this a leading byte that is followed by 2 continuation byte?
*/
*/
static
constexpr
bool
static
constexpr
bool
IsLeading2
(
unsigned
char
ch
)
IsLeading2
(
unsigned
char
ch
)
noexcept
{
{
return
(
ch
&
0xf0
)
==
0xe0
;
return
(
ch
&
0xf0
)
==
0xe0
;
}
}
static
constexpr
unsigned
char
static
constexpr
unsigned
char
MakeLeading2
(
unsigned
char
value
)
MakeLeading2
(
unsigned
char
value
)
noexcept
{
{
return
0xe0
|
value
;
return
0xe0
|
value
;
}
}
...
@@ -67,13 +67,13 @@ MakeLeading2(unsigned char value)
...
@@ -67,13 +67,13 @@ MakeLeading2(unsigned char value)
* Is this a leading byte that is followed by 3 continuation byte?
* Is this a leading byte that is followed by 3 continuation byte?
*/
*/
static
constexpr
bool
static
constexpr
bool
IsLeading3
(
unsigned
char
ch
)
IsLeading3
(
unsigned
char
ch
)
noexcept
{
{
return
(
ch
&
0xf8
)
==
0xf0
;
return
(
ch
&
0xf8
)
==
0xf0
;
}
}
static
constexpr
unsigned
char
static
constexpr
unsigned
char
MakeLeading3
(
unsigned
char
value
)
MakeLeading3
(
unsigned
char
value
)
noexcept
{
{
return
0xf0
|
value
;
return
0xf0
|
value
;
}
}
...
@@ -82,13 +82,13 @@ MakeLeading3(unsigned char value)
...
@@ -82,13 +82,13 @@ MakeLeading3(unsigned char value)
* Is this a leading byte that is followed by 4 continuation byte?
* Is this a leading byte that is followed by 4 continuation byte?
*/
*/
static
constexpr
bool
static
constexpr
bool
IsLeading4
(
unsigned
char
ch
)
IsLeading4
(
unsigned
char
ch
)
noexcept
{
{
return
(
ch
&
0xfc
)
==
0xf8
;
return
(
ch
&
0xfc
)
==
0xf8
;
}
}
static
constexpr
unsigned
char
static
constexpr
unsigned
char
MakeLeading4
(
unsigned
char
value
)
MakeLeading4
(
unsigned
char
value
)
noexcept
{
{
return
0xf8
|
value
;
return
0xf8
|
value
;
}
}
...
@@ -97,19 +97,19 @@ MakeLeading4(unsigned char value)
...
@@ -97,19 +97,19 @@ MakeLeading4(unsigned char value)
* Is this a leading byte that is followed by 5 continuation byte?
* Is this a leading byte that is followed by 5 continuation byte?
*/
*/
static
constexpr
bool
static
constexpr
bool
IsLeading5
(
unsigned
char
ch
)
IsLeading5
(
unsigned
char
ch
)
noexcept
{
{
return
(
ch
&
0xfe
)
==
0xfc
;
return
(
ch
&
0xfe
)
==
0xfc
;
}
}
static
constexpr
unsigned
char
static
constexpr
unsigned
char
MakeLeading5
(
unsigned
char
value
)
MakeLeading5
(
unsigned
char
value
)
noexcept
{
{
return
0xfc
|
value
;
return
0xfc
|
value
;
}
}
static
constexpr
bool
static
constexpr
bool
IsContinuation
(
unsigned
char
ch
)
IsContinuation
(
unsigned
char
ch
)
noexcept
{
{
return
(
ch
&
0xc0
)
==
0x80
;
return
(
ch
&
0xc0
)
==
0x80
;
}
}
...
@@ -118,7 +118,7 @@ IsContinuation(unsigned char ch)
...
@@ -118,7 +118,7 @@ IsContinuation(unsigned char ch)
* Generate a continuation byte of the low 6 bit.
* Generate a continuation byte of the low 6 bit.
*/
*/
static
constexpr
unsigned
char
static
constexpr
unsigned
char
MakeContinuation
(
unsigned
char
value
)
MakeContinuation
(
unsigned
char
value
)
noexcept
{
{
return
0x80
|
(
value
&
0x3f
);
return
0x80
|
(
value
&
0x3f
);
}
}
...
...
src/util/UTF8.hxx
View file @
cadfccfd
/*
/*
* Copyright
(C) 2011-2014
Max Kellermann <max.kellermann@gmail.com>
* Copyright
2011-2019
Max Kellermann <max.kellermann@gmail.com>
* http://www.musicpd.org
* http://www.musicpd.org
*
*
* Redistribution and use in source and binary forms, with or without
* Redistribution and use in source and binary forms, with or without
...
...
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