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
250011f0
Commit
250011f0
authored
Nov 11, 2021
by
Rosen Penev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
return by braced init list
shorter Signed-off-by:
Rosen Penev
<
rosenp@gmail.com
>
parent
e08c85ae
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
22 additions
and
22 deletions
+22
-22
Mapper.cxx
src/Mapper.cxx
+3
-3
Directory.cxx
src/db/plugins/simple/Directory.cxx
+1
-1
UpnpDatabasePlugin.cxx
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
+2
-2
Queue.cxx
src/db/update/Queue.cxx
+1
-1
Path.cxx
src/fs/Path.cxx
+1
-1
CaseFold.cxx
src/lib/icu/CaseFold.cxx
+3
-3
Converter.cxx
src/lib/icu/Converter.cxx
+1
-1
Thread.cxx
src/player/Thread.cxx
+2
-2
ExtM3uPlaylistPlugin.cxx
src/playlist/plugins/ExtM3uPlaylistPlugin.cxx
+2
-2
DetachedSong.cxx
src/song/DetachedSong.cxx
+1
-1
LightSong.cxx
src/song/LightSong.cxx
+1
-1
Database.cxx
src/sticker/Database.cxx
+1
-1
CompositeStorage.cxx
src/storage/CompositeStorage.cxx
+1
-1
UriUtil.cxx
src/util/UriUtil.cxx
+2
-2
No files found.
src/Mapper.cxx
View file @
250011f0
...
@@ -85,15 +85,15 @@ map_fs_to_utf8(Path path_fs) noexcept
...
@@ -85,15 +85,15 @@ map_fs_to_utf8(Path path_fs) noexcept
{
{
if
(
path_fs
.
IsAbsolute
())
{
if
(
path_fs
.
IsAbsolute
())
{
if
(
global_instance
->
storage
==
nullptr
)
if
(
global_instance
->
storage
==
nullptr
)
return
std
::
string
()
;
return
{}
;
const
auto
music_dir_fs
=
global_instance
->
storage
->
MapFS
(
""
);
const
auto
music_dir_fs
=
global_instance
->
storage
->
MapFS
(
""
);
if
(
music_dir_fs
.
IsNull
())
if
(
music_dir_fs
.
IsNull
())
return
std
::
string
()
;
return
{}
;
auto
relative
=
music_dir_fs
.
Relative
(
path_fs
);
auto
relative
=
music_dir_fs
.
Relative
(
path_fs
);
if
(
relative
==
nullptr
||
StringIsEmpty
(
relative
))
if
(
relative
==
nullptr
||
StringIsEmpty
(
relative
))
return
std
::
string
()
;
return
{}
;
path_fs
=
Path
::
FromFS
(
relative
);
path_fs
=
Path
::
FromFS
(
relative
);
}
}
...
...
src/db/plugins/simple/Directory.cxx
View file @
250011f0
...
@@ -278,5 +278,5 @@ Directory::Walk(bool recursive, const SongFilter *filter,
...
@@ -278,5 +278,5 @@ Directory::Walk(bool recursive, const SongFilter *filter,
LightDirectory
LightDirectory
Directory
::
Export
()
const
noexcept
Directory
::
Export
()
const
noexcept
{
{
return
LightDirectory
(
GetPath
(),
mtime
)
;
return
{
GetPath
(),
mtime
}
;
}
}
src/db/plugins/upnp/UpnpDatabasePlugin.cxx
View file @
250011f0
...
@@ -250,11 +250,11 @@ UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
...
@@ -250,11 +250,11 @@ UpnpDatabase::SearchSongs(const ContentDirectoryService &server,
{
{
const
SongFilter
*
filter
=
selection
.
filter
;
const
SongFilter
*
filter
=
selection
.
filter
;
if
(
selection
.
filter
==
nullptr
)
if
(
selection
.
filter
==
nullptr
)
return
UPnPDirContent
()
;
return
{}
;
const
auto
searchcaps
=
server
.
getSearchCapabilities
(
handle
);
const
auto
searchcaps
=
server
.
getSearchCapabilities
(
handle
);
if
(
searchcaps
.
empty
())
if
(
searchcaps
.
empty
())
return
UPnPDirContent
()
;
return
{}
;
std
::
string
cond
;
std
::
string
cond
;
for
(
const
auto
&
item
:
filter
->
GetItems
())
{
for
(
const
auto
&
item
:
filter
->
GetItems
())
{
...
...
src/db/update/Queue.cxx
View file @
250011f0
...
@@ -34,7 +34,7 @@ UpdateQueueItem
...
@@ -34,7 +34,7 @@ UpdateQueueItem
UpdateQueue
::
Pop
()
noexcept
UpdateQueue
::
Pop
()
noexcept
{
{
if
(
update_queue
.
empty
())
if
(
update_queue
.
empty
())
return
UpdateQueueItem
()
;
return
{}
;
auto
i
=
std
::
move
(
update_queue
.
front
());
auto
i
=
std
::
move
(
update_queue
.
front
());
update_queue
.
pop_front
();
update_queue
.
pop_front
();
...
...
src/fs/Path.cxx
View file @
250011f0
...
@@ -26,7 +26,7 @@ Path::ToUTF8() const noexcept
...
@@ -26,7 +26,7 @@ Path::ToUTF8() const noexcept
try
{
try
{
return
ToUTF8Throw
();
return
ToUTF8Throw
();
}
catch
(...)
{
}
catch
(...)
{
return
std
::
string
()
;
return
{}
;
}
}
}
}
...
...
src/lib/icu/CaseFold.cxx
View file @
250011f0
...
@@ -44,7 +44,7 @@ try {
...
@@ -44,7 +44,7 @@ try {
#ifdef HAVE_ICU
#ifdef HAVE_ICU
const
auto
u
=
UCharFromUTF8
(
src
);
const
auto
u
=
UCharFromUTF8
(
src
);
if
(
u
.
IsNull
())
if
(
u
.
IsNull
())
return
AllocatedString
(
src
)
;
return
{
src
}
;
AllocatedArray
<
UChar
>
folded
(
u
.
size
()
*
2U
);
AllocatedArray
<
UChar
>
folded
(
u
.
size
()
*
2U
);
...
@@ -54,7 +54,7 @@ try {
...
@@ -54,7 +54,7 @@ try {
U_FOLD_CASE_DEFAULT
,
U_FOLD_CASE_DEFAULT
,
&
error_code
);
&
error_code
);
if
(
folded_length
==
0
||
error_code
!=
U_ZERO_ERROR
)
if
(
folded_length
==
0
||
error_code
!=
U_ZERO_ERROR
)
return
AllocatedString
(
src
)
;
return
{
src
}
;
folded
.
SetSize
(
folded_length
);
folded
.
SetSize
(
folded_length
);
return
UCharToUTF8
({
folded
.
begin
(),
folded
.
size
()});
return
UCharToUTF8
({
folded
.
begin
(),
folded
.
size
()});
...
@@ -63,7 +63,7 @@ try {
...
@@ -63,7 +63,7 @@ try {
#error not implemented
#error not implemented
#endif
#endif
}
catch
(...)
{
}
catch
(...)
{
return
AllocatedString
(
src
)
;
return
{
src
}
;
}
}
#endif
/* HAVE_ICU_CASE_FOLD */
#endif
/* HAVE_ICU_CASE_FOLD */
src/lib/icu/Converter.cxx
View file @
250011f0
...
@@ -152,7 +152,7 @@ IcuConverter::FromUTF8(std::string_view s) const
...
@@ -152,7 +152,7 @@ IcuConverter::FromUTF8(std::string_view s) const
throw
std
::
runtime_error
(
fmt
::
format
(
FMT_STRING
(
"Failed to convert from Unicode: {}"
),
throw
std
::
runtime_error
(
fmt
::
format
(
FMT_STRING
(
"Failed to convert from Unicode: {}"
),
u_errorName
(
code
)));
u_errorName
(
code
)));
return
AllocatedString
({
buffer
,
size_t
(
target
-
buffer
)})
;
return
{{
buffer
,
size_t
(
target
-
buffer
)}}
;
#elif defined(HAVE_ICONV)
#elif defined(HAVE_ICONV)
return
DoConvert
(
from_utf8
,
s
);
return
DoConvert
(
from_utf8
,
s
);
...
...
src/player/Thread.cxx
View file @
250011f0
...
@@ -466,9 +466,9 @@ real_song_duration(const DetachedSong &song,
...
@@ -466,9 +466,9 @@ real_song_duration(const DetachedSong &song,
const
SongTime
end_time
=
song
.
GetEndTime
();
const
SongTime
end_time
=
song
.
GetEndTime
();
if
(
end_time
.
IsPositive
()
&&
end_time
<
SongTime
(
decoder_duration
))
if
(
end_time
.
IsPositive
()
&&
end_time
<
SongTime
(
decoder_duration
))
return
SignedSongTime
(
end_time
-
start_time
)
;
return
{
end_time
-
start_time
}
;
return
SignedSongTime
(
SongTime
(
decoder_duration
)
-
start_time
)
;
return
{
SongTime
(
decoder_duration
)
-
start_time
}
;
}
}
bool
bool
...
...
src/playlist/plugins/ExtM3uPlaylistPlugin.cxx
View file @
250011f0
...
@@ -87,7 +87,7 @@ extm3u_parse_tag(const char *line)
...
@@ -87,7 +87,7 @@ extm3u_parse_tag(const char *line)
duration
=
strtol
(
line
,
&
endptr
,
10
);
duration
=
strtol
(
line
,
&
endptr
,
10
);
if
(
endptr
[
0
]
!=
','
)
if
(
endptr
[
0
]
!=
','
)
/* malformed line */
/* malformed line */
return
Tag
()
;
return
{}
;
if
(
duration
<
0
)
if
(
duration
<
0
)
/* 0 means unknown duration */
/* 0 means unknown duration */
...
@@ -97,7 +97,7 @@ extm3u_parse_tag(const char *line)
...
@@ -97,7 +97,7 @@ extm3u_parse_tag(const char *line)
if
(
*
name
==
0
&&
duration
==
0
)
if
(
*
name
==
0
&&
duration
==
0
)
/* no information available; don't allocate a tag
/* no information available; don't allocate a tag
object */
object */
return
Tag
()
;
return
{}
;
TagBuilder
tag
;
TagBuilder
tag
;
tag
.
SetDuration
(
SignedSongTime
::
FromS
(
unsigned
(
duration
)));
tag
.
SetDuration
(
SignedSongTime
::
FromS
(
unsigned
(
duration
)));
...
...
src/song/DetachedSong.cxx
View file @
250011f0
...
@@ -75,5 +75,5 @@ DetachedSong::GetDuration() const noexcept
...
@@ -75,5 +75,5 @@ DetachedSong::GetDuration() const noexcept
b
=
SongTime
(
tag
.
duration
);
b
=
SongTime
(
tag
.
duration
);
}
}
return
SignedSongTime
(
b
-
a
)
;
return
{
b
-
a
}
;
}
}
src/song/LightSong.cxx
View file @
250011f0
...
@@ -31,5 +31,5 @@ LightSong::GetDuration() const noexcept
...
@@ -31,5 +31,5 @@ LightSong::GetDuration() const noexcept
b
=
SongTime
(
tag
.
duration
);
b
=
SongTime
(
tag
.
duration
);
}
}
return
SignedSongTime
(
b
-
a
)
;
return
{
b
-
a
}
;
}
}
src/sticker/Database.cxx
View file @
250011f0
...
@@ -128,7 +128,7 @@ StickerDatabase::LoadValue(const char *type, const char *uri, const char *name)
...
@@ -128,7 +128,7 @@ StickerDatabase::LoadValue(const char *type, const char *uri, const char *name)
assert
(
name
!=
nullptr
);
assert
(
name
!=
nullptr
);
if
(
StringIsEmpty
(
name
))
if
(
StringIsEmpty
(
name
))
return
std
::
string
()
;
return
{}
;
BindAll
(
s
,
type
,
uri
,
name
);
BindAll
(
s
,
type
,
uri
,
name
);
...
...
src/storage/CompositeStorage.cxx
View file @
250011f0
...
@@ -303,7 +303,7 @@ CompositeStorage::MapUTF8(std::string_view uri) const noexcept
...
@@ -303,7 +303,7 @@ CompositeStorage::MapUTF8(std::string_view uri) const noexcept
auto
f
=
FindStorage
(
uri
);
auto
f
=
FindStorage
(
uri
);
if
(
f
.
directory
->
storage
==
nullptr
)
if
(
f
.
directory
->
storage
==
nullptr
)
return
std
::
string
()
;
return
{}
;
return
f
.
directory
->
storage
->
MapUTF8
(
f
.
uri
);
return
f
.
directory
->
storage
->
MapUTF8
(
f
.
uri
);
}
}
...
...
src/util/UriUtil.cxx
View file @
250011f0
...
@@ -94,7 +94,7 @@ uri_remove_auth(const char *uri) noexcept
...
@@ -94,7 +94,7 @@ uri_remove_auth(const char *uri) noexcept
const
char
*
auth
=
SkipUriScheme
(
uri
);
const
char
*
auth
=
SkipUriScheme
(
uri
);
if
(
auth
==
nullptr
)
if
(
auth
==
nullptr
)
/* unrecognized URI */
/* unrecognized URI */
return
std
::
string
()
;
return
{}
;
const
char
*
slash
=
std
::
strchr
(
auth
,
'/'
);
const
char
*
slash
=
std
::
strchr
(
auth
,
'/'
);
if
(
slash
==
nullptr
)
if
(
slash
==
nullptr
)
...
@@ -103,7 +103,7 @@ uri_remove_auth(const char *uri) noexcept
...
@@ -103,7 +103,7 @@ uri_remove_auth(const char *uri) noexcept
const
char
*
at
=
(
const
char
*
)
std
::
memchr
(
auth
,
'@'
,
slash
-
auth
);
const
char
*
at
=
(
const
char
*
)
std
::
memchr
(
auth
,
'@'
,
slash
-
auth
);
if
(
at
==
nullptr
)
if
(
at
==
nullptr
)
/* no auth info present, do nothing */
/* no auth info present, do nothing */
return
std
::
string
()
;
return
{}
;
/* duplicate the full URI and then delete the auth
/* duplicate the full URI and then delete the auth
information */
information */
...
...
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