Commit Graph

938 Commits

Author SHA1 Message Date
Max Kellermann a8e23c4140 db/update/InotifySource: add noexcept 2020-09-16 20:40:06 +02:00
Max Kellermann fc3861b421 db/update/InotifyQueue: add noexcept 2020-09-16 20:40:03 +02:00
Max Kellermann e81bb5d8f1 db/update/Inotify*: include cleanup 2020-09-16 20:39:44 +02:00
Max Kellermann 540919f256 *: use nullptr instead of NULL 2020-09-07 20:08:27 +02:00
Max Kellermann b74a91427d Merge tag 'v0.21.25'
release v0.21.25
2020-07-06 21:47:30 +02:00
Max Kellermann 00789de7d4 db/upnp/Object: root nodes are allowed to omit parent_id and name
This fixes compatibility with Plex DLNA.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/851
2020-07-06 21:36:30 +02:00
Max Kellermann 9964a5ffe8 db/update/Service: avoid copying the mount point path 2020-07-06 21:09:58 +02:00
Max Kellermann c3cfb5fe16 Merge branch 'v0.21.x' 2020-07-06 20:56:52 +02:00
Max Kellermann fe48e5596f command/storage: automatically scan new mounts
Closes https://github.com/MusicPlayerDaemon/MPD/issues/841
2020-07-06 20:23:41 +02:00
Max Kellermann 5b291ff768 db/update/Walk: pass concatenated .mpdignore URI to storage.MapUTF8()
Fixes the "Unrecognized URI" error with the udisks storage plugin,
which is caused by the kludge in UdisksStorage::MapUTF8().
2020-07-06 17:19:38 +02:00
Max Kellermann f20b927858 Merge branch 'v0.21.x' 2020-05-30 14:05:18 +02:00
Rosen Penev e4dad42ca1 use std chr functions
The ones in std have overloads for const char/char.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-30 13:36:53 +02:00
Shen-Ta Hsieh 8e07ea7ad8 src/db: fitting libmpdclient interface 2020-05-29 19:00:16 +02:00
Max Kellermann 864d26cd1b Merge branch 'bind' of git://github.com/neheb/MPD 2020-05-06 06:14:55 +02:00
Max Kellermann ba576ffa37 Merge branch 'v0.21.x' 2020-05-05 19:00:53 +02:00
Max Kellermann 209364adf2 db/simple: fix crash when mounting twice
The `db->close()` call was a `nullptr` dereference because the `db`
variable had already been moved.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/839
2020-05-05 18:57:29 +02:00
Max Kellermann e0edf0b206 meson.build: move VERSION and others to Version.h 2020-05-05 15:12:11 +02:00
Max Kellermann 9815d10137 system/FileDescriptor: move to io/ 2020-05-05 14:27:03 +02:00
Rosen Penev e6a77e1297 remove std::bind usage as much as possible
Reduces unstripped size. stripped size is the same.

Also took the time to remove using std::placeholders.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-04 15:40:28 -07:00
Rosen Penev 3c145c0f49 [clang-tidy] add nodiscard
Found with modernize-use-nodiscard

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-22 18:20:51 +02:00
Max Kellermann 3c240e2119 db/simple/DirectorySave: pass std::string_view to _load_subdir()
Eliminates one strlen() call.
2020-04-08 23:54:58 +02:00
Max Kellermann 57fb153c5d db/Interface: pass std::string_view to GetSong() 2020-04-08 23:43:59 +02:00
Max Kellermann 212401d687 db/update/Service: pass std::string_view to Enqueue() 2020-04-08 23:38:28 +02:00
Max Kellermann dd831d3922 db/simple: pass std::string_view to Directory::LookupDirectory() 2020-04-08 23:38:24 +02:00
Max Kellermann db93bb996c util/SplitString: convert return value to std::string_view
Eliminates lots of overhead.
2020-04-08 23:14:25 +02:00
Max Kellermann 2c02a04566 db/update/Walk: pass std::string_view to DirectoryMakeUriParentChecked()
Split the string into path segments with StringView::Split().  This
prepares to eliminate all allocations from the method.
2020-04-08 23:09:37 +02:00
Max Kellermann a98d627c0b storage/Interface: convert URI parameters to std::string_view 2020-04-03 19:45:10 +02:00
Max Kellermann bcf4645263 db/simple/Directory: add LookupResult::uri 2020-04-03 17:18:00 +02:00
Max Kellermann 6c8eb3c7ed db/simple/Directory: rename LookupResult::uri to "rest" 2020-04-03 17:07:15 +02:00
Max Kellermann 870151214d util/SplitString: convert parameter to std::string_view 2020-04-03 16:47:45 +02:00
Max Kellermann 747436b17e db,storage: pass std::string_view to PathTraits::Build() 2020-04-03 16:25:09 +02:00
Max Kellermann 7a58b8c3e8 fs/AllocatedPath: pass std::string_view to FromUTF8() 2020-04-03 16:21:41 +02:00
Max Kellermann 91c75a133f lib/icu/Collate: pass std::string_view 2020-04-03 16:13:15 +02:00
Max Kellermann f0923231d0 storage/Interface: pass std::string_view to MapChildFS() 2020-04-02 20:14:00 +02:00
Max Kellermann dadf054fbb db/simple/Directory: reimplement LookupDirectory() without allocations
Use std::string_view to avoid modifying the string for the temporary
null terminators.
2020-04-02 20:08:00 +02:00
Max Kellermann 6593b5998a db/simple/Directory: pass std::string_view to several methods 2020-04-02 19:58:24 +02:00
Max Kellermann 386235e2d2 db/simple/Mount: pass std::string_view to WalkMount() 2020-04-02 19:52:03 +02:00
Max Kellermann ddfd92e547 db/simple/PrefixedLightSong: templatize the constructor 2020-04-02 19:51:41 +02:00
Max Kellermann d5fd309484 db/update/IO: pass std::string_view to directory_child_is_regular() 2020-04-02 19:50:16 +02:00
Max Kellermann 6197b29aa0 db/PlaylistInfo: pass std::string_view to CompareName 2020-04-02 19:49:39 +02:00
Max Kellermann 66bcf04cbd db/update/Queue: pass std::string_view to Push() 2020-04-02 19:49:16 +02:00
Max Kellermann 12b97bbe38 Merge tag 'v0.21.22'
release v0.21.22
2020-04-02 18:02:10 +02:00
Max Kellermann cdddaf21b0 db/simple/Directory: optimize GetName() using the parent's path
This method gets called a lot during MPD startup, via FindChild() and
directory_load_subdir(), so this is worth optimizing at the expense of
code readability.

This speeds up MPD startup by 10%.
2020-04-02 16:12:08 +02:00
Rosen Penev 608d7ec1e7 [clang-tidy] change integer prefixes to uppercase
Found with readability-uppercase-literal-suffix

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-26 17:25:20 +01:00
Max Kellermann 8cd5e79fbd event/*, ...: make GetEventLoop() const 2020-03-26 17:19:13 +01:00
Rosen Penev 7fe49cf24d [clang-tidy] use default member init
Found with modernize-use-default-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +01:00
Rosen Penev 97425d56e7 remove gcc_unused
[[maybe_unused]] (introduced in C++17) is standard C++.

https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
says that this is equivalent to the GNU unused attribute.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev 591f51f3d3 replace noreturn attribute with standard C++ version
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:18 -07:00
Rosen Penev a2f5a63bbc replace stdint.h with cstdint
The former is deprecated by C++14. The standard says they are the same:

The header defines all types and macros the same as the C standard library
header<stdint.h>.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:39 -07:00
Rosen Penev 4b57b7f5a5 replace limits.h with climits
The former was deprecated with C++14. The standard says they are the same
with one exception:

The header<climits>defines all macros the same as the C standard library
header<limits.h>.

[Note:The types of the constants defined by macros in<climits>are not
required to match the types to which themacros refer.— end note]

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 16:14:04 -07:00