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
d4bbb8c8
Commit
d4bbb8c8
authored
Mar 04, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'struc' of
git://github.com/neheb/MPD
parents
428f769c
0fd2c74a
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
49 additions
and
61 deletions
+49
-61
RemoteTagCache.cxx
src/RemoteTagCache.cxx
+6
-8
Subscribe.cxx
src/client/Subscribe.cxx
+1
-2
Count.cxx
src/db/Count.cxx
+5
-7
DatabasePrint.cxx
src/db/DatabasePrint.cxx
+3
-3
Directory.cxx
src/db/plugins/simple/Directory.cxx
+2
-5
Walk.cxx
src/db/update/Walk.cxx
+3
-5
WinSelectBackend.cxx
src/event/WinSelectBackend.cxx
+4
-4
CurlInputPlugin.cxx
src/input/plugins/CurlInputPlugin.cxx
+2
-2
QobuzClient.cxx
src/input/plugins/QobuzClient.cxx
+6
-6
Form.cxx
src/lib/curl/Form.cxx
+5
-5
UdisksNeighborPlugin.cxx
src/neighbor/plugins/UdisksNeighborPlugin.cxx
+2
-2
Print.cxx
src/output/Print.cxx
+2
-3
WasapiOutputPlugin.cxx
src/output/plugins/WasapiOutputPlugin.cxx
+5
-3
Print.cxx
src/sticker/Print.cxx
+2
-2
GenParseName.cxx
src/tag/GenParseName.cxx
+1
-4
No files found.
src/RemoteTagCache.cxx
View file @
d4bbb8c8
...
...
@@ -42,9 +42,9 @@ RemoteTagCache::Lookup(const std::string &uri) noexcept
std
::
unique_lock
<
Mutex
>
lock
(
mutex
);
KeyMap
::
insert_commit_data
hint
;
auto
result
=
map
.
insert_check
(
uri
,
Item
::
Hash
(),
Item
::
Equal
(),
hint
);
if
(
result
.
second
)
{
auto
*
item
=
new
Item
(
*
this
,
uri
);
auto
[
tag
,
value
]
=
map
.
insert_check
(
uri
,
Item
::
Hash
(),
Item
::
Equal
(),
hint
);
if
(
value
)
{
auto
item
=
new
Item
(
*
this
,
uri
);
map
.
insert_commit
(
*
item
,
hint
);
waiting_list
.
push_back
(
*
item
);
lock
.
unlock
();
...
...
@@ -70,15 +70,13 @@ RemoteTagCache::Lookup(const std::string &uri) noexcept
ItemResolved
(
*
item
);
return
;
}
}
else
if
(
result
.
first
->
scanner
)
{
}
else
if
(
tag
->
scanner
)
{
/* already scanning this one - no-op */
}
else
{
/* already finished: re-invoke the handler */
auto
&
item
=
*
result
.
first
;
idle_list
.
erase
(
waiting_list
.
iterator_to
(
item
));
invoke_list
.
push_back
(
item
);
idle_list
.
erase
(
waiting_list
.
iterator_to
(
*
tag
));
invoke_list
.
push_back
(
*
tag
);
ScheduleInvokeHandlers
();
}
...
...
src/client/Subscribe.cxx
View file @
d4bbb8c8
...
...
@@ -34,8 +34,7 @@ Client::Subscribe(const char *channel) noexcept
if
(
num_subscriptions
>=
MAX_SUBSCRIPTIONS
)
return
Client
::
SubscribeResult
::
FULL
;
auto
r
=
subscriptions
.
insert
(
channel
);
if
(
!
r
.
second
)
if
(
!
subscriptions
.
insert
(
channel
).
second
)
return
Client
::
SubscribeResult
::
ALREADY
;
++
num_subscriptions
;
...
...
src/db/Count.cxx
View file @
d4bbb8c8
...
...
@@ -57,9 +57,9 @@ Print(Response &r, TagType group, const TagCountMap &m) noexcept
{
assert
(
unsigned
(
group
)
<
TAG_NUM_OF_ITEM_TYPES
);
for
(
const
auto
&
i
:
m
)
{
tag_print
(
r
,
group
,
i
.
first
.
c_str
());
PrintSearchStats
(
r
,
i
.
second
);
for
(
const
auto
&
[
tag
,
stats
]
:
m
)
{
tag_print
(
r
,
group
,
tag
.
c_str
());
PrintSearchStats
(
r
,
stats
);
}
}
...
...
@@ -68,8 +68,7 @@ stats_visitor_song(SearchStats &stats, const LightSong &song) noexcept
{
stats
.
n_songs
++
;
const
auto
duration
=
song
.
GetDuration
();
if
(
!
duration
.
IsNegative
())
if
(
const
auto
duration
=
song
.
GetDuration
();
!
duration
.
IsNegative
())
stats
.
total_duration
+=
duration
;
}
...
...
@@ -77,8 +76,7 @@ static void
CollectGroupCounts
(
TagCountMap
&
map
,
const
Tag
&
tag
,
const
char
*
value
)
noexcept
{
auto
r
=
map
.
insert
(
std
::
make_pair
(
value
,
SearchStats
()));
SearchStats
&
s
=
r
.
first
->
second
;
auto
&
s
=
map
.
insert
(
std
::
make_pair
(
value
,
SearchStats
())).
first
->
second
;
++
s
.
n_songs
;
if
(
!
tag
.
duration
.
IsNegative
())
s
.
total_duration
+=
tag
.
duration
;
...
...
src/db/DatabasePrint.cxx
View file @
d4bbb8c8
...
...
@@ -195,11 +195,11 @@ PrintUniqueTags(Response &r, ConstBuffer<TagType> tag_types,
const
char
*
const
name
=
tag_item_names
[
tag_types
.
front
()];
tag_types
.
pop_front
();
for
(
const
auto
&
i
:
map
)
{
r
.
Format
(
"%s: %s
\n
"
,
name
,
i
.
first
.
c_str
());
for
(
const
auto
&
[
key
,
tag
]
:
map
)
{
r
.
Format
(
"%s: %s
\n
"
,
name
,
key
.
c_str
());
if
(
!
tag_types
.
empty
())
PrintUniqueTags
(
r
,
tag_types
,
i
.
second
);
PrintUniqueTags
(
r
,
tag_types
,
tag
);
}
}
...
...
src/db/plugins/simple/Directory.cxx
View file @
d4bbb8c8
...
...
@@ -138,13 +138,10 @@ Directory::LookupDirectory(std::string_view _uri) noexcept
Directory
*
d
=
this
;
do
{
auto
s
=
uri
.
Split
(
PathTraitsUTF8
::
SEPARATOR
);
if
(
s
.
first
.
empty
())
auto
[
name
,
rest
]
=
uri
.
Split
(
PathTraitsUTF8
::
SEPARATOR
);
if
(
name
.
empty
())
break
;
const
auto
name
=
s
.
first
;
const
auto
rest
=
s
.
second
;
Directory
*
tmp
=
d
->
FindChild
(
name
);
if
(
tmp
==
nullptr
)
/* not found */
...
...
src/db/update/Walk.cxx
View file @
d4bbb8c8
...
...
@@ -427,21 +427,19 @@ UpdateWalk::DirectoryMakeUriParentChecked(Directory &root,
StringView
uri
(
_uri
);
while
(
true
)
{
auto
s
=
uri
.
Split
(
'/'
);
const
std
::
string_view
name
=
s
.
first
;
const
auto
rest
=
s
.
second
;
auto
[
name
,
rest
]
=
uri
.
Split
(
'/'
);
if
(
rest
==
nullptr
)
break
;
if
(
!
name
.
empty
())
{
directory
=
DirectoryMakeChildChecked
(
*
directory
,
std
::
string
(
name
).
c_str
(),
s
.
first
);
name
);
if
(
directory
==
nullptr
)
break
;
}
uri
=
s
.
second
;
uri
=
rest
;
}
return
directory
;
...
...
src/event/WinSelectBackend.cxx
View file @
d4bbb8c8
...
...
@@ -160,10 +160,10 @@ WinSelectBackend::ReadEvents(int timeout_ms) noexcept
ApplyReady
(
write_set
,
WinSelectEvents
::
WRITE
);
ApplyReady
(
except_set
,
WinSelectEvents
::
WRITE
);
for
(
auto
&
i
:
items
)
if
(
i
.
second
.
events
!=
0
)
{
result
.
Add
(
i
.
second
.
events
,
i
.
second
.
obj
);
i
.
second
.
events
=
0
;
for
(
auto
&
[
key
,
item
]
:
items
)
if
(
i
tem
.
events
!=
0
)
{
result
.
Add
(
i
tem
.
events
,
item
.
obj
);
i
tem
.
events
=
0
;
}
return
result
;
...
...
src/input/plugins/CurlInputPlugin.cxx
View file @
d4bbb8c8
...
...
@@ -404,8 +404,8 @@ CurlInputStream::CurlInputStream(EventLoop &event_loop, const char *_url,
{
request_headers
.
Append
(
"Icy-Metadata: 1"
);
for
(
const
auto
&
i
:
headers
)
request_headers
.
Append
((
i
.
first
+
":"
+
i
.
second
).
c_str
());
for
(
const
auto
&
[
key
,
header
]
:
headers
)
request_headers
.
Append
((
key
+
":"
+
header
).
c_str
());
}
CurlInputStream
::~
CurlInputStream
()
noexcept
...
...
src/input/plugins/QobuzClient.cxx
View file @
d4bbb8c8
...
...
@@ -174,8 +174,8 @@ QobuzClient::MakeUrl(const char *object, const char *method,
uri
+=
method
;
QueryStringBuilder
q
;
for
(
const
auto
&
i
:
query
)
q
(
uri
,
i
.
first
.
c_str
(),
i
.
second
.
c_str
());
for
(
const
auto
&
[
key
,
url
]
:
query
)
q
(
uri
,
key
.
c_str
(),
url
.
c_str
());
q
(
uri
,
"app_id"
,
app_id
);
return
uri
;
...
...
@@ -195,11 +195,11 @@ QobuzClient::MakeSignedUrl(const char *object, const char *method,
QueryStringBuilder
q
;
std
::
string
concatenated_query
(
object
);
concatenated_query
+=
method
;
for
(
const
auto
&
i
:
query
)
{
q
(
uri
,
i
.
first
.
c_str
(),
i
.
second
.
c_str
());
for
(
const
auto
&
[
key
,
url
]
:
query
)
{
q
(
uri
,
key
.
c_str
(),
url
.
c_str
());
concatenated_query
+=
i
.
first
;
concatenated_query
+=
i
.
second
;
concatenated_query
+=
key
;
concatenated_query
+=
url
;
}
q
(
uri
,
"app_id"
,
app_id
);
...
...
src/lib/curl/Form.cxx
View file @
d4bbb8c8
...
...
@@ -36,16 +36,16 @@ EncodeForm(CURL *curl,
{
std
::
string
result
;
for
(
const
auto
&
i
:
fields
)
{
for
(
const
auto
&
[
key
,
field
]
:
fields
)
{
if
(
!
result
.
empty
())
result
.
push_back
(
'&'
);
result
.
append
(
i
.
first
);
result
.
append
(
key
);
result
.
push_back
(
'='
);
if
(
!
i
.
secon
d
.
empty
())
{
CurlString
value
(
curl_easy_escape
(
curl
,
i
.
second
.
data
(),
i
.
secon
d
.
length
()));
if
(
!
fiel
d
.
empty
())
{
CurlString
value
(
curl_easy_escape
(
curl
,
field
.
data
(),
fiel
d
.
length
()));
if
(
value
)
result
.
append
(
value
);
}
...
...
src/neighbor/plugins/UdisksNeighborPlugin.cxx
View file @
d4bbb8c8
...
...
@@ -179,8 +179,8 @@ UdisksNeighborExplorer::GetList() const noexcept
NeighborExplorer
::
List
result
;
for
(
const
auto
&
i
:
by_uri
)
result
.
emplace_front
(
i
.
second
);
for
(
const
auto
&
[
t
,
r
]
:
by_uri
)
result
.
emplace_front
(
r
);
return
result
;
}
...
...
src/output/Print.cxx
View file @
d4bbb8c8
...
...
@@ -40,8 +40,7 @@ printAudioDevices(Response &r, const MultipleOutputs &outputs)
ao
.
GetName
(),
ao
.
GetPluginName
(),
ao
.
IsEnabled
());
for
(
const
auto
&
a
:
ao
.
GetAttributes
())
r
.
Format
(
"attribute: %s=%s
\n
"
,
a
.
first
.
c_str
(),
a
.
second
.
c_str
());
for
(
const
auto
&
[
attribute
,
value
]
:
ao
.
GetAttributes
())
r
.
Format
(
"attribute: %s=%s
\n
"
,
attribute
.
c_str
(),
value
.
c_str
());
}
}
src/output/plugins/WasapiOutputPlugin.cxx
View file @
d4bbb8c8
...
...
@@ -323,9 +323,11 @@ void WasapiOutput::Enable() {
device
.
reset
();
if
(
enumerate_devices
&&
SafeTry
([
this
]()
{
EnumerateDevices
();
}))
{
for
(
const
auto
&
desc
:
device_desc
)
{
FormatNotice
(
wasapi_output_domain
,
"Device
\"
%u
\"
\"
%s
\"
"
,
desc
.
first
,
desc
.
second
.
c_str
());
for
(
const
auto
&
[
device
,
desc
]
:
device_desc
)
{
FormatNotice
(
wasapi_output_domain
,
"Device
\"
%u
\"
\"
%s
\"
"
,
device
,
desc
.
c_str
());
}
}
...
...
src/sticker/Print.cxx
View file @
d4bbb8c8
...
...
@@ -31,6 +31,6 @@ sticker_print_value(Response &r,
void
sticker_print
(
Response
&
r
,
const
Sticker
&
sticker
)
{
for
(
const
auto
&
i
:
sticker
.
table
)
sticker_print_value
(
r
,
i
.
first
.
c_str
(),
i
.
second
.
c_str
());
for
(
const
auto
&
[
name
,
val
]
:
sticker
.
table
)
sticker_print_value
(
r
,
name
.
c_str
(),
val
.
c_str
());
}
src/tag/GenParseName.cxx
View file @
d4bbb8c8
...
...
@@ -60,10 +60,7 @@ main(int argc, char **argv)
char
first
=
0
;
for
(
const
auto
&
i
:
names
)
{
const
std
::
string_view
name
=
i
.
first
;
const
TagType
tag
=
i
.
second
;
for
(
const
auto
&
[
name
,
tag
]
:
names
)
{
if
(
name
.
front
()
!=
first
)
{
if
(
first
!=
0
)
fprintf
(
out
,
" break;
\n\n
"
);
...
...
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