Commit Graph

830 Commits

Author SHA1 Message Date
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
Shen-Ta Hsieh 169810e8f4 lib/icu: add null terminate in win32 string and wstring 2020-05-30 04:04:34 +08: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 5e93e882c9 Merge branch 'v0.21.x' 2020-05-27 16:16:30 +02:00
Max Kellermann 8e4ca23727 lib/ffmpeg/Time: replace C99 compound literal with C++ initializer list 2020-05-27 15:54:34 +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 6cc58ccb9b lib/icu/Converter: add missing <string_view> include 2020-05-26 17:48:01 +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 0b3acc3eec Merge tag 'v0.21.23'
release v0.21.23
2020-04-23 18:01:23 +02:00
Max Kellermann 3040ddb5ec lib/nfs/FileReader: use struct stat64 on Windows 32-bit
libnfs is compiled with `-D_FILE_OFFSET_BITS=64`, but Meson decides
not to enable this mode.  We could force this mode, but then again,
these days, nobody should be using 32-bit Windows ... so this is a
kludge only for debugging with 32-bit WINE.
2020-04-23 17:32:34 +02:00
Max Kellermann 7ded244a61 lib/nfs/Connection: pass POLLHUP and POLLERR to nfs_service() 2020-04-23 16:58:53 +02:00
Max Kellermann a27580d0cc lib/nfs/Connection: don't pass HANGUP to Schedule()
This flag is output-only.
2020-04-23 15:21:04 +02:00
Max Kellermann e53a4d0a9e lib/nfs/FileReader: reset state in OnNfsCallback()
The object's state is `IDLE` when OnNfsCallback() gets invoked, so
let's use the start of the method to reset the `state` field.
2020-04-23 14:54:52 +02:00
Max Kellermann 159389164a lib/nfs/FileReader: set state=IDLE before invoking callback
Fixes assertion failure if the callback fails.
2020-04-23 14:51:43 +02:00
Max Kellermann 8f00dbea45 lib/icu/Compare: add Windows implementation
Using CompareStringEx() and FindNLSStringEx().

Implements a missing piece for
https://github.com/MusicPlayerDaemon/MPD/issues/820
2020-04-22 21:42:12 +02:00
Max Kellermann f3fd2eb618 lib/icu/Compare: use AllocatedString::Clone() 2020-04-22 21:39:13 +02:00
Max Kellermann fc92db83cf lib/icu/Collate: use NORM_IGNORECASE instead of LINGUISTIC_IGNORECASE
LINGUISTIC_IGNORECASE is unimplemented on Wine, but since we don't
have any locale support (yet), and we're using LOCALE_NAME_INVARIANT,
NORM_IGNORECASE should essentially be the same, so why bother.
2020-04-22 21:39:13 +02:00
Max Kellermann 3b0f8d5516 lib/icu/CaseFold: remove Windows implementation
Reverts commit fb3564fbe7

LCMapStringEx() doesn't do what I imagined it would do 5 years ago.
D'oh!

Closes https://github.com/MusicPlayerDaemon/MPD/issues/820
2020-04-22 19:32:36 +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 0a4c5edc3b Merge branch 'stl' of git://github.com/neheb/MPD 2020-04-08 23:03:44 +02:00
Rosen Penev 015cbff93d [cppcheck] convert several functions to use std::all_of
std::all_of becomes constexpr in C++20. I'm not sure it results in better
performance.

Found with useStlAlgorithm

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-08 14:01:12 -07:00
Max Kellermann 91c75a133f lib/icu/Collate: pass std::string_view 2020-04-03 16:13:15 +02:00
Max Kellermann e620677d7c lib/icu/CaseFold: pass std::string_view 2020-04-03 16:13:14 +02:00
Max Kellermann 09d8e44d56 lib/icu/Converter: pass std::string_view 2020-04-03 16:13:14 +02:00
Max Kellermann 9dc530ab51 lib/icu/Util: pass std::string_view 2020-04-03 16:13:14 +02:00
Max Kellermann 2d0798cd4d lib/icu/Win32: pass std::string_view 2020-04-03 16:13:14 +02:00
Max Kellermann 915c48f748 util/AllocatedString: std::string_view support 2020-04-03 16:08:55 +02:00
Max Kellermann 12b97bbe38 Merge tag 'v0.21.22'
release v0.21.22
2020-04-02 18:02:10 +02:00
Thomas Guillem 4dd10894ba lib/curl/Request: fix Exception "error" on Android
Apparently, it's not possible to change CURLOPT_NETRC on Android.
2020-03-26 17:26:14 +01: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 8474599ed6 lib/curl/Easy: add method Unpause() 2020-03-26 17:22:10 +01:00
Max Kellermann ab39f64fc0 lib/curl/Easy: add setter functions 2020-03-26 17:21:30 +01:00
Max Kellermann 185fbca282 lib/curl/Global: make ReadInfo() private 2020-03-26 17:20:10 +01:00
Max Kellermann 6e3b2fd844 lib/curl/Global: remove redundant API docs 2020-03-26 17:20:06 +01:00
Max Kellermann dab39dc778 lib/curl: fix coding style 2020-03-26 17:19:48 +01:00
Max Kellermann 8cd5e79fbd event/*, ...: make GetEventLoop() const 2020-03-26 17:19:13 +01:00
Max Kellermann 1de3ac6c78 lib/curl/Init: add const overloads 2020-03-26 17:18:27 +01:00
Max Kellermann abe06a5fa6 lib/curl/Init: add noexcept 2020-03-26 17:18:23 +01:00
Rosen Penev 00b9f69c90 remove some more extra semicolons
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 13:37:13 -07:00
Max Kellermann 256cfc545d Merge remote-tracking branches 'neheb/fwhfggwe', 'neheb/nvm2', 'neheb/nvm22', 'neheb/bvm' and 'neheb/cl2' 2020-03-16 17:25:50 +01:00
Rosen Penev e25a3d17e7 remove extra semicolon
Found with -Wextra-semi

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:13:20 -07: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
Max Kellermann d4135935e4 lib/upnp/Util: remove unused function stringToTokens() 2020-03-13 17:59:07 +01:00
Max Kellermann 569773cc75 lib/upnp/Device: remove UPnPService::clear() 2020-03-13 17:56:29 +01: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 2db8bcc353 replace stddef.h with cstddef
The former is deprecated with C++14. The standard says both are the same:

The contents and meaning of the header<cstddef>are the same as the C
standard library header<stddef.h>,except that it does not declare the type
wchar_t, that it also declares the type byte and its associated
operations (21.2.5), and as noted in 21.2.3 and 21.2.4.

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