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
72ec641f
Commit
72ec641f
authored
Feb 01, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*: use `auto`
parent
4f22f4d3
Hide whitespace changes
Inline
Side-by-side
Showing
51 changed files
with
87 additions
and
87 deletions
+87
-87
IcyMetaDataParser.cxx
src/IcyMetaDataParser.cxx
+2
-2
Main.cxx
src/Main.cxx
+1
-1
New.cxx
src/client/New.cxx
+1
-1
StickerCommands.cxx
src/command/StickerCommands.cxx
+1
-1
File.cxx
src/config/File.cxx
+2
-2
ProxyDatabasePlugin.cxx
src/db/plugins/ProxyDatabasePlugin.cxx
+2
-2
Directory.cxx
src/db/plugins/simple/Directory.cxx
+1
-1
UpnpDatabasePlugin.cxx
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+1
-1
InotifySource.cxx
src/db/update/InotifySource.cxx
+1
-1
Bridge.cxx
src/decoder/Bridge.cxx
+1
-1
DecoderAPI.cxx
src/decoder/DecoderAPI.cxx
+1
-1
AudiofileDecoderPlugin.cxx
src/decoder/plugins/AudiofileDecoderPlugin.cxx
+2
-2
DsdLib.cxx
src/decoder/plugins/DsdLib.cxx
+1
-1
FaadDecoderPlugin.cxx
src/decoder/plugins/FaadDecoderPlugin.cxx
+1
-1
FlacInput.cxx
src/decoder/plugins/FlacInput.cxx
+6
-6
MpcdecDecoderPlugin.cxx
src/decoder/plugins/MpcdecDecoderPlugin.cxx
+5
-5
OpusHead.cxx
src/decoder/plugins/OpusHead.cxx
+1
-1
VorbisDecoderPlugin.cxx
src/decoder/plugins/VorbisDecoderPlugin.cxx
+2
-2
WavpackDecoderPlugin.cxx
src/decoder/plugins/WavpackDecoderPlugin.cxx
+2
-2
LameEncoderPlugin.cxx
src/encoder/plugins/LameEncoderPlugin.cxx
+1
-1
OpusEncoderPlugin.cxx
src/encoder/plugins/OpusEncoderPlugin.cxx
+2
-2
ShineEncoderPlugin.cxx
src/encoder/plugins/ShineEncoderPlugin.cxx
+1
-1
TwolameEncoderPlugin.cxx
src/encoder/plugins/TwolameEncoderPlugin.cxx
+1
-1
ChainFilterPlugin.cxx
src/filter/plugins/ChainFilterPlugin.cxx
+1
-1
ConvertFilterPlugin.cxx
src/filter/plugins/ConvertFilterPlugin.cxx
+1
-1
NormalizeFilterPlugin.cxx
src/filter/plugins/NormalizeFilterPlugin.cxx
+1
-1
RouteFilterPlugin.cxx
src/filter/plugins/RouteFilterPlugin.cxx
+2
-2
VolumeFilterPlugin.cxx
src/filter/plugins/VolumeFilterPlugin.cxx
+2
-2
AutoGunzipReader.cxx
src/fs/io/AutoGunzipReader.cxx
+1
-1
InputStream.cxx
src/input/InputStream.cxx
+1
-1
Connection.cxx
src/lib/nfs/Connection.cxx
+2
-2
FlacIOHandle.cxx
src/lib/xiph/FlacIOHandle.cxx
+4
-4
AlsaMixerPlugin.cxx
src/mixer/plugins/AlsaMixerPlugin.cxx
+1
-1
PulseMixerPlugin.cxx
src/mixer/plugins/PulseMixerPlugin.cxx
+3
-3
SoftwareMixerPlugin.cxx
src/mixer/plugins/SoftwareMixerPlugin.cxx
+1
-1
ToString.cxx
src/net/ToString.cxx
+1
-1
JackOutputPlugin.cxx
src/output/plugins/JackOutputPlugin.cxx
+2
-2
PulseOutputPlugin.cxx
src/output/plugins/PulseOutputPlugin.cxx
+2
-2
RecorderOutputPlugin.cxx
src/output/plugins/RecorderOutputPlugin.cxx
+1
-1
Export.cxx
src/pcm/Export.cxx
+3
-3
Pack.cxx
src/pcm/Pack.cxx
+1
-1
PcmDsd.cxx
src/pcm/PcmDsd.cxx
+1
-1
SoxrResampler.cxx
src/pcm/SoxrResampler.cxx
+2
-2
AsxPlaylistPlugin.cxx
src/playlist/plugins/AsxPlaylistPlugin.cxx
+3
-3
RssPlaylistPlugin.cxx
src/playlist/plugins/RssPlaylistPlugin.cxx
+3
-3
XspfPlaylistPlugin.cxx
src/playlist/plugins/XspfPlaylistPlugin.cxx
+3
-3
SongSticker.cxx
src/sticker/SongSticker.cxx
+1
-1
NfsStorage.cxx
src/storage/plugins/NfsStorage.cxx
+1
-1
FileDescriptor.cxx
src/system/FileDescriptor.cxx
+1
-1
TestRewindInputStream.cxx
test/TestRewindInputStream.cxx
+1
-1
test_pcm_format.cxx
test/test_pcm_format.cxx
+2
-2
No files found.
src/IcyMetaDataParser.cxx
View file @
72ec641f
...
...
@@ -194,7 +194,7 @@ icy_parse_tag(
size_t
IcyMetaDataParser
::
Meta
(
const
void
*
data
,
size_t
length
)
noexcept
{
const
unsigned
char
*
p
=
(
const
unsigned
char
*
)
data
;
const
auto
*
p
=
(
const
unsigned
char
*
)
data
;
assert
(
IsDefined
());
assert
(
data_rest
==
0
);
...
...
@@ -254,7 +254,7 @@ IcyMetaDataParser::Meta(const void *data, size_t length) noexcept
size_t
IcyMetaDataParser
::
ParseInPlace
(
void
*
data
,
size_t
length
)
noexcept
{
uint8_t
*
const
dest0
=
(
uint8_t
*
)
data
;
auto
*
const
dest0
=
(
uint8_t
*
)
data
;
uint8_t
*
dest
=
dest0
;
const
uint8_t
*
src
=
dest0
;
...
...
src/Main.cxx
View file @
72ec641f
...
...
@@ -172,7 +172,7 @@ InitStorage(Instance &instance, EventLoop &event_loop,
if
(
storage
==
nullptr
)
return
;
CompositeStorage
*
composite
=
new
CompositeStorage
();
auto
*
composite
=
new
CompositeStorage
();
instance
.
storage
=
composite
;
composite
->
Mount
(
""
,
std
::
move
(
storage
));
}
...
...
src/client/New.cxx
View file @
72ec641f
...
...
@@ -67,7 +67,7 @@ client_new(EventLoop &loop, Partition &partition,
(
void
)
fd
.
Write
(
GREETING
,
sizeof
(
GREETING
)
-
1
);
const
unsigned
num
=
next_client_num
++
;
Client
*
client
=
new
Client
(
loop
,
partition
,
std
::
move
(
fd
),
uid
,
auto
*
client
=
new
Client
(
loop
,
partition
,
std
::
move
(
fd
),
uid
,
permission
,
num
);
...
...
src/command/StickerCommands.cxx
View file @
72ec641f
...
...
@@ -42,7 +42,7 @@ static void
sticker_song_find_print_cb
(
const
LightSong
&
song
,
const
char
*
value
,
void
*
user_data
)
{
struct
sticker_song_find_data
*
data
=
auto
*
data
=
(
struct
sticker_song_find_data
*
)
user_data
;
song_print_uri
(
data
->
r
,
song
);
...
...
src/config/File.cxx
View file @
72ec641f
...
...
@@ -112,7 +112,7 @@ ReadConfigBlock(ConfigData &config_data, BufferedReader &reader,
const
char
*
name
,
ConfigBlockOption
o
,
Tokenizer
&
tokenizer
)
{
const
unsigned
i
=
unsigned
(
o
);
const
auto
i
=
unsigned
(
o
);
const
ConfigTemplate
&
option
=
config_block_templates
[
i
];
if
(
option
.
deprecated
)
...
...
@@ -144,7 +144,7 @@ ReadConfigParam(ConfigData &config_data, BufferedReader &reader,
const
char
*
name
,
ConfigOption
o
,
Tokenizer
&
tokenizer
)
{
const
unsigned
i
=
unsigned
(
o
);
const
auto
i
=
unsigned
(
o
);
const
ConfigTemplate
&
option
=
config_param_templates
[
i
];
if
(
option
.
deprecated
)
...
...
src/db/plugins/ProxyDatabasePlugin.cxx
View file @
72ec641f
...
...
@@ -584,7 +584,7 @@ ProxyDatabase::OnSocketReady(gcc_unused unsigned flags) noexcept
return
true
;
}
unsigned
idle
=
(
unsigned
)
mpd_recv_idle
(
connection
,
false
);
auto
idle
=
(
unsigned
)
mpd_recv_idle
(
connection
,
false
);
if
(
idle
==
0
)
{
try
{
CheckError
(
connection
);
...
...
@@ -666,7 +666,7 @@ ProxyDatabase::ReturnSong(const LightSong *_song) const noexcept
{
assert
(
_song
!=
nullptr
);
AllocatedProxySong
*
song
=
(
AllocatedProxySong
*
)
auto
*
song
=
(
AllocatedProxySong
*
)
const_cast
<
LightSong
*>
(
_song
);
delete
song
;
}
...
...
src/db/plugins/simple/Directory.cxx
View file @
72ec641f
...
...
@@ -83,7 +83,7 @@ Directory::CreateChild(const char *name_utf8) noexcept
?
std
::
string
(
name_utf8
)
:
PathTraitsUTF8
::
Build
(
GetPath
(),
name_utf8
);
Directory
*
child
=
new
Directory
(
std
::
move
(
path_utf8
),
this
);
auto
*
child
=
new
Directory
(
std
::
move
(
path_utf8
),
this
);
children
.
push_back
(
*
child
);
return
child
;
}
...
...
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
View file @
72ec641f
...
...
@@ -177,7 +177,7 @@ UpnpDatabase::ReturnSong(const LightSong *_song) const noexcept
{
assert
(
_song
!=
nullptr
);
UpnpSong
*
song
=
(
UpnpSong
*
)
const_cast
<
LightSong
*>
(
_song
);
auto
*
song
=
(
UpnpSong
*
)
const_cast
<
LightSong
*>
(
_song
);
delete
song
;
}
...
...
src/db/update/InotifySource.cxx
View file @
72ec641f
...
...
@@ -47,7 +47,7 @@ InotifySource::OnSocketReady(gcc_unused unsigned flags) noexcept
while
(
true
)
{
const
size_t
remaining
=
end
-
p
;
const
struct
inotify_event
*
event
=
const
auto
*
event
=
(
const
struct
inotify_event
*
)
p
;
if
(
remaining
<
sizeof
(
*
event
)
||
remaining
<
sizeof
(
*
event
)
+
event
->
len
)
...
...
src/decoder/Bridge.cxx
View file @
72ec641f
...
...
@@ -480,7 +480,7 @@ DecoderBridge::SubmitData(InputStream *is,
if
(
dc
.
end_time
.
IsPositive
())
{
/* enforce the given end time */
const
uint64_t
end_frame
=
const
auto
end_frame
=
dc
.
end_time
.
ToScale
<
uint64_t
>
(
dc
.
in_audio_format
.
sample_rate
);
if
(
absolute_frame
>=
end_frame
)
return
DecoderCommand
::
STOP
;
...
...
src/decoder/DecoderAPI.cxx
View file @
72ec641f
...
...
@@ -46,7 +46,7 @@ bool
decoder_read_full
(
DecoderClient
*
client
,
InputStream
&
is
,
void
*
_buffer
,
size_t
size
)
{
uint8_t
*
buffer
=
(
uint8_t
*
)
_buffer
;
auto
*
buffer
=
(
uint8_t
*
)
_buffer
;
while
(
size
>
0
)
{
size_t
nbytes
=
decoder_read
(
client
,
is
,
buffer
,
size
);
...
...
src/decoder/plugins/AudiofileDecoderPlugin.cxx
View file @
72ec641f
...
...
@@ -209,10 +209,10 @@ audiofile_stream_decode(DecoderClient &client, InputStream &is)
const
auto
audio_format
=
CheckAudioFormat
(
fh
);
const
auto
total_time
=
audiofile_get_duration
(
fh
);
const
uint16_t
kbit_rate
=
(
uint16_t
)
const
auto
kbit_rate
=
(
uint16_t
)
(
is
.
GetSize
()
*
uint64_t
(
8
)
/
total_time
.
ToMS
());
const
unsigned
frame_size
=
(
unsigned
)
const
auto
frame_size
=
(
unsigned
)
afGetVirtualFrameSize
(
fh
,
AF_DEFAULT_TRACK
,
true
);
client
.
Ready
(
audio_format
,
true
,
total_time
);
...
...
src/decoder/plugins/DsdLib.cxx
View file @
72ec641f
...
...
@@ -133,7 +133,7 @@ dsdlib_tag_id3(InputStream &is, TagHandler &handler,
const
id3_length_t
count
=
count64
;
id3_byte_t
*
const
id3_buf
=
new
id3_byte_t
[
count
];
auto
*
const
id3_buf
=
new
id3_byte_t
[
count
];
if
(
id3_buf
==
nullptr
)
return
;
...
...
src/decoder/plugins/FaadDecoderPlugin.cxx
View file @
72ec641f
...
...
@@ -72,7 +72,7 @@ adts_find_frame(DecoderBuffer &buffer)
return
0
;
/* find the 0xff marker */
const
uint8_t
*
p
=
(
const
uint8_t
*
)
const
auto
*
p
=
(
const
uint8_t
*
)
memchr
(
data
.
data
,
0xff
,
data
.
size
);
if
(
p
==
nullptr
)
{
/* no marker - discard the buffer */
...
...
src/decoder/plugins/FlacInput.cxx
View file @
72ec641f
...
...
@@ -102,7 +102,7 @@ FlacInput::Read(gcc_unused const FLAC__StreamDecoder *flac_decoder,
FLAC__byte
buffer
[],
size_t
*
bytes
,
void
*
client_data
)
{
FlacInput
*
i
=
(
FlacInput
*
)
client_data
;
auto
*
i
=
(
FlacInput
*
)
client_data
;
return
i
->
Read
(
buffer
,
bytes
);
}
...
...
@@ -111,7 +111,7 @@ FLAC__StreamDecoderSeekStatus
FlacInput
::
Seek
(
gcc_unused
const
FLAC__StreamDecoder
*
flac_decoder
,
FLAC__uint64
absolute_byte_offset
,
void
*
client_data
)
{
FlacInput
*
i
=
(
FlacInput
*
)
client_data
;
auto
*
i
=
(
FlacInput
*
)
client_data
;
return
i
->
Seek
(
absolute_byte_offset
);
}
...
...
@@ -120,7 +120,7 @@ FLAC__StreamDecoderTellStatus
FlacInput
::
Tell
(
gcc_unused
const
FLAC__StreamDecoder
*
flac_decoder
,
FLAC__uint64
*
absolute_byte_offset
,
void
*
client_data
)
{
FlacInput
*
i
=
(
FlacInput
*
)
client_data
;
auto
*
i
=
(
FlacInput
*
)
client_data
;
return
i
->
Tell
(
absolute_byte_offset
);
}
...
...
@@ -129,7 +129,7 @@ FLAC__StreamDecoderLengthStatus
FlacInput
::
Length
(
gcc_unused
const
FLAC__StreamDecoder
*
flac_decoder
,
FLAC__uint64
*
stream_length
,
void
*
client_data
)
{
FlacInput
*
i
=
(
FlacInput
*
)
client_data
;
auto
*
i
=
(
FlacInput
*
)
client_data
;
return
i
->
Length
(
stream_length
);
}
...
...
@@ -138,7 +138,7 @@ FLAC__bool
FlacInput
::
Eof
(
gcc_unused
const
FLAC__StreamDecoder
*
flac_decoder
,
void
*
client_data
)
{
FlacInput
*
i
=
(
FlacInput
*
)
client_data
;
auto
*
i
=
(
FlacInput
*
)
client_data
;
return
i
->
Eof
();
}
...
...
@@ -147,7 +147,7 @@ void
FlacInput
::
Error
(
gcc_unused
const
FLAC__StreamDecoder
*
decoder
,
FLAC__StreamDecoderErrorStatus
status
,
void
*
client_data
)
{
FlacInput
*
i
=
(
FlacInput
*
)
client_data
;
auto
*
i
=
(
FlacInput
*
)
client_data
;
i
->
Error
(
status
);
}
...
...
src/decoder/plugins/MpcdecDecoderPlugin.cxx
View file @
72ec641f
...
...
@@ -50,7 +50,7 @@ using MpcdecSampleTraits = SampleTraits<mpcdec_sample_format>;
static
mpc_int32_t
mpc_read_cb
(
mpc_reader
*
reader
,
void
*
ptr
,
mpc_int32_t
size
)
{
struct
mpc_decoder_data
*
data
=
auto
*
data
=
(
struct
mpc_decoder_data
*
)
reader
->
data
;
return
decoder_read
(
data
->
client
,
data
->
is
,
ptr
,
size
);
...
...
@@ -59,7 +59,7 @@ mpc_read_cb(mpc_reader *reader, void *ptr, mpc_int32_t size)
static
mpc_bool_t
mpc_seek_cb
(
mpc_reader
*
reader
,
mpc_int32_t
offset
)
{
struct
mpc_decoder_data
*
data
=
auto
*
data
=
(
struct
mpc_decoder_data
*
)
reader
->
data
;
try
{
...
...
@@ -73,7 +73,7 @@ mpc_seek_cb(mpc_reader *reader, mpc_int32_t offset)
static
mpc_int32_t
mpc_tell_cb
(
mpc_reader
*
reader
)
{
struct
mpc_decoder_data
*
data
=
auto
*
data
=
(
struct
mpc_decoder_data
*
)
reader
->
data
;
return
(
long
)
data
->
is
.
GetOffset
();
...
...
@@ -82,7 +82,7 @@ mpc_tell_cb(mpc_reader *reader)
static
mpc_bool_t
mpc_canseek_cb
(
mpc_reader
*
reader
)
{
struct
mpc_decoder_data
*
data
=
auto
*
data
=
(
struct
mpc_decoder_data
*
)
reader
->
data
;
return
data
->
is
.
IsSeekable
();
...
...
@@ -91,7 +91,7 @@ mpc_canseek_cb(mpc_reader *reader)
static
mpc_int32_t
mpc_getsize_cb
(
mpc_reader
*
reader
)
{
struct
mpc_decoder_data
*
data
=
auto
*
data
=
(
struct
mpc_decoder_data
*
)
reader
->
data
;
if
(
!
data
->
is
.
KnownSize
())
...
...
src/decoder/plugins/OpusHead.cxx
View file @
72ec641f
...
...
@@ -33,7 +33,7 @@ struct OpusHead {
bool
ScanOpusHeader
(
const
void
*
data
,
size_t
size
,
unsigned
&
channels_r
)
{
const
OpusHead
*
h
=
(
const
OpusHead
*
)
data
;
const
auto
*
h
=
(
const
OpusHead
*
)
data
;
if
(
size
<
19
||
(
h
->
version
&
0xf0
)
!=
0
)
return
false
;
...
...
src/decoder/plugins/VorbisDecoderPlugin.cxx
View file @
72ec641f
...
...
@@ -146,7 +146,7 @@ void
VorbisDecoder
::
OnOggBeginning
(
const
ogg_packet
&
_packet
)
{
/* libvorbis wants non-const packets */
ogg_packet
&
packet
=
const_cast
<
ogg_packet
&>
(
_packet
);
auto
&
packet
=
const_cast
<
ogg_packet
&>
(
_packet
);
ReinitVorbis
();
...
...
@@ -251,7 +251,7 @@ void
VorbisDecoder
::
OnOggPacket
(
const
ogg_packet
&
_packet
)
{
/* libvorbis wants non-const packets */
ogg_packet
&
packet
=
const_cast
<
ogg_packet
&>
(
_packet
);
auto
&
packet
=
const_cast
<
ogg_packet
&>
(
_packet
);
if
(
remaining_header_packets
>
0
)
{
if
(
vorbis_synthesis_headerin
(
&
vi
,
&
vc
,
&
packet
)
!=
0
)
...
...
src/decoder/plugins/WavpackDecoderPlugin.cxx
View file @
72ec641f
...
...
@@ -127,7 +127,7 @@ template<typename T>
static
void
format_samples_int
(
void
*
buffer
,
uint32_t
count
)
{
int32_t
*
src
=
(
int32_t
*
)
buffer
;
auto
*
src
=
(
int32_t
*
)
buffer
;
T
*
dst
=
(
T
*
)
buffer
;
/*
* The asserts like the following one are because we do the
...
...
@@ -368,7 +368,7 @@ wavpack_input_read_bytes(void *id, void *data, int32_t bcount)
int32_t
WavpackInput
::
ReadBytes
(
void
*
data
,
size_t
bcount
)
{
uint8_t
*
buf
=
(
uint8_t
*
)
data
;
auto
*
buf
=
(
uint8_t
*
)
data
;
int32_t
i
=
0
;
if
(
last_byte
!=
EOF
)
{
...
...
src/encoder/plugins/LameEncoderPlugin.cxx
View file @
72ec641f
...
...
@@ -166,7 +166,7 @@ LameEncoder::~LameEncoder() noexcept
void
LameEncoder
::
Write
(
const
void
*
data
,
size_t
length
)
{
const
int16_t
*
src
=
(
const
int16_t
*
)
data
;
const
auto
*
src
=
(
const
int16_t
*
)
data
;
assert
(
output_begin
==
output_end
);
...
...
src/encoder/plugins/OpusEncoderPlugin.cxx
View file @
72ec641f
...
...
@@ -248,7 +248,7 @@ OpusEncoder::WriteSilence(unsigned fill_frames)
void
OpusEncoder
::
Write
(
const
void
*
_data
,
size_t
length
)
{
const
uint8_t
*
data
=
(
const
uint8_t
*
)
_data
;
const
auto
*
data
=
(
const
uint8_t
*
)
_data
;
if
(
lookahead
>
0
)
{
/* generate some silence at the beginning of the
...
...
@@ -323,7 +323,7 @@ OpusEncoder::GenerateTags(const Tag *tag) noexcept
}
}
unsigned
char
*
comments
=
new
unsigned
char
[
comments_size
];
auto
*
comments
=
new
unsigned
char
[
comments_size
];
unsigned
char
*
p
=
comments
;
memcpy
(
comments
,
"OpusTags"
,
8
);
...
...
src/encoder/plugins/ShineEncoderPlugin.cxx
View file @
72ec641f
...
...
@@ -167,7 +167,7 @@ ShineEncoder::WriteChunk(bool flush)
void
ShineEncoder
::
Write
(
const
void
*
_data
,
size_t
length
)
{
const
int16_t
*
data
=
(
const
int16_t
*
)
_data
;
const
auto
*
data
=
(
const
int16_t
*
)
_data
;
length
/=
sizeof
(
*
data
)
*
audio_format
.
channels
;
size_t
written
=
0
;
...
...
src/encoder/plugins/TwolameEncoderPlugin.cxx
View file @
72ec641f
...
...
@@ -186,7 +186,7 @@ TwolameEncoder::~TwolameEncoder() noexcept
void
TwolameEncoder
::
Write
(
const
void
*
data
,
size_t
length
)
{
const
int16_t
*
src
=
(
const
int16_t
*
)
data
;
const
auto
*
src
=
(
const
int16_t
*
)
data
;
assert
(
output_buffer_position
==
output_buffer_length
);
...
...
src/filter/plugins/ChainFilterPlugin.cxx
View file @
72ec641f
...
...
@@ -181,7 +181,7 @@ void
filter_chain_append
(
PreparedFilter
&
_chain
,
const
char
*
name
,
std
::
unique_ptr
<
PreparedFilter
>
filter
)
noexcept
{
PreparedChainFilter
&
chain
=
(
PreparedChainFilter
&
)
_chain
;
auto
&
chain
=
(
PreparedChainFilter
&
)
_chain
;
chain
.
Append
(
name
,
std
::
move
(
filter
));
}
src/filter/plugins/ConvertFilterPlugin.cxx
View file @
72ec641f
...
...
@@ -130,7 +130,7 @@ convert_filter_new(const AudioFormat in_audio_format,
void
convert_filter_set
(
Filter
*
_filter
,
AudioFormat
out_audio_format
)
{
ConvertFilter
*
filter
=
(
ConvertFilter
*
)
_filter
;
auto
*
filter
=
(
ConvertFilter
*
)
_filter
;
filter
->
Set
(
out_audio_format
);
}
src/filter/plugins/NormalizeFilterPlugin.cxx
View file @
72ec641f
...
...
@@ -69,7 +69,7 @@ PreparedNormalizeFilter::Open(AudioFormat &audio_format)
ConstBuffer
<
void
>
NormalizeFilter
::
FilterPCM
(
ConstBuffer
<
void
>
src
)
{
int16_t
*
dest
=
(
int16_t
*
)
buffer
.
Get
(
src
.
size
);
auto
*
dest
=
(
int16_t
*
)
buffer
.
Get
(
src
.
size
);
memcpy
(
dest
,
src
.
data
,
src
.
size
);
Compressor_Process_int16
(
compressor
,
dest
,
src
.
size
/
2
);
...
...
src/filter/plugins/RouteFilterPlugin.cxx
View file @
72ec641f
...
...
@@ -230,14 +230,14 @@ RouteFilter::FilterPCM(ConstBuffer<void> src)
const
size_t
bytes_per_frame_per_channel
=
input_format
.
GetSampleSize
();
// A moving pointer that always refers to channel 0 in the input, at the currently handled frame
const
uint8_t
*
base_source
=
(
const
uint8_t
*
)
src
.
data
;
const
auto
*
base_source
=
(
const
uint8_t
*
)
src
.
data
;
// Grow our reusable buffer, if needed, and set the moving pointer
const
size_t
result_size
=
number_of_frames
*
output_frame_size
;
void
*
const
result
=
output_buffer
.
Get
(
result_size
);
// A moving pointer that always refers to the currently filled channel of the currently handled frame, in the output
uint8_t
*
chan_destination
=
(
uint8_t
*
)
result
;
auto
*
chan_destination
=
(
uint8_t
*
)
result
;
// Perform our copy operations, with N input channels and M output channels
for
(
unsigned
int
s
=
0
;
s
<
number_of_frames
;
++
s
)
{
...
...
src/filter/plugins/VolumeFilterPlugin.cxx
View file @
72ec641f
...
...
@@ -73,7 +73,7 @@ volume_filter_prepare() noexcept
unsigned
volume_filter_get
(
const
Filter
*
_filter
)
noexcept
{
const
VolumeFilter
*
filter
=
const
auto
*
filter
=
(
const
VolumeFilter
*
)
_filter
;
return
filter
->
GetVolume
();
...
...
@@ -82,7 +82,7 @@ volume_filter_get(const Filter *_filter) noexcept
void
volume_filter_set
(
Filter
*
_filter
,
unsigned
volume
)
noexcept
{
VolumeFilter
*
filter
=
(
VolumeFilter
*
)
_filter
;
auto
*
filter
=
(
VolumeFilter
*
)
_filter
;
filter
->
SetVolume
(
volume
);
}
src/fs/io/AutoGunzipReader.cxx
View file @
72ec641f
...
...
@@ -36,7 +36,7 @@ IsGzip(const uint8_t data[4]) noexcept
inline
void
AutoGunzipReader
::
Detect
()
{
const
uint8_t
*
data
=
(
const
uint8_t
*
)
peek
.
Peek
(
4
);
const
auto
*
data
=
(
const
uint8_t
*
)
peek
.
Peek
(
4
);
if
(
data
==
nullptr
)
{
next
=
&
peek
;
return
;
...
...
src/input/InputStream.cxx
View file @
72ec641f
...
...
@@ -124,7 +124,7 @@ InputStream::LockRead(void *ptr, size_t _size)
void
InputStream
::
ReadFull
(
std
::
unique_lock
<
Mutex
>
&
lock
,
void
*
_ptr
,
size_t
_size
)
{
uint8_t
*
ptr
=
(
uint8_t
*
)
_ptr
;
auto
*
ptr
=
(
uint8_t
*
)
_ptr
;
size_t
nbytes_total
=
0
;
while
(
_size
>
0
)
{
...
...
src/lib/nfs/Connection.cxx
View file @
72ec641f
...
...
@@ -160,7 +160,7 @@ NfsConnection::CancellableCallback::Callback(int err, void *data) noexcept
assert
(
close_fh
==
nullptr
);
if
(
err
>=
0
)
{
struct
nfsfh
*
fh
=
(
struct
nfsfh
*
)
data
;
auto
*
fh
=
(
struct
nfsfh
*
)
data
;
connection
.
Close
(
fh
);
}
}
else
if
(
close_fh
!=
nullptr
)
...
...
@@ -574,7 +574,7 @@ void
NfsConnection
::
MountCallback
(
int
status
,
nfs_context
*
nfs
,
void
*
data
,
void
*
private_data
)
noexcept
{
NfsConnection
*
c
=
(
NfsConnection
*
)
private_data
;
auto
*
c
=
(
NfsConnection
*
)
private_data
;
c
->
MountCallback
(
status
,
nfs
,
data
);
}
...
...
src/lib/xiph/FlacIOHandle.cxx
View file @
72ec641f
...
...
@@ -28,7 +28,7 @@
static
size_t
FlacIORead
(
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
FLAC__IOHandle
handle
)
{
InputStream
*
is
=
(
InputStream
*
)
handle
;
auto
*
is
=
(
InputStream
*
)
handle
;
uint8_t
*
const
p0
=
(
uint8_t
*
)
ptr
,
*
p
=
p0
,
*
const
end
=
p0
+
size
*
nmemb
;
...
...
@@ -70,7 +70,7 @@ FlacIORead(void *ptr, size_t size, size_t nmemb, FLAC__IOHandle handle)
static
int
FlacIOSeek
(
FLAC__IOHandle
handle
,
FLAC__int64
_offset
,
int
whence
)
{
InputStream
*
is
=
(
InputStream
*
)
handle
;
auto
*
is
=
(
InputStream
*
)
handle
;
offset_type
offset
=
_offset
;
switch
(
whence
)
{
...
...
@@ -104,7 +104,7 @@ FlacIOSeek(FLAC__IOHandle handle, FLAC__int64 _offset, int whence)
static
FLAC__int64
FlacIOTell
(
FLAC__IOHandle
handle
)
{
InputStream
*
is
=
(
InputStream
*
)
handle
;
auto
*
is
=
(
InputStream
*
)
handle
;
return
is
->
GetOffset
();
}
...
...
@@ -112,7 +112,7 @@ FlacIOTell(FLAC__IOHandle handle)
static
int
FlacIOEof
(
FLAC__IOHandle
handle
)
{
InputStream
*
is
=
(
InputStream
*
)
handle
;
auto
*
is
=
(
InputStream
*
)
handle
;
return
is
->
LockIsEOF
();
}
...
...
src/mixer/plugins/AlsaMixerPlugin.cxx
View file @
72ec641f
...
...
@@ -177,7 +177,7 @@ alsa_mixer_init(EventLoop &event_loop, gcc_unused AudioOutput &ao,
MixerListener
&
listener
,
const
ConfigBlock
&
block
)
{
AlsaMixer
*
am
=
new
AlsaMixer
(
event_loop
,
listener
);
auto
*
am
=
new
AlsaMixer
(
event_loop
,
listener
);
am
->
Configure
(
block
);
return
am
;
...
...
src/mixer/plugins/PulseMixerPlugin.cxx
View file @
72ec641f
...
...
@@ -108,7 +108,7 @@ static void
pulse_mixer_volume_cb
(
gcc_unused
pa_context
*
context
,
const
pa_sink_input_info
*
i
,
int
eol
,
void
*
userdata
)
{
PulseMixer
*
pm
=
(
PulseMixer
*
)
userdata
;
auto
*
pm
=
(
PulseMixer
*
)
userdata
;
pm
->
VolumeCallback
(
i
,
eol
);
}
...
...
@@ -187,9 +187,9 @@ pulse_mixer_init(gcc_unused EventLoop &event_loop, AudioOutput &ao,
MixerListener
&
listener
,
const
ConfigBlock
&
block
)
{
PulseOutput
&
po
=
(
PulseOutput
&
)
ao
;
auto
&
po
=
(
PulseOutput
&
)
ao
;
float
scale
=
parse_volume_scale_factor
(
block
.
GetBlockValue
(
"scale_volume"
));
PulseMixer
*
pm
=
new
PulseMixer
(
po
,
listener
,
scale
);
auto
*
pm
=
new
PulseMixer
(
po
,
listener
,
scale
);
pulse_output_set_mixer
(
po
,
*
pm
);
...
...
src/mixer/plugins/SoftwareMixerPlugin.cxx
View file @
72ec641f
...
...
@@ -108,6 +108,6 @@ SoftwareMixer::SetFilter(Filter *_filter) noexcept
void
software_mixer_set_filter
(
Mixer
&
mixer
,
Filter
*
filter
)
noexcept
{
SoftwareMixer
&
sm
=
(
SoftwareMixer
&
)
mixer
;
auto
&
sm
=
(
SoftwareMixer
&
)
mixer
;
sm
.
SetFilter
(
filter
);
}
src/net/ToString.cxx
View file @
72ec641f
...
...
@@ -56,7 +56,7 @@
static
std
::
string
LocalAddressToString
(
const
struct
sockaddr_un
&
s_un
,
size_t
size
)
noexcept
{
const
size_t
prefix_size
=
(
size_t
)
const
auto
prefix_size
=
(
size_t
)
((
struct
sockaddr_un
*
)
nullptr
)
->
sun_path
;
assert
(
size
>=
prefix_size
);
...
...
src/output/plugins/JackOutputPlugin.cxx
View file @
72ec641f
...
...
@@ -283,7 +283,7 @@ MultiReadAdvance(ConstBuffer<jack_ringbuffer_t *> buffers,
static
void
WriteSilence
(
jack_port_t
&
port
,
jack_nframes_t
nframes
)
{
jack_default_audio_sample_t
*
out
=
auto
*
out
=
(
jack_default_audio_sample_t
*
)
jack_port_get_buffer
(
&
port
,
nframes
);
if
(
out
==
nullptr
)
...
...
@@ -313,7 +313,7 @@ static void
Copy
(
jack_port_t
&
dest
,
jack_nframes_t
nframes
,
jack_ringbuffer_t
&
src
,
jack_nframes_t
available
)
{
jack_default_audio_sample_t
*
out
=
auto
*
out
=
(
jack_default_audio_sample_t
*
)
jack_port_get_buffer
(
&
dest
,
nframes
);
if
(
out
==
nullptr
)
...
...
src/output/plugins/PulseOutputPlugin.cxx
View file @
72ec641f
...
...
@@ -326,9 +326,9 @@ inline void
PulseOutput
::
OnServerLayoutChanged
(
pa_subscription_event_type_t
t
,
uint32_t
idx
)
{
pa_subscription_event_type_t
facility
=
auto
facility
=
pa_subscription_event_type_t
(
t
&
PA_SUBSCRIPTION_EVENT_FACILITY_MASK
);
pa_subscription_event_type_t
type
=
auto
type
=
pa_subscription_event_type_t
(
t
&
PA_SUBSCRIPTION_EVENT_TYPE_MASK
);
if
(
mixer
!=
nullptr
&&
...
...
src/output/plugins/RecorderOutputPlugin.cxx
View file @
72ec641f
...
...
@@ -251,7 +251,7 @@ RecorderOutput::ReopenFormat(AllocatedPath &&new_path)
assert
(
path
.
IsNull
());
assert
(
file
==
nullptr
);
FileOutputStream
*
new_file
=
new
FileOutputStream
(
new_path
);
auto
*
new_file
=
new
FileOutputStream
(
new_path
);
AudioFormat
new_audio_format
=
effective_audio_format
;
...
...
src/pcm/Export.cxx
View file @
72ec641f
...
...
@@ -297,7 +297,7 @@ PcmExport::Export(ConstBuffer<void> data) noexcept
const
auto
src
=
ConstBuffer
<
int32_t
>::
FromVoid
(
data
);
const
size_t
num_samples
=
src
.
size
;
const
size_t
dest_size
=
num_samples
*
3
;
uint8_t
*
dest
=
(
uint8_t
*
)
pack_buffer
.
Get
(
dest_size
);
auto
*
dest
=
(
uint8_t
*
)
pack_buffer
.
Get
(
dest_size
);
assert
(
dest
!=
nullptr
);
pcm_pack_24
(
dest
,
src
.
begin
(),
src
.
end
());
...
...
@@ -307,7 +307,7 @@ PcmExport::Export(ConstBuffer<void> data) noexcept
}
else
if
(
shift8
)
{
const
auto
src
=
ConstBuffer
<
int32_t
>::
FromVoid
(
data
);
uint32_t
*
dest
=
(
uint32_t
*
)
pack_buffer
.
Get
(
data
.
size
);
auto
*
dest
=
(
uint32_t
*
)
pack_buffer
.
Get
(
data
.
size
);
data
.
data
=
dest
;
for
(
auto
i
:
src
)
...
...
@@ -319,7 +319,7 @@ PcmExport::Export(ConstBuffer<void> data) noexcept
const
auto
src
=
ConstBuffer
<
uint8_t
>::
FromVoid
(
data
);
uint8_t
*
dest
=
(
uint8_t
*
)
reverse_buffer
.
Get
(
data
.
size
);
auto
*
dest
=
(
uint8_t
*
)
reverse_buffer
.
Get
(
data
.
size
);
assert
(
dest
!=
nullptr
);
data
.
data
=
dest
;
...
...
src/pcm/Pack.cxx
View file @
72ec641f
...
...
@@ -23,7 +23,7 @@
static
void
pack_sample
(
uint8_t
*
dest
,
const
int32_t
*
src0
)
noexcept
{
const
uint8_t
*
src
=
(
const
uint8_t
*
)
src0
;
const
auto
*
src
=
(
const
uint8_t
*
)
src0
;
if
(
IsBigEndian
())
++
src
;
...
...
src/pcm/PcmDsd.cxx
View file @
72ec641f
...
...
@@ -33,7 +33,7 @@ PcmDsd::ToFloat(unsigned channels, ConstBuffer<uint8_t> src) noexcept
const
size_t
num_samples
=
src
.
size
;
const
size_t
num_frames
=
src
.
size
/
channels
;
float
*
dest
=
buffer
.
GetT
<
float
>
(
num_samples
);
auto
*
dest
=
buffer
.
GetT
<
float
>
(
num_samples
);
dsd2pcm
.
Translate
(
channels
,
num_frames
,
src
.
data
,
dest
);
return
{
dest
,
num_samples
};
...
...
src/pcm/SoxrResampler.cxx
View file @
72ec641f
...
...
@@ -157,7 +157,7 @@ SoxrPcmResampler::Resample(ConstBuffer<void> src)
/* always round up: worst case output buffer size */
const
size_t
o_frames
=
size_t
(
n_frames
*
ratio
)
+
1
;
float
*
output_buffer
=
(
float
*
)
buffer
.
Get
(
o_frames
*
frame_size
);
auto
*
output_buffer
=
(
float
*
)
buffer
.
Get
(
o_frames
*
frame_size
);
size_t
i_done
,
o_done
;
soxr_error_t
e
=
soxr_process
(
soxr
,
src
.
data
,
n_frames
,
&
i_done
,
...
...
@@ -174,7 +174,7 @@ SoxrPcmResampler::Flush()
const
size_t
frame_size
=
channels
*
sizeof
(
float
);
const
size_t
o_frames
=
1024
;
float
*
output_buffer
=
(
float
*
)
buffer
.
Get
(
o_frames
*
frame_size
);
auto
*
output_buffer
=
(
float
*
)
buffer
.
Get
(
o_frames
*
frame_size
);
size_t
o_done
;
soxr_error_t
e
=
soxr_process
(
soxr
,
nullptr
,
0
,
nullptr
,
...
...
src/playlist/plugins/AsxPlaylistPlugin.cxx
View file @
72ec641f
...
...
@@ -65,7 +65,7 @@ static void XMLCALL
asx_start_element
(
void
*
user_data
,
const
XML_Char
*
element_name
,
const
XML_Char
**
atts
)
{
AsxParser
*
parser
=
(
AsxParser
*
)
user_data
;
auto
*
parser
=
(
AsxParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
AsxParser
:
:
ROOT
:
...
...
@@ -97,7 +97,7 @@ asx_start_element(void *user_data, const XML_Char *element_name,
static
void
XMLCALL
asx_end_element
(
void
*
user_data
,
const
XML_Char
*
element_name
)
{
AsxParser
*
parser
=
(
AsxParser
*
)
user_data
;
auto
*
parser
=
(
AsxParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
AsxParser
:
:
ROOT
:
...
...
@@ -120,7 +120,7 @@ asx_end_element(void *user_data, const XML_Char *element_name)
static
void
XMLCALL
asx_char_data
(
void
*
user_data
,
const
XML_Char
*
s
,
int
len
)
{
AsxParser
*
parser
=
(
AsxParser
*
)
user_data
;
auto
*
parser
=
(
AsxParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
AsxParser
:
:
ROOT
:
...
...
src/playlist/plugins/RssPlaylistPlugin.cxx
View file @
72ec641f
...
...
@@ -65,7 +65,7 @@ static void XMLCALL
rss_start_element
(
void
*
user_data
,
const
XML_Char
*
element_name
,
const
XML_Char
**
atts
)
{
RssParser
*
parser
=
(
RssParser
*
)
user_data
;
auto
*
parser
=
(
RssParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
RssParser
:
:
ROOT
:
...
...
@@ -95,7 +95,7 @@ rss_start_element(void *user_data, const XML_Char *element_name,
static
void
XMLCALL
rss_end_element
(
void
*
user_data
,
const
XML_Char
*
element_name
)
{
RssParser
*
parser
=
(
RssParser
*
)
user_data
;
auto
*
parser
=
(
RssParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
RssParser
:
:
ROOT
:
...
...
@@ -118,7 +118,7 @@ rss_end_element(void *user_data, const XML_Char *element_name)
static
void
XMLCALL
rss_char_data
(
void
*
user_data
,
const
XML_Char
*
s
,
int
len
)
{
RssParser
*
parser
=
(
RssParser
*
)
user_data
;
auto
*
parser
=
(
RssParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
RssParser
:
:
ROOT
:
...
...
src/playlist/plugins/XspfPlaylistPlugin.cxx
View file @
72ec641f
...
...
@@ -68,7 +68,7 @@ static void XMLCALL
xspf_start_element
(
void
*
user_data
,
const
XML_Char
*
element_name
,
gcc_unused
const
XML_Char
**
atts
)
{
XspfParser
*
parser
=
(
XspfParser
*
)
user_data
;
auto
*
parser
=
(
XspfParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
XspfParser
:
:
ROOT
:
...
...
@@ -118,7 +118,7 @@ xspf_start_element(void *user_data, const XML_Char *element_name,
static
void
XMLCALL
xspf_end_element
(
void
*
user_data
,
const
XML_Char
*
element_name
)
{
XspfParser
*
parser
=
(
XspfParser
*
)
user_data
;
auto
*
parser
=
(
XspfParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
XspfParser
:
:
ROOT
:
...
...
@@ -157,7 +157,7 @@ xspf_end_element(void *user_data, const XML_Char *element_name)
static
void
XMLCALL
xspf_char_data
(
void
*
user_data
,
const
XML_Char
*
s
,
int
len
)
{
XspfParser
*
parser
=
(
XspfParser
*
)
user_data
;
auto
*
parser
=
(
XspfParser
*
)
user_data
;
switch
(
parser
->
state
)
{
case
XspfParser
:
:
ROOT
:
...
...
src/sticker/SongSticker.cxx
View file @
72ec641f
...
...
@@ -87,7 +87,7 @@ struct sticker_song_find_data {
static
void
sticker_song_find_cb
(
const
char
*
uri
,
const
char
*
value
,
void
*
user_data
)
{
struct
sticker_song_find_data
*
data
=
auto
*
data
=
(
struct
sticker_song_find_data
*
)
user_data
;
if
(
memcmp
(
uri
,
data
->
base_uri
,
data
->
base_uri_length
)
!=
0
)
...
...
src/storage/plugins/NfsStorage.cxx
View file @
72ec641f
...
...
@@ -358,7 +358,7 @@ protected:
void
HandleResult
(
gcc_unused
unsigned
status
,
void
*
data
)
noexcept
override
{
struct
nfsdir
*
const
dir
=
(
struct
nfsdir
*
)
data
;
auto
*
const
dir
=
(
struct
nfsdir
*
)
data
;
CollectEntries
(
dir
);
connection
.
CloseDirectory
(
dir
);
...
...
src/system/FileDescriptor.cxx
View file @
72ec641f
...
...
@@ -290,7 +290,7 @@ FileDescriptor::GetSize() const noexcept
void
FileDescriptor
::
FullRead
(
void
*
_buffer
,
size_t
length
)
{
uint8_t
*
buffer
=
(
uint8_t
*
)
_buffer
;
auto
*
buffer
=
(
uint8_t
*
)
_buffer
;
while
(
length
>
0
)
{
ssize_t
nbytes
=
Read
(
buffer
,
length
);
...
...
test/TestRewindInputStream.cxx
View file @
72ec641f
...
...
@@ -43,7 +43,7 @@ TEST(RewindInputStream, Basic)
{
Mutex
mutex
;
StringInputStream
*
sis
=
auto
*
sis
=
new
StringInputStream
(
"foo://"
,
mutex
,
"foo bar"
);
EXPECT_TRUE
(
sis
->
IsReady
());
...
...
test/test_pcm_format.cxx
View file @
72ec641f
...
...
@@ -94,7 +94,7 @@ TEST(PcmTest, FormatFloat16)
EXPECT_EQ
(
src
[
i
],
d
[
i
]);
/* check if clamping works */
float
*
writable
=
const_cast
<
float
*>
(
f
.
data
);
auto
*
writable
=
const_cast
<
float
*>
(
f
.
data
);
*
writable
++
=
1.01
;
*
writable
++
=
10
;
*
writable
++
=
-
1.01
;
...
...
@@ -140,7 +140,7 @@ TEST(PcmTest, FormatFloat32)
EXPECT_NEAR
(
src
[
i
],
d
[
i
],
error
);
/* check if clamping works */
float
*
writable
=
const_cast
<
float
*>
(
f
.
data
);
auto
*
writable
=
const_cast
<
float
*>
(
f
.
data
);
*
writable
++
=
1.01
;
*
writable
++
=
10
;
*
writable
++
=
-
1.01
;
...
...
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