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
91bc41ea
Commit
91bc41ea
authored
Jan 14, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pcm/Dsd2Pcm: add `noexcept` and remove `extern`
parent
e565dcf1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
Dsd2Pcm.cxx
src/pcm/Dsd2Pcm.cxx
+13
-8
Dsd2Pcm.hxx
src/pcm/Dsd2Pcm.hxx
+11
-6
No files found.
src/pcm/Dsd2Pcm.cxx
View file @
91bc41ea
...
...
@@ -124,7 +124,8 @@ static constexpr double htaps[HTAPS] = {
static
float
ctables
[
CTABLES
][
256
];
static
int
precalculated
=
0
;
static
void
precalc
()
static
void
precalc
()
noexcept
{
int
t
,
e
,
m
,
k
;
double
acc
;
...
...
@@ -149,7 +150,8 @@ struct dsd2pcm_ctx_s
unsigned
fifopos
;
};
extern
dsd2pcm_ctx
*
dsd2pcm_init
()
dsd2pcm_ctx
*
dsd2pcm_init
()
noexcept
{
dsd2pcm_ctx
*
ptr
;
if
(
!
precalculated
)
precalc
();
...
...
@@ -158,12 +160,14 @@ extern dsd2pcm_ctx* dsd2pcm_init()
return
ptr
;
}
extern
void
dsd2pcm_destroy
(
dsd2pcm_ctx
*
ptr
)
void
dsd2pcm_destroy
(
dsd2pcm_ctx
*
ptr
)
noexcept
{
free
(
ptr
);
}
extern
dsd2pcm_ctx
*
dsd2pcm_clone
(
dsd2pcm_ctx
*
ptr
)
dsd2pcm_ctx
*
dsd2pcm_clone
(
dsd2pcm_ctx
*
ptr
)
noexcept
{
dsd2pcm_ctx
*
p2
;
p2
=
(
dsd2pcm_ctx
*
)
malloc
(
sizeof
(
dsd2pcm_ctx
));
...
...
@@ -173,7 +177,8 @@ extern dsd2pcm_ctx* dsd2pcm_clone(dsd2pcm_ctx* ptr)
return
p2
;
}
extern
void
dsd2pcm_reset
(
dsd2pcm_ctx
*
ptr
)
void
dsd2pcm_reset
(
dsd2pcm_ctx
*
ptr
)
noexcept
{
int
i
;
for
(
i
=
0
;
i
<
FIFOSIZE
;
++
i
)
...
...
@@ -186,12 +191,12 @@ extern void dsd2pcm_reset(dsd2pcm_ctx* ptr)
*/
}
extern
void
dsd2pcm_translate
(
dsd2pcm_ctx
*
ptr
,
void
dsd2pcm_translate
(
dsd2pcm_ctx
*
ptr
,
size_t
samples
,
const
unsigned
char
*
src
,
ptrdiff_t
src_stride
,
int
lsbf
,
float
*
dst
,
ptrdiff_t
dst_stride
)
float
*
dst
,
ptrdiff_t
dst_stride
)
noexcept
{
unsigned
ffp
;
unsigned
i
;
...
...
src/pcm/Dsd2Pcm.hxx
View file @
91bc41ea
...
...
@@ -45,24 +45,28 @@ typedef struct dsd2pcm_ctx_s dsd2pcm_ctx;
* POSIX thread-safety definition because it modifies global state
* (lookup tables are computed during the first call)
*/
extern
dsd2pcm_ctx
*
dsd2pcm_init
();
dsd2pcm_ctx
*
dsd2pcm_init
()
noexcept
;
/**
* deinitializes a "dsd2pcm engine"
* (releases memory, don't forget!)
*/
extern
void
dsd2pcm_destroy
(
dsd2pcm_ctx
*
ctx
);
void
dsd2pcm_destroy
(
dsd2pcm_ctx
*
ctx
)
noexcept
;
/**
* clones the context and returns a pointer to the
* newly allocated copy
*/
extern
dsd2pcm_ctx
*
dsd2pcm_clone
(
dsd2pcm_ctx
*
ctx
);
dsd2pcm_ctx
*
dsd2pcm_clone
(
dsd2pcm_ctx
*
ctx
)
noexcept
;
/**
* resets the internal state for a fresh new stream
*/
extern
void
dsd2pcm_reset
(
dsd2pcm_ctx
*
ctx
);
void
dsd2pcm_reset
(
dsd2pcm_ctx
*
ctx
)
noexcept
;
/**
* "translates" a stream of octets to a stream of floats
...
...
@@ -75,11 +79,12 @@ extern void dsd2pcm_reset(dsd2pcm_ctx *ctx);
* @param dst -- pointer to first float (output)
* @param dst_stride -- dst pointer increment
*/
extern
void
dsd2pcm_translate
(
dsd2pcm_ctx
*
ctx
,
void
dsd2pcm_translate
(
dsd2pcm_ctx
*
ctx
,
size_t
samples
,
const
unsigned
char
*
src
,
ptrdiff_t
src_stride
,
int
lsbitfirst
,
float
*
dst
,
ptrdiff_t
dst_stride
)
;
float
*
dst
,
ptrdiff_t
dst_stride
)
noexcept
;
#endif
/* include guard DSD2PCM_H_INCLUDED */
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