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
bca9678683
tag/FixString: use IsNonPrintableASCII()
...
Fixes breakage of non-ASCII characters, regression from commit
cc72ceb368
Fixes https://github.com/MusicPlayerDaemon/MPD/issues/842
2020-04-27 14:01:54 +02:00
Max Kellermann
464b90210c
tag/GenParseName: include stdlib.h for EXIT_SUCCESS
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/838
2020-04-24 20:39:24 +02:00
Max Kellermann
fa45a8adfa
tag/ParseName: generate an optimized tag_name_parse() at build time
2020-04-24 16:28:29 +02:00
Max Kellermann
1532983fb5
tag/Pool: use strncmp() without strlen() to compare strings
2020-04-24 16:16:19 +02:00
Max Kellermann
ae5b2643da
tag/Builder: reserve room in std::vector in default constructor
...
This reduces resource waste for resizing the std::vector in most
cases.
2020-04-24 16:16:19 +02:00
Max Kellermann
02556ffce9
tag/Tag: use class DereferenceIterator
2020-04-24 16:02:36 +02:00
Max Kellermann
8a28f7b0a1
tag/FixString: add optimistic quick check
...
Optimizes a few nanoseconds from the common code path.
2020-04-24 15:57:40 +02:00
Max Kellermann
cc72ceb368
tag/FixString: use IsPrintableASCII()
2020-04-24 15:42:09 +02:00
Max Kellermann
0b3acc3eec
release v0.21.23
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl6huEwQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEgcrD/9jLUkiszNc+QWbUGj+RiTaD6fMxA1M8itn
nB7MKI/g/3ggryWMWNhG51O+8wFNs/4PmJJPGxKoU6i6wmS3YFhTAcs0ryilDGAU
1FumnMg/2qIyi2E6K2BMbi0YwZiJhBPWwD4JSt1KGvwPes/qQPFgHAi7ZWhP3tar
fHmgmjwDZ/Kgpl5/Bn7nVNgVuzk/MpBOSwxX9tFtRxqE9wdpm9idve7SVDT7MTvk
vdONWbAe8jXl/A8JHWaUsws0l7fyK5ZKSOXvdeSbzd67I8Rz3aqJMqUh2k/rDuv/
GrDyeEtLV5cXZsL4B3/34kCTKac2ZJmRbSh+buKeDc1Gf0clWnvRMdsMbSoRBY4F
lTWJbjndfq2+iHHBRfaqRjombv52R11yLT+O0aMLEm6l7xPm/rHZXJIcYSmCafd7
FR1qMaVKP5s+M+MqGePxzCUJSWJ+1bjZwjLaHrYXYPUoXSg3mSaeDE5g7BjQhm1E
2Hcfui9lvqR55UNo0NvDBjRT5FBGBUdjF6DjYplUGApw7xFtdahXlEvG7yfyg3ae
pZ3FQ1MZ4dESAw7EhTEBwajsVRQ9DhGQenYTxxCnGVdCucZRPQ9Abhas0U4iFHUA
wGj7j4WKPi+OUSyiT0j4nGuwEVtCkBFv34DqPMLjx8jqtJ8YgCt4iJD4dFwhk1zz
uoQBhq27Gg==
=sR2r
-----END PGP SIGNATURE-----
Merge tag 'v0.21.23'
release v0.21.23
2020-04-23 18:01:23 +02:00
geneticdrift
0a92fbc18e
tag/Fallback: add tag fallback for AlbumSort
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/832
2020-04-22 22:00:38 +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
12b97bbe38
release v0.21.22
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl6GCWgQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEvkQD/9qg6cnCgCKSOmTjteJu1ayeXBMDiL3cCCg
AwarHQoxsB0102NpV+MLka+4HIwHn+WNL55TzYgfbSh0nfmnki2fZ0YpsZoQR79w
MP11iMPnFH1oKqj58minBkFNmAis2aLYHJGKaQNUh7wcf0WhbVTqtWBUrKb07RQ0
Zj5lXtg65O/+yaCVdQGS6fMk2t7CqBM+S3RmbXCib/JRMC6aozoC7nWPvj8b2R8d
PgxwKMRzyslyFoxDQZrusDjJ1piyigzUMMr32yzYDED4Xr8jsEELaJfULbr6qWT2
ZNYF91e+D5V7riASAtlFTaVMaISx4QbHjKWR5Xcx0q/SJPAXTxF8RrAqGvqpWYmc
kqmC8iNxQsW5o3sNhI9qg6sOkq2dIu43VasRCvuo19GABR36wwTK5ORoazIi8fbU
/Ki/oZHtZczHRop9Cd6698Qr9jyTPdIs55FbgejzrVADvAmslqtcA6XxCBuG1nSF
Qo48dp9Px7J74qNNuDt5/xLnQGJKaW60/BXrMK9G9QG4x9r4zuCayDO6Qc7FMWWR
DG7k9nYoXJU5YG7xp9Rk+Yj3Ade8kqhTnKfqw0f2JfkLt0ChPG+rZcxICWSdzZm0
AfHxuEQlwKaaFHFEsZhVehlsXkeU9OVywo+QDzmY2uqQ2ddlBZ47Qm2MWgTsv8i/
euVsrzLtag==
=EedX
-----END PGP SIGNATURE-----
Merge tag 'v0.21.22'
release v0.21.22
2020-04-02 18:02:10 +02:00
Max Kellermann
b267ba5f0a
tag/Pool: enlarge hash table
...
This consumes more memory (plus 48 kB on 32 bit systems), but reduces
the number of hash collisions, speeding up MPD startup with large
databases.
2020-04-02 15:45:35 +02: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
Max Kellermann
8a1f1fbe06
util/ASCII: migrate to std::string_view
2020-03-13 20:17:53 +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
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
01632d37ef
Merge branch 'v0.21.x'
2020-03-12 08:11:08 +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
7bcccbedad
Merge remote-tracking branches 'neheb/bind', 'neheb/move' and 'neheb/str'
2020-02-04 17:03:49 +01:00
Max Kellermann
7c62887df7
tag/ApeTag: don't take reference of IterableSplitString() elements
...
This doesn't work because IterableSplitString() returns its elements
by value.
Fixes clang warning:
loop variable 'i' is always a copy because the range of type 'IterableSplitString' (aka 'BasicIterableSplitString<char>') does not return a reference [-Werror,-Wrange-loop-analysis]
2020-02-04 16:53:45 +01:00
Rosen Penev
452c41b71f
[clang-tidy] convert several functions to const &
...
Found with performance-unnecessary-value-param
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-02 13:21:27 -08:00
Max Kellermann
cd612c4eef
AudioFormat: move to pcm/
2020-01-18 20:24:59 +01:00
Max Kellermann
bdd3167495
tag/ApeLoader: remove exception handler, let caller catch
2020-01-18 19:51:46 +01:00
Max Kellermann
526c778162
tag/Id3Scan: remove exception handler, let caller catch
...
There's just one caller, i.e. ScanGenericTags(), which is documented
to throw exceptions.
2020-01-18 19:50:02 +01:00
Max Kellermann
2817bf9e95
copyright year 2020
2020-01-18 19:23:49 +01:00
Max Kellermann
e9af692973
util/Time*: move to time/
2019-12-16 23:02:14 +01:00
Max Kellermann
43ac264f54
tag/Mask: add noexcept
2019-11-05 10:56:20 +01:00
smutbert
4ecd4761c2
add tag "Conductor"
2019-10-25 10:12:32 +02:00
Max Kellermann
07fcf091a2
tag/MixRamp: pass StringView to ParseMixRampVorbis()
2019-08-14 19:42:48 +02:00
Max Kellermann
74a883dbf8
tag/MixRamp: add noexcept
2019-08-14 19:42:28 +02:00
Max Kellermann
433e18b247
decoder/{opus,vorbis}: support embedded pictures (METADATA_BLOCK_PICTURE)
...
More for https://github.com/MusicPlayerDaemon/MPD/issues/42
2019-08-14 12:39:03 +02:00
Max Kellermann
9ae9b2c18f
tag/VorbisComment: use struct StringView
2019-08-14 12:22:52 +02:00
Max Kellermann
8e0d810968
tag/MixRamp: use StringView in ParseMixRampTagTemplate()
2019-08-14 12:18:49 +02:00
Max Kellermann
575ba51931
tag/Id3Scan: support embedded pictures (the "APIC" tag)
2019-08-12 20:31:43 +02:00
Max Kellermann
96a1c69c29
tag/Handler: add virtual method OnPicture()
...
Preparing for https://github.com/MusicPlayerDaemon/MPD/issues/42
2019-08-12 20:31:43 +02:00
Max Kellermann
d663f81420
include cleanups (powered by iwyu)
2019-07-05 09:59:58 +02:00
Max Kellermann
ca8451cdbc
tag/Type: add tag "Work"
...
Closes https://github.com/MusicPlayerDaemon/MPD/issues/577
2019-06-17 22:40:36 +02:00
Max Kellermann
a139279575
Copyright year 2019
2019-06-17 11:17:30 +02:00
Max Kellermann
e153407b51
tag/Id3Scan: eliminate a string copy in UFID importer
2019-06-06 13:42:14 +02:00
Max Kellermann
5675431eaf
tag/ApeTag: use IterableSplitString
...
Eliminates yet another string copy.
2019-06-06 13:32:39 +02:00
Max Kellermann
80ec6f976c
tag/Table: add StringView overloads
2019-06-06 13:23:16 +02:00
Max Kellermann
589639f80f
tag/ParseName: add StringView overloads
2019-06-06 13:21:33 +02:00
Max Kellermann
548aa00111
tag/Handler: pass StringView to OnTag() and OnPair()
...
Eliminates a number of allocations, because callers don't need to copy
the strings to a newly allocated buffer only to null-terminate them.
And most callers don't need to have a null-terminated string.
2019-06-06 13:00:53 +02:00
Max Kellermann
e8a0ce643a
tag/Generic: fail if InputStream is not seekable
2019-05-31 17:49:37 +02:00