Commit Graph

15037 Commits

Author SHA1 Message Date
Max Kellermann 85b072b3d3 util/StringCompare: add StringIsEqual() with string_view 2020-03-13 20:36:48 +01:00
Max Kellermann 8a1f1fbe06 util/ASCII: migrate to std::string_view 2020-03-13 20:17:53 +01:00
Max Kellermann 45b60b3d38 fs/Traits: GetParent() returns std::string_view 2020-03-13 20:01:10 +01:00
Max Kellermann cefc773992 playlist/PlaylistSong: pass std::string_view 2020-03-13 19:58:36 +01:00
Max Kellermann a885bdba4c fs/Traits: pass string_view to Build() 2020-03-13 19:55:28 +01:00
Max Kellermann b6b15afb5a fs/Path: make constructor `explicit` 2020-03-13 19:55:25 +01:00
Max Kellermann 1d560c8f0f fs/AllocatedPath: add `string_view` constructor 2020-03-13 19:46:29 +01:00
Max Kellermann 189f6eaa6f fs/Traits: add string_view 2020-03-13 19:43:39 +01:00
Max Kellermann 87f78b9c39 fs/Traits: use {} notation for return values 2020-03-13 19:43:23 +01:00
Max Kellermann aa722bd8ac fs/Traits: use `auto` 2020-03-13 19:43:23 +01:00
Max Kellermann 58c7ec07a4 fs: use `using` instead of `typedef` 2020-03-13 19:43:23 +01:00
Max Kellermann 3796247d6d util/Stringview: use `const_pointer` instead of hard-coding `const char *`
Fixes Windows build failure.
2020-03-13 19:43:23 +01:00
Max Kellermann 332f480ec3 util/UriExtract: uri_get_path() returns std::string_view 2020-03-13 18:54:41 +01:00
Max Kellermann 9a164668f2 util/UriExtract: migrate uri_get_scheme() to std::string_view 2020-03-13 18:51:11 +01:00
Max Kellermann 6876d160cf util/StringCompare: add more StringView overloads 2020-03-13 18:49:47 +01:00
Max Kellermann a63d0ee8fc util/StringView: add method substr() 2020-03-13 18:48:40 +01: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
Rosen Penev c846ee0d1b
replace stdarg.h with cstdarg
The former was deprecated in C++14. The Standard says they are the same:

The contents of the header<cstdarg>are the same as the C standard library
header<stdarg.h>, with the following changes: The restrictions that ISO C
places on the second parameter to the va_start macro in header<stdarg.h>
are different in this International Standard. The parameter parmN is the
rightmost parameter in the variable parameter list of the function
definition (the one just before the...).219If the parameter parmN is a
pack expansion (17.5.3) or an entity resulting from a lambda capture
(8.1.5), the program is ill-formed, no diagnostic required. If the
parameter parmN is of a reference type, or of a type that is not
compatible with the type that results when passing an argument for which
there is no parameter, the behavior is undefined.

Also changed va_list to the std:: namespace version, which is the same.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:03:12 -07:00
Rosen Penev 69a51e12c9
replace signal.h with csignal.h
The former was deprecated with C++14. The standard says they are the same:

The contents of the header<csignal>are the same as the C standard library
header<signal.h>.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 18:56:51 -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
Rosen Penev 5cd400f578
replace inttypes.h with cinttypes
The former has been deprecated by C++14. They are also the same.

From the standard:

The contents and meaning of the header<cinttypes>are the same as the C
standard library header<inttypes.h>, with the following changes:

-The header<cinttypes>includes the header<cstdint>instead of<stdint.h>,and
—if and only if the typeintmax_tdesignates an extended integer type
 (6.7.1), the following functionsignatures are added:intmax_t
abs(intmax_t);imaxdiv_t div(intmax_t, intmax_t);which shall have the same
semantics as the function signaturesintmax_t imaxabs(intmax_t)andimaxdiv_t
imaxdiv(intmax_t, intmax_t), respectively.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 16:07:28 -07:00
Rosen Penev edc4989d9c
change errno.h to cerrno
The former is deprecated by C++14. It's also functionally the same.

From the standard:

19.4
The header<cerrno>is described in Table 43. Its contents are the same as
the POSIX header<errno.h>,except that errno shall be defined as a macro.
[Note: The intent is to remain in close alignment with the POSIX
standard.] A separate errno value shall be provided for each thread.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:51:16 -07:00
Rosen Penev 2b3d6461e3
remove unused ctype.h header
None of the functions in these files come from ctype.h

Also changed one instance of isdigit to the C++ variant.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:43:50 -07:00
Rosen Penev ab9f5d2067
replace assert.h with cassert
The former was deprecated with C++14.

According to the C++11 and C++17 standards, both files are identical.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann a718086ffb test/run_convert: add option --config 2020-03-12 21:41:39 +01:00
Max Kellermann 8d40e68dec test/run_convert: add option --verbose 2020-03-12 21:41:39 +01:00
Max Kellermann de0affe115 test/run_convert: move code to ParseCommandLine() 2020-03-12 21:40:27 +01:00
Max Kellermann 26e718c7c3 doc/user.rst, .travis.yml: drop GCC 6 support
Debian Stable (Buster) has GCC 8 and Ubuntu LTS (18.04) has GCC 7.

This will unlock a lot of C++17 features like `std::string_view`.
2020-03-12 21:37:07 +01:00
Rosen Penev f00f8b002a
[clang-tidy] use nodiscard
Introduced in C++17. It replaces gcc's warn_unused_result.

Found with modernize-use-nodiscard.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 12:59:16 -07:00
Max Kellermann 2229e86673 client/Expire: cancel the BackgroundCommand before deleting it
Fixes assertion failure.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/774
2020-03-12 20:32:08 +01:00
Max Kellermann f24c274f5c client/BackgroundCommand: fix typo in comment 2020-03-12 20:32:07 +01:00
Max Kellermann 3824bf66ca lib/chromaprint/DecoderClient: add assertion 2020-03-12 20:32:07 +01:00
Max Kellermann d942f874ae lib/chromaprint/DecoderClient: check `ready` in GetCommand()
Fixes access to uninitialized memory (`remaining_bytes` isn't
initialized until Ready() is called) and fixes spurious
`getfingerprint` failures.
2020-03-12 20:31:46 +01:00
Max Kellermann 01632d37ef Merge branch 'v0.21.x' 2020-03-12 08:11:08 +01:00
Max Kellermann c45f113856 playlist/xspf: concatenate multiple CharacterData fragments
Closes https://github.com/MusicPlayerDaemon/MPD/issues/781
2020-03-12 08:02:58 +01:00
Max Kellermann e0a8fd398c playlist/xspf: add State::TAG 2020-03-12 08:00:54 +01:00
Max Kellermann 3e97058151 playlist/xspf: move location.empty() check to _start_element() 2020-03-11 20:54:53 +01:00
Max Kellermann 51b1dd8672 playlist/xspf: use tag_table to convert element name to TagType 2020-03-11 20:51:47 +01:00
Max Kellermann 98a7d8da6c playlist/xspf: use C++11 initializer 2020-03-11 20:51:10 +01:00
Max Kellermann acb29f792f tag/Mask: fix yet another typo, this time in Unset()
Similar to commits e8f2f98048 and
ff1ff1e54a

Closes https://github.com/MusicPlayerDaemon/MPD/issues/783
2020-03-11 20:34:02 +01:00
Max Kellermann cd364023ae .travis.yml: rename "matrix" to "jobs"
Travis has changed the canonical name for this a while ago.

(Now really.  The last commit for this was empty.)
2020-03-07 09:31:46 +01:00
Max Kellermann 8d34a1cfc6 archive/iso9660: skip empty filenames
Aparently, libcdio sometimes returns empty filenames, causing MPD
crashes.  This shouldn't really happen, and I consider this a libcdio
bug - but if it happens, people blame MPD, so let's add a check.

Closes https://github.com/MusicPlayerDaemon/MPD/issues/776
2020-03-07 09:30:56 +01:00
Max Kellermann 73a1f078a6 archive/iso9660: use IsSpecialFilename() 2020-03-07 09:30:56 +01:00
Max Kellermann b7ce452308 fs/Traits: add IsSpecialFilename()
Merge some duplicate code in a central library.
2020-03-07 09:30:56 +01:00
Max Kellermann 5faf76051d .travis.yml: force updating homebrew on OSX
Workaround for Travis failures as described in
 https://travis-ci.community/t/macos-build-fails-because-of-homebrew-bundle-unknown-command/7296/18
2020-03-07 09:30:56 +01:00
Max Kellermann 5fe70a3417 .travis.yml: rename "matrix" to "jobs"
Travis has changed the canonical name for this a while ago.
2020-03-07 09:30:56 +01:00
Thomas Klausner 7a68b1e71f Adapt SolarisOutputPlugin.cxx to be usable on NetBSD. 2020-02-29 10:05:29 +01:00