Commit Graph

54 Commits

Author SHA1 Message Date
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
Max Kellermann
296ee4961e sticker/Song: add _delete() overload with "const char *" 2016-03-18 16:21:26 +01:00
Max Kellermann
1aee89f5ea *: include cleanup (using iwyu) 2016-03-01 22:08:13 +01:00
Max Kellermann
1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Max Kellermann
c880099deb util/StringCompare: add StringIsEmpty() 2015-11-06 09:37:07 +01:00
Max Kellermann
7652a2986b client/Response: new Client wrapper class for writing responses 2015-08-12 08:41:05 +02:00
Max Kellermann
593bb5a8a7 StickerDatabase: convert the struct name to upper case 2015-01-28 19:33:56 +01:00
Max Kellermann
712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann
49968541fd sticker/Match: add inequality operators 2014-12-12 22:26:04 +01:00
Max Kellermann
cc143105b8 sticker/Match: add operator "EQUALS"
Mapped to "=" in the MPD protocol.  This is the first operator,
initially supporting value matches in the MPD protocol.
2014-12-12 22:16:00 +01:00
Max Kellermann
fed44e95b3 sticker/Song: add enum StickerOperator to sticker_song_find() 2014-12-12 22:10:24 +01:00
Max Kellermann
71ece56470 sticker/Database: move code to BindFind() 2014-12-12 22:04:43 +01:00
Max Kellermann
204a1de3fd sticker/Database: use the Error library 2014-12-12 21:43:54 +01:00
Max Kellermann
80ddf4aecf sticker/Database: always invoke sqlite3_reset() and sqlite3_clear_bindings() 2014-12-12 21:43:54 +01:00
Max Kellermann
12b4a666bc lib/sqlite/Util: add ExecuteModified() 2014-12-12 21:43:54 +01:00
Max Kellermann
cfdbaf331e sticker/Database: add wrapper for sqlite3_step() 2014-12-12 21:43:54 +01:00
Max Kellermann
052d350b19 sticker/Database: move SQLite helpers to lib/sqlite/Util.hxx 2014-12-12 21:42:51 +01:00
Max Kellermann
2ca18a7ee5 lib/sqlite/Domain: add Domain instance for SQLite
Replaces the sticker_domain for Error::domain.
2014-12-12 20:49:00 +01:00
Max Kellermann
7dbe5f4640 sticker/Database: remove redundant sqlite3_reset() calls
Call sqlite3_reset() only after a sqlite3_stmt* has been used, not
before.  Assume it is already in reusable state.
2014-12-12 20:43:26 +01:00
Max Kellermann
432ecd1b6a sticker/Database: require SQLite 3.7.3
SQLite 3.7.3 is the version shipped in Debian Squeeze (oldstable);
should be old enough to be the required version.  Drop the
compatibility #ifdef.
2014-12-12 20:41:36 +01:00
Max Kellermann
43267dc892 sticker/Database: make variables more local 2014-12-12 14:27:47 +01:00
Max Kellermann
3ec6c26e6c sticker/Database: add sqlite3_bind_text() wrapper 2014-12-12 14:13:35 +01:00
Max Kellermann
7de684668b sticker/Database: remove C-style (void) 2014-12-12 14:12:31 +01:00
Max Kellermann
5c244e9a8c SongSticker: remove obsolete documentation 2014-12-04 20:53:48 +01:00
Max Kellermann
fa0aa91bf9 SongSticker, playlist/soundcloud: add missing stdlib.h include
For free().
2014-10-25 23:49:29 +02:00
Max Kellermann
3e641e2147 SongSticker: don't use GLib 2014-10-25 01:25:33 +02:00
Max Kellermann
ae594ad92c DatabasePlugin: split header 2014-02-19 22:54:52 +01:00