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
f2cacaf6
Commit
f2cacaf6
authored
Mar 08, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AudioFormat, pcm/Dsd*: remove redundant `inline` keywords from `constexpr` functions
parent
24cde313
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
AudioFormat.hxx
src/AudioFormat.hxx
+4
-4
Dsd16.cxx
src/pcm/Dsd16.cxx
+2
-2
Dsd32.cxx
src/pcm/Dsd32.cxx
+2
-2
Volume.hxx
src/pcm/Volume.hxx
+2
-2
No files found.
src/AudioFormat.hxx
View file @
f2cacaf6
...
...
@@ -178,8 +178,8 @@ struct AudioFormat {
*
* @param sample_rate the sample rate in Hz
*/
static
constexpr
inline
bool
audio_valid_sample_rate
(
unsigned
sample_rate
)
constexpr
bool
audio_valid_sample_rate
(
unsigned
sample_rate
)
noexcept
{
return
sample_rate
>
0
&&
sample_rate
<
(
1
<<
30
);
}
...
...
@@ -187,8 +187,8 @@ audio_valid_sample_rate(unsigned sample_rate)
/**
* Checks whether the number of channels is valid.
*/
static
constexpr
inline
bool
audio_valid_channel_count
(
unsigned
channels
)
constexpr
bool
audio_valid_channel_count
(
unsigned
channels
)
noexcept
{
return
channels
>=
1
&&
channels
<=
MAX_CHANNELS
;
}
...
...
src/pcm/Dsd16.cxx
View file @
f2cacaf6
...
...
@@ -24,7 +24,7 @@
/**
* Construct a 16 bit integer from two bytes.
*/
static
constexpr
inline
uint16_t
static
constexpr
uint16_t
Construct16
(
uint8_t
a
,
uint8_t
b
)
noexcept
{
/* "a" is the oldest byte, which must be in the most
...
...
@@ -33,7 +33,7 @@ Construct16(uint8_t a, uint8_t b) noexcept
return
uint16_t
(
b
)
|
(
uint16_t
(
a
)
<<
8
);
}
static
constexpr
inline
uint16_t
static
constexpr
uint16_t
Dsd8To16Sample
(
const
uint8_t
*
src
,
unsigned
channels
)
noexcept
{
return
Construct16
(
src
[
0
],
src
[
channels
]);
...
...
src/pcm/Dsd32.cxx
View file @
f2cacaf6
...
...
@@ -24,7 +24,7 @@
/**
* Construct a 32 bit integer from four bytes.
*/
static
constexpr
inline
uint32_t
static
constexpr
uint32_t
Construct32
(
uint8_t
a
,
uint8_t
b
,
uint8_t
c
,
uint8_t
d
)
noexcept
{
/* "a" is the oldest byte, which must be in the most
...
...
@@ -34,7 +34,7 @@ Construct32(uint8_t a, uint8_t b, uint8_t c, uint8_t d) noexcept
(
uint32_t
(
b
)
<<
16
)
|
(
uint32_t
(
a
)
<<
24
);
}
static
constexpr
inline
uint32_t
static
constexpr
uint32_t
Dsd8To32Sample
(
const
uint8_t
*
src
,
unsigned
channels
)
noexcept
{
return
Construct32
(
src
[
0
],
src
[
channels
],
...
...
src/pcm/Volume.hxx
View file @
f2cacaf6
...
...
@@ -45,13 +45,13 @@ static constexpr int PCM_VOLUME_1S = PCM_VOLUME_1;
* Converts a float value (0.0 = silence, 1.0 = 100% volume) to an
* integer volume value (1000 = 100%).
*/
static
constexpr
inline
int
constexpr
int
pcm_float_to_volume
(
float
volume
)
noexcept
{
return
volume
*
PCM_VOLUME_1
+
0.5
;
}
static
constexpr
inline
float
constexpr
float
pcm_volume_to_float
(
int
volume
)
noexcept
{
return
(
float
)
volume
/
(
float
)
PCM_VOLUME_1
;
...
...
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