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
2d5bf532
Commit
2d5bf532
authored
Jan 14, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Dsd2Pcm: use `sizet_t` instead of `int`
parent
a65f7b10
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
Dsd2Pcm.cxx
src/pcm/Dsd2Pcm.cxx
+4
-3
Dsd2Pcm.hxx
src/pcm/Dsd2Pcm.hxx
+1
-1
No files found.
src/pcm/Dsd2Pcm.cxx
View file @
2d5bf532
...
@@ -41,7 +41,7 @@ or implied, of Sebastian Gesemann.
...
@@ -41,7 +41,7 @@ or implied, of Sebastian Gesemann.
static
constexpr
size_t
HTAPS
=
48
;
static
constexpr
size_t
HTAPS
=
48
;
/** number of "8 MACs" lookup tables */
/** number of "8 MACs" lookup tables */
static
constexpr
in
t
CTABLES
=
(
HTAPS
+
7
)
/
8
;
static
constexpr
size_
t
CTABLES
=
(
HTAPS
+
7
)
/
8
;
static_assert
(
Dsd2Pcm
::
FIFOSIZE
*
8
>=
HTAPS
*
2
,
"FIFOSIZE too small"
);
static_assert
(
Dsd2Pcm
::
FIFOSIZE
*
8
>=
HTAPS
*
2
,
"FIFOSIZE too small"
);
...
@@ -117,7 +117,7 @@ static constexpr double htaps[HTAPS] = {
...
@@ -117,7 +117,7 @@ static constexpr double htaps[HTAPS] = {
};
};
static
constexpr
float
static
constexpr
float
CalculateCtableValue
(
in
t
t
,
int
k
,
int
e
)
noexcept
CalculateCtableValue
(
size_
t
t
,
int
k
,
int
e
)
noexcept
{
{
double
acc
=
0
;
double
acc
=
0
;
for
(
int
m
=
0
;
m
<
k
;
++
m
)
{
for
(
int
m
=
0
;
m
<
k
;
++
m
)
{
...
@@ -130,7 +130,8 @@ CalculateCtableValue(int t, int k, int e) noexcept
...
@@ -130,7 +130,8 @@ CalculateCtableValue(int t, int k, int e) noexcept
/* this needs to be a struct because GCC 6 doesn't have constexpr
/* this needs to be a struct because GCC 6 doesn't have constexpr
lambdas (C++17) */
lambdas (C++17) */
struct
GenerateCtableValue
{
struct
GenerateCtableValue
{
int
t
,
k
;
size_t
t
;
int
k
;
constexpr
auto
operator
()(
int
e
)
const
noexcept
{
constexpr
auto
operator
()(
int
e
)
const
noexcept
{
return
CalculateCtableValue
(
t
,
k
,
e
);
return
CalculateCtableValue
(
t
,
k
,
e
);
...
...
src/pcm/Dsd2Pcm.hxx
View file @
2d5bf532
...
@@ -40,7 +40,7 @@ or implied, of Sebastian Gesemann.
...
@@ -40,7 +40,7 @@ or implied, of Sebastian Gesemann.
class
Dsd2Pcm
{
class
Dsd2Pcm
{
public
:
public
:
/* must be a power of two */
/* must be a power of two */
static
constexpr
in
t
FIFOSIZE
=
16
;
static
constexpr
size_
t
FIFOSIZE
=
16
;
private
:
private
:
/** bit mask for FIFO offsets */
/** bit mask for FIFO offsets */
...
...
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