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
9bcd425a
Commit
9bcd425a
authored
Nov 13, 2021
by
Rosen Penev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
array conversions
Signed-off-by:
Rosen Penev
<
rosenp@gmail.com
>
parent
e08c85ae
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
10 deletions
+12
-10
SignalMonitor.cxx
src/event/SignalMonitor.cxx
+5
-4
AlsaOutputPlugin.cxx
src/output/plugins/AlsaOutputPlugin.cxx
+1
-1
Dsd2Pcm.cxx
src/pcm/Dsd2Pcm.cxx
+2
-2
Dsd2Pcm.hxx
src/pcm/Dsd2Pcm.hxx
+1
-1
UriUtil.cxx
src/util/UriUtil.cxx
+3
-2
No files found.
src/event/SignalMonitor.cxx
View file @
9bcd425a
...
...
@@ -37,6 +37,7 @@
#endif
#include <algorithm>
#include <array>
#include <cassert>
#include <csignal>
...
...
@@ -90,12 +91,12 @@ private:
/* this should be enough - is it? */
static
constexpr
unsigned
MAX_SIGNAL
=
64
;
static
SignalHandler
signal_handlers
[
MAX_SIGNAL
]
;
static
std
::
array
<
SignalHandler
,
MAX_SIGNAL
>
signal_handlers
;
#ifdef USE_SIGNALFD
static
sigset_t
signal_mask
;
#else
static
std
::
a
tomic_bool
signal_pending
[
MAX_SIGNAL
]
;
static
std
::
a
rray
<
std
::
atomic_bool
,
MAX_SIGNAL
>
signal_pending
;
#endif
static
Manual
<
SignalMonitor
>
monitor
;
...
...
@@ -153,7 +154,7 @@ void
SignalMonitorFinish
()
noexcept
{
#ifdef USE_SIGNALFD
s
td
::
fill_n
(
signal_handlers
,
MAX_SIGNAL
,
nullptr
)
;
s
ignal_handlers
=
{}
;
#else
struct
sigaction
sa
;
sa
.
sa_flags
=
0
;
...
...
@@ -167,7 +168,7 @@ SignalMonitorFinish() noexcept
}
}
std
::
fill
_n
(
signal_pending
,
MAX_SIGNAL
,
false
);
std
::
fill
(
signal_pending
.
begin
(),
signal_pending
.
end
()
,
false
);
#endif
monitor
.
Destruct
();
...
...
src/output/plugins/AlsaOutputPlugin.cxx
View file @
9bcd425a
...
...
@@ -760,7 +760,7 @@ Play_44_1_Silence(snd_pcm_t *pcm)
throw
Alsa
::
MakeError
(
err
,
"snd_pcm_prepare() failed"
);
AllocatedArray
<
int16_t
>
buffer
{
channels
*
period_size
};
std
::
fill
(
buffer
.
begin
(),
buffer
.
end
(),
0
)
;
buffer
=
{}
;
/* play at least 250ms of silence */
for
(
snd_pcm_uframes_t
remaining_frames
=
rate
/
4
;;)
{
...
...
src/pcm/Dsd2Pcm.cxx
View file @
9bcd425a
...
...
@@ -172,7 +172,7 @@ void
Dsd2Pcm
::
Reset
()
noexcept
{
/* my favorite silence pattern */
std
::
fill_n
(
fifo
,
std
::
size
(
fifo
),
0x69
);
fifo
.
fill
(
0x69
);
fifopos
=
0
;
/* 0x69 = 01101001
...
...
@@ -186,7 +186,7 @@ inline void
Dsd2Pcm
::
ApplySample
(
size_t
ffp
,
uint8_t
src
)
noexcept
{
fifo
[
ffp
]
=
src
;
uint8_t
*
p
=
fifo
+
((
ffp
-
CTABLES
)
&
FIFOMASK
);
uint8_t
*
p
=
fifo
.
data
()
+
((
ffp
-
CTABLES
)
&
FIFOMASK
);
*
p
=
bit_reverse
(
*
p
);
}
...
...
src/pcm/Dsd2Pcm.hxx
View file @
9bcd425a
...
...
@@ -51,7 +51,7 @@ private:
/** bit mask for FIFO offsets */
static
constexpr
size_t
FIFOMASK
=
FIFOSIZE
-
1
;
uint8_t
fifo
[
FIFOSIZE
]
;
std
::
array
<
uint8_t
,
FIFOSIZE
>
fifo
;
size_t
fifopos
;
public
:
...
...
src/util/UriUtil.cxx
View file @
9bcd425a
...
...
@@ -31,6 +31,7 @@
#include "ASCII.hxx"
#include "SplitString.hxx"
#include <array>
#include <cassert>
#include <cstring>
...
...
@@ -73,7 +74,7 @@ gcc_pure
static
const
char
*
SkipUriScheme
(
const
char
*
uri
)
noexcept
{
static
const
char
*
const
schemes
[]
=
{
static
const
expr
auto
schemes
=
std
::
array
{
"http://"
,
"https://"
,
"ftp://"
,
"smb://"
,
...
...
@@ -100,7 +101,7 @@ uri_remove_auth(const char *uri) noexcept
if
(
slash
==
nullptr
)
slash
=
auth
+
strlen
(
auth
);
const
char
*
at
=
(
const
char
*
)
std
::
memchr
(
auth
,
'@'
,
slash
-
auth
);
auto
at
=
(
const
char
*
)
std
::
memchr
(
auth
,
'@'
,
slash
-
auth
);
if
(
at
==
nullptr
)
/* no auth info present, do nothing */
return
std
::
string
();
...
...
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