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
Rosen Penev
3540cf26b1
replace exit and _exit with std variants
...
_exit and std::_Exit are identical, expect the latter is standard C++.
Added several functions to the std namespace as a result of headers.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-26 18:44:09 -07:00
Rosen Penev
cfa4524cb3
util/Math: change define
...
This has nothing to do with uClibc. It has everything to do with gcc's
libstdc++.
C99 math can be compile time disabled for it. Check for that and use boost
lround when std is not available.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:45 +01:00
Rosen Penev
4fd0c84f46
replace lrint with lround
...
lrint is a configurable version of lround that behaves either as round,
floor, ceil, or trunc based on setting the proper FE_ macro using
fset/getround. Given that it's not set at all and that it defaults to
round behavior, simply replace with round.
Also removed the util/Math defines.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:44 +01:00
Rosen Penev
e41a52d909
change abs() to std::abs()
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:42 +01:00
Rosen Penev
01e00632cc
[cppcheck] fix format string
...
Found with invalidPrintfArgType_sint
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-25 19:27:40 +01:00
Rosen Penev
9bad5ee3c5
remove boost pow stuff for uClibc-ng
...
It's available there.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-24 17:21:21 -07:00
Rosen Penev
e87454ae88
MpcdecDecoderPlugin: use std variant of pow
...
It's available with uClibc-ng. It also offers overloads.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-24 17:16:51 -07:00
Rosen Penev
f319f88df4
[cppcheck] use const for several variables
...
Found with constVariable
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-23 21:03:22 -07:00
Max Kellermann
637840264a
util/WStringCompare: reorder functions to relocate API docs
2020-03-22 19:20:29 +01:00
Max Kellermann
3888bafc1f
util/StringCompare: add API documentation
2020-03-22 19:15:55 +01:00
Max Kellermann
adad4c7298
util/StringCompare: add missing include
2020-03-22 19:12:02 +01:00
Max Kellermann
d54acbcffd
Merge branch 'sles-assert-fix' of git://github.com/tguillem/MPD-1
2020-03-22 10:51:28 +01:00
Thomas Guillem
86613af37e
output/sles: fix invalid assert
...
Regression from 973c87b351
2020-03-21 22:34:04 +01:00
Rosen Penev
ba3ff10ccd
remove false ifdef
...
The entire section falls under the else path of #ifdef _WIN32. Checking
for it makes no sense. Probably some refactoring mistake.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-20 17:56:33 -07:00
Max Kellermann
1ec283d213
util/Exception: include cleanup
2020-03-19 20:13:04 +01:00
Max Kellermann
2261bcb5d3
android/Environment: remove another extra semicolon
2020-03-19 20:13:04 +01:00
Max Kellermann
0e17629445
android/Environment: remove extra semicolon
2020-03-19 15:27:43 +01:00
Max Kellermann
0da6344726
release v0.21.21
...
-----BEGIN PGP SIGNATURE-----
iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl5zgCQQHG1heEBtdXNp
Y3BkLm9yZwAKCRAjbopYxttFEnkCD/0RNcohFb2svCDYXuAz3BN5hBxUvepMJJId
aNaT+jz8FpWTpIi4TaHqF4iODyDXR9YkVBv2aPqEjJad0tVEHHijyHkA25jd8moz
lR46RRK4CEkBTTlmui9FmajelqoidMxRMQLR8HRTKCQPPZcgXhNOhdciJg1EovMT
maZD81UyuZXPAq+v3IMJHy+H/LUA5yFcsjIdyJs7EEFZXHb9LUVRW/ZxUwFzl1Os
TAiLQ0Ix4ebsy1MmE4n7f9T6dAuPO/+GkHXMKn6ruvAYUKPeKcjjdm5QW+Gyt9X1
IArx0oaEqxPY5r7YruyGoPMj9pIwMVnHMLCTc8sbBNKS8ibtD/mlI+9Vj8C4gCoZ
ZRjMFnPMSC6RmoTWbDw8U28j0vxMbQ/SWrLNIgW44QUHyFPfBgWNwqqKux6b/Mph
u+SjVi/9ds8FKewLVi3dotdS8YmPF/b46Ov0ycfWLbyB7BvcP31o1zR1uLN6BqYj
bzI4n4hKOxT0SsA74odJJDamA60J/DW4tAGxyscKaq8pDFYlBFo9dq+9+/aoDAMj
sFLP32h/HqlO/ilZuuUVES4tg/shzF7VOhI9+GCvc/Ic1NXIdug4pUcXJ8ubXxzD
ObnvF8RX8Vwf/ofwjcHIE7sqJAT5/QZhB1RTg/SkdlaUczjle0gVgCN1hAqlNSCP
mJ8831lArg==
=YxBZ
-----END PGP SIGNATURE-----
Merge tag 'v0.21.21'
release v0.21.21
2020-03-19 15:26:27 +01:00
Max Kellermann
c560ec8ea6
release v0.21.21
2020-03-19 15:22:28 +01:00
Rosen Penev
cade4e71c4
[clang-tidy] add [[nodiscard]]
...
Found with modernize-use-nodiscard
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +01:00
Rosen Penev
403612c666
[clang-tidy] run through performance checks
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +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
d2115e908a
[clang-tidy] remove redundant access specifiers
...
Found with readability-redundant-access-specifiers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-19 13:38:40 +01:00
Max Kellermann
56c234b410
raise default "max_connections" value to 100
...
Documentation says the limit is 5, but it was really 10 (at least
since 2004). But since MPD wants to promote using many small clients
idling around, and these clients consume only very few resources, it
seems reasonable to raise this limit's default value.
2020-03-19 13:30:46 +01:00
Max Kellermann
61b5ab2663
thread/CriticalSection: remove extra semicolons
2020-03-17 16:57:57 +01:00
Rosen Penev
84f71cec2c
add two extra noreturn that clang picked up
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 23:02:35 -07:00
Rosen Penev
a5b136c420
test: fix double promotion
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 22:56:30 -07:00
Rosen Penev
c7144ed5c7
add recently fixed warnings to warning list
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 22:56:29 -07: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
Rosen Penev
6d91b5c7b2
fix double promotions
...
Found with -Wdouble-promotion
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 12:43:24 -07:00
Max Kellermann
fd71514068
Merge remote-tracking branch 'neheb/h'
2020-03-16 17:29:05 +01: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
77c6c3fabf
remove unreachable code
...
Found with -Wunreachable-code-break
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:14:13 -07: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
7f10e7a610
fix implicit-fallthrough warnings under clang
...
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:12:38 -07:00
Rosen Penev
88d56c01e7
fix missing overrides
...
Found with clang's -Winconsistent-missing-destructor-override
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:11:15 -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
0afb156a5b
remove gcc_warn_unused
...
[[nodiscard] (introduced in C++17) can be used instead.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev
a192e7b29b
remove gcc_deprecated
...
[[deprecated]] (introduced in C++14) may be used instead.
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
5e4b7e2fb7
[clang-tidy] fix incorrect rounding
...
Found with bugprone-incorrect-roundings
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:22:08 -07:00
Rosen Penev
177371a003
treewide: get rid of C math function usage
...
Boost does not seem to offer an overload for lrint.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:22:07 -07:00
Rosen Penev
a78841d6a9
volume_mapping: get rid of exp10 workaround
...
exp10 is a GNU function, is not part of C++, and is not available
everywhere.
pow(10,x) is an alternative that works just as well. It is used in musl as
the implementation of exp10.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:17:31 -07:00
Rosen Penev
3ec9fcfc44
treewide: use boost::lround when std::round is unavailable
...
This is the case with uClibc-ng currently.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-15 20:17:31 -07:00
Max Kellermann
b5d1a09010
util/StringUtil: pass std::string_view to StringArrayContainsCase()
2020-03-13 20:38:40 +01:00
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