Commit Graph

14446 Commits

Author SHA1 Message Date
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
Max Kellermann 99afe8e6d1 lib/icu/Win32: paranoid-ify the buffer length checks
Passing `length+1` to `MultiByteToWideChar()` means the function may
fill the whole buffer with output data, and could theoretically
overwrite the null terminator.  In practice, this will never happen,
but this way, it's slightly more correct.

Also, null-terminate after `MultiByteToWideChar()`, after we got the
real output length.  Again, this would never have been a problem, but
who knows...
2020-05-30 13:29:09 +02:00
Rosen Penev 1008d5f67c use cwchar include
Needed for std::wmemchr under libcxx

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-30 13:22:04 +02:00
Shen-Ta Hsieh 169810e8f4 lib/icu: add null terminate in win32 string and wstring 2020-05-30 04:04:34 +08:00
Shen-Ta Hsieh 8e07ea7ad8 src/db: fitting libmpdclient interface 2020-05-29 19:00:16 +02:00
Max Kellermann 9f5c6d29b2 output/osx: use range-based for 2020-05-28 15:59:52 +02:00
Max Kellermann f6823cc679 output/osx: move code to FindAudioDeviceByName() 2020-05-28 15:54:57 +02:00
Max Kellermann 69c0f0fe99 apple/AudioUnit: wrapper functions for AudioObject properties 2020-05-28 15:54:57 +02:00
Max Kellermann 28a00472ff apple/Throw: new helper library replacing osx_os_status_to_cstring() 2020-05-28 15:06:53 +02:00
Max Kellermann 8d540737b9 output/osx: silently ignore some errors in osx_output_set_device() 2020-05-28 15:06:51 +02:00
Max Kellermann 1112d779be apple/ErrorRef: new library wrapping CFErrorRef 2020-05-28 15:06:41 +02:00
Max Kellermann ecced0ce13 apple/StringRef: new library wrapping CFStringRef 2020-05-28 15:06:38 +02:00
Max Kellermann d751df0a73 storage/State: disable -Wcomma to work around Boost compiler warning 2020-05-28 14:00:31 +02:00
Max Kellermann 2c084781b0 output/openal: disable -Wdeprecated-declarations on Apple 2020-05-28 13:59:52 +02:00
Max Kellermann 6e1a21a42a output/osx: make several fields const 2020-05-28 13:59:32 +02:00
Max Kellermann 80e8338014 output/osx: make variables more local 2020-05-28 13:44:28 +02:00
Max Kellermann bfaa7afcb0 output/osx: make more AudioObjectPropertyAddress instances static constexpr 2020-05-28 13:39:46 +02:00
Max Kellermann 7fdbaa6156 output/osx: make AudioObjectPropertyAddress variables static constexpr 2020-05-27 19:50:44 +02:00
Max Kellermann aa7dc62f72 output/osx: don't use C99 designated initializers
Fixes `-Wpedantic`.
2020-05-27 19:50:43 +02:00
Max Kellermann 6a4992118a lib/ffmpeg/Time: redefine AV_TIME_BASE_Q with initializer list
libavutil's macro definition is a compound literal, which is illegal
in C++.  Fixes yet another -Wpedantic warning.
2020-05-27 16:55:55 +02:00
Max Kellermann f03cc1012d lib/upnp/Compat: workaround for -Wkeyword-macro 2020-05-27 16:50:27 +02:00
Max Kellermann 736a696f98 lib/upnp: drop support for libupnp versions older than 1.8 2020-05-27 16:49:02 +02:00
Max Kellermann caec384ed0 archive/ArchiveList, input/Registry: avoid zero-sized array
Some more `-Wpedantic` fixups.
2020-05-27 16:31:52 +02:00
Max Kellermann 5e93e882c9 Merge branch 'v0.21.x' 2020-05-27 16:16:30 +02:00
Max Kellermann 30d97fe8a0 meson.build: fix the WildMidi check when the feature is disabled
Fixes regression from commit 69f09648a4
2020-05-27 16:06:49 +02:00
Max Kellermann 8e4ca23727 lib/ffmpeg/Time: replace C99 compound literal with C++ initializer list 2020-05-27 15:54:34 +02:00
Max Kellermann bdc861f058 util/TemplateString: remove extra semicolon 2020-05-27 15:46:55 +02:00
Rosen Penev 8925040262 remove some more extra semicolons
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-05-27 15:36:53 +02:00
Max Kellermann 4e5d6e560b decoder/modplug: assume ModPlug is built as static library on Windows 2020-05-27 15:03:46 +02:00
Max Kellermann d276d8eda2 decoder/wildmidi: assume WildMidi is built as static library on Windows 2020-05-27 15:03:35 +02:00
Max Kellermann ebcb5e9368 decoder/wildmidi: use NarrowPath, fixing the Windows build 2020-05-27 15:03:33 +02:00
Max Kellermann 69f09648a4 meson.build: attempt to detect WildMidi using pkg-config
The WildMidi project added the pkg-config file in version 0.3.3, but
unfortunately, Debian still doesn't ship it 4 years later:

 https://bugs.debian.org/916631

However, for cross-compiling, the pkg-config file is very helpful.
2020-05-27 15:03:16 +02:00
Max Kellermann 6cc58ccb9b lib/icu/Converter: add missing <string_view> include 2020-05-26 17:48:01 +02:00
Max Kellermann be94b4373a util/OffsetPointer: add noexcept 2020-05-14 15:44:23 +02:00
Max Kellermann eeec0ee804 dsd/Dsd2Pcm: convert struct GenerateCtableValue to lambda
Since we have dropped support for GCC 6 a while ago, we can use
constexpr lambdas now.
2020-05-07 15:04:51 +02:00
Max Kellermann 60f957ed64 util/MimeType: use string_view::substr()
Fixes regression from commit db93bb996c because
ParseMimeTypeParameters() assumed the items were null-terminated, but
after that commit, they were not anymore.
2020-05-06 20:33:13 +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 dae8da7066 input/uring: new input plugin using io_uring
This is the final piece of the series to establish io_uring support on
Linux.

MPD doesn't need io_uring for its efficient bulk I/O support, but to
allow file I/O to be cancelled.  This is a big problem on CIFS/NFS
mounts where processes sleep uninterruptable if the file server
disappears, deadlocking MPD.

With io_uring, a flaky NFS connection allows MPD to continue to work
(even though there are still deadlocks inside MPD which need to be
addressed).

This plugin does not yet use cancellable `open()` using
`IORING_OP_OPENAT`.  This will be implemented later.

Lots of other optimization opportunities for io_uring are still
missing as well - for example the database update could benefit a lot,
but unfortunately, io_uring doesn't have `readdir()` support just yet.
2020-05-05 17:41:03 +02:00
Max Kellermann cdf8ac001c event/Loop: integrate io_uring support 2020-05-05 17:13:14 +02:00
Max Kellermann 62d0ceabcc io/uring: basic Linux io_uring support 2020-05-05 17:10:17 +02:00
Max Kellermann 935e622915 event/Loop: allow calling AddFD()... before starting the EventThread
Relax the assertions.  This is necessary if BlockingCall() is used
before the thread is started.
2020-05-05 17:10:17 +02:00
Max Kellermann 1efbbfcd6f GitVersion: make GIT_VERSION const 2020-05-05 15:12:40 +02:00
Max Kellermann e0edf0b206 meson.build: move VERSION and others to Version.h 2020-05-05 15:12:11 +02:00
Max Kellermann 8f178401e4 */plugins/meson.build: define feature macros in Features.h
This makes ccache more efficient when recompiling with different
plugins.
2020-05-05 15:06:50 +02:00
Max Kellermann 8c1d78873d system/KernelVersion: new library 2020-05-05 14:30:56 +02:00
Max Kellermann 9815d10137 system/FileDescriptor: move to io/ 2020-05-05 14:27:03 +02:00
Max Kellermann 97f7270aa8 fs/FileSystem: remove unused function FOpen() 2020-05-05 14:19:29 +02:00