Commit Graph

80 Commits

Author SHA1 Message Date
jcorporation f4f79a3d5f New command "stickernames" lists uniq and sorted sticker names 2023-10-21 18:21:03 +02:00
gd 432675d4c2 Stickers: added support for stickers on playlists and some tag types 2023-10-15 11:25:16 +02:00
Max Kellermann fbdd2324a5 sticker/Database: add method Reopen() 2023-09-26 10:14:05 +02:00
Max Kellermann 8743326924 sticker/Database: allow moving 2023-08-03 20:54:57 +02:00
Max Kellermann 8b77da545d *: use transparent comparison for std::{map,set} with std::string keys
This avoids many std::string temporaries for lookups.
2023-03-12 09:12:02 +01:00
Max Kellermann 148aca23be use SPDX IDs, replacing the long copyright headers 2023-03-06 14:59:48 +01:00
Max Kellermann cc0def15c4 Copyright year 2022 2022-07-14 17:59:35 +02:00
Rosen Penev 250011f016 return by braced init list
shorter

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-22 23:28:08 -08:00
Max Kellermann 7d4de71899 sticker/SongSticker: use AllocatedString for concatenation 2021-10-13 12:19:45 +02:00
Rosen Penev 6ec5089cc9 remove std::make_pair
make_pair is an old C++98 function that can be replaced by modern
shorter constructs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-07 21:13:22 -07:00
Dave Hocker 18be8c3318 Fix compile error on macOS 11.15.2 (introduced by commit 30e3ef4) 2021-08-21 11:16:22 -05:00
Rosen Penev 30e3ef4c8e constexpr/std::array conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-08-16 21:05:56 -07:00
Max Kellermann d2bd12822f Merge branch 'v0.22.x' 2021-05-26 11:57:41 +02:00
Max Kellermann fd82d67678 sticker/Database: pass NarrowPath to sqlite3_open()
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1171
2021-05-25 18:45:45 +02:00
Max Kellermann 0440c41cba client/Response: add method Fmt() based on libfmt 2021-05-25 16:01:56 +02:00
Rosen Penev 44378b7dbe use structured binding declarations
Shorter.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-03-04 20:28:02 +01:00
Max Kellermann d4bbb8c851 Merge branch 'struc' of git://github.com/neheb/MPD 2021-03-04 17:50:53 +01:00
Max Kellermann 5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Rosen Penev 0fd2c74a66 use structured binding declarations
Shorter.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-10-28 15:41:31 -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
Rosen Penev 5d787806fe [clang-tidy] add ending namespace comments
Found with llvm-namespace-comment

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-16 16:44:37 -08:00
Max Kellermann 72ec641f0d *: use auto 2020-02-01 14:02:43 +01:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann cde6c46d2f util/Macros: replace with std::size() (C++17) 2019-08-03 13:10:49 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann a6dc1ab0a9 lib/sqlite/Database: wrapper for sqlite3* 2019-04-25 12:10:12 +02:00
Max Kellermann 77c9081f78 sticker/Database: wrap in class StickerDatabase 2019-04-25 12:05:18 +02:00
Max Kellermann c88d5616f7 sticker/Database: move sticker_prepare() to lib/sqlite/Util.hxx 2019-04-25 11:57:29 +02:00
Max Kellermann 34d483a34a lib/sqlite/Util: move into namespace 2019-04-25 11:56:52 +02:00
Max Kellermann 5a3828ed4a sticker/*: rename source files, drop "Sticker" prefix 2019-04-24 15:15:19 +02:00
Max Kellermann 3fe7f27345 sticker/Database: eliminate sticker_foreach() 2019-04-24 15:12:58 +02:00
Max Kellermann 0dccadff89 sticker/Database: remove unused function sticker_get_value() 2019-04-24 15:09:47 +02:00
Max Kellermann 5a915eb0e6 sticker/Database: return Sticker by value 2019-04-24 15:05:05 +02:00
Max Kellermann 7b48ae4f85 sticker/Database: move struct Sticker to Sticker.hxx 2019-04-24 15:03:52 +02:00
Max Kellermann 92dc4a0ca7 sticker/Database: add noexcept 2019-04-24 15:00:24 +02:00
Max Kellermann ce49d99c2f check.h: remove obsolete header
Since we switched from autotools to Meson in commit
94592c1406, we don't need to include
`config.h` early to properly enable large file support.  Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.

This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann 66fcd25b7e command/sticker, sticker/song: embed struct sticker_song_find_data in namespace
Fixes `-Werror=odr`
2018-08-09 12:57:47 +02:00
Max Kellermann 90201e9970 DetachedSong, db/LightSong, SongFilter: move to src/song/ 2018-08-02 13:51:18 +02:00
Max Kellermann 914df18bf9 Main, ...: catch any exception, not just std::runtime_error 2017-12-19 10:56:23 +01:00
Max Kellermann 788e3b31e1 *: remove "pure" and "const" attributes from throwing functions
The "pure" and "const" attributes are not so well-defined, and a
recent clang version implements an optimization which pushes the
definition's boundary beyond what I believed it was.  clang now
assumes that functions declared "pure" cannot throw exceptions, even
if they lack the "noexcept" specification.

When compiled with this new clang version, MPD will crash randomly if
an exception happens to get thrown by such as "pure" function
(https://github.com/MusicPlayerDaemon/MPD/issues/41).

This commit removes all such misplaced "pure" and "const" attributes,
closing #41.
2017-05-08 17:25:06 +02:00
Max Kellermann 71f0ed8b74 *: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
2017-05-08 14:44:49 +02:00
Max Kellermann 5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann 22dcca9832 util/Error: remove obsolete class 2016-11-10 12:58:26 +01:00
Max Kellermann 10e32454ef lib/sqlite, sticker: migrate from class Error to C++ exceptions 2016-10-27 07:50:08 +02:00
Max Kellermann 2deb5b7fec sticker/SongSticker: add missing <stdexcept> include
For std::runtime_error.  See http://bugs.musicpd.org/view.php?id=4509
2016-03-30 00:35:25 +02:00
Max Kellermann 2fd5182608 db/Interface: GetSong() throws exception on error 2016-03-19 00:19:50 +01:00
Max Kellermann 233b8d0129 sticker/Song: catch Database::GetSong() exceptions 2016-03-19 00:14:40 +01:00