From 62b03cfddf74c25d0b8187ce5e56d31ef49667b7 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 3 Jun 2017 21:54:21 +0200 Subject: [PATCH] storage, db, mixer, command: remove more bogus "pure" attributes This commit is similar to 788e3b31e1ab8243386339eaf136ede18f015d55, and removes more "pure" attributes which were placed on functions that could throw exceptions, which is illegal according to clang's understanding of the attribute (but not according to GCC's). GitHub issue #58 was most likely about StorageDirectoryReader::GetInfo() and Storage::GetInfo(), which still had "pure" attributes. Closes #58 --- NEWS | 1 + src/command/Request.hxx | 11 ----------- src/db/Interface.hxx | 1 - src/mixer/MixerInternal.hxx | 1 - src/pcm/Resampler.hxx | 3 ++- src/storage/StorageInterface.hxx | 2 -- 6 files changed, 3 insertions(+), 16 deletions(-) diff --git a/NEWS b/NEWS index c209cfa80..3cb18d103 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ ver 0.20.9 (not yet released) * decoder - ffmpeg: support *.adx * fix byte order detection on FreeBSD/aarch64 +* fix more random crashes when compiled with clang ver 0.20.8 (2017/05/19) * output diff --git a/src/command/Request.hxx b/src/command/Request.hxx index 884b5eea7..02f7804e5 100644 --- a/src/command/Request.hxx +++ b/src/command/Request.hxx @@ -45,68 +45,57 @@ public: : default_value; } - gcc_pure int ParseInt(unsigned idx) const { assert(idx < size); return ParseCommandArgInt(data[idx]); } - gcc_pure int ParseInt(unsigned idx, int min_value, int max_value) const { assert(idx < size); return ParseCommandArgInt(data[idx], min_value, max_value); } - gcc_pure int ParseUnsigned(unsigned idx) const { assert(idx < size); return ParseCommandArgUnsigned(data[idx]); } - gcc_pure int ParseUnsigned(unsigned idx, unsigned max_value) const { assert(idx < size); return ParseCommandArgUnsigned(data[idx], max_value); } - gcc_pure bool ParseBool(unsigned idx) const { assert(idx < size); return ParseCommandArgBool(data[idx]); } - gcc_pure RangeArg ParseRange(unsigned idx) const { assert(idx < size); return ParseCommandArgRange(data[idx]); } - gcc_pure float ParseFloat(unsigned idx) const { assert(idx < size); return ParseCommandArgFloat(data[idx]); } - gcc_pure SongTime ParseSongTime(unsigned idx) const { assert(idx < size); return ParseCommandArgSongTime(data[idx]); } - gcc_pure SignedSongTime ParseSignedSongTime(unsigned idx) const { assert(idx < size); return ParseCommandArgSignedSongTime(data[idx]); } - gcc_pure int ParseOptional(unsigned idx, int default_value) const { return idx < size ? ParseInt(idx) : default_value; } - gcc_pure RangeArg ParseOptional(unsigned idx, RangeArg default_value) const { return idx < size ? ParseRange(idx) diff --git a/src/db/Interface.hxx b/src/db/Interface.hxx index 4e01c42ce..a81d985a6 100644 --- a/src/db/Interface.hxx +++ b/src/db/Interface.hxx @@ -106,7 +106,6 @@ public: TagType tag_type, tag_mask_t group_mask, VisitTag visit_tag) const = 0; - gcc_pure virtual DatabaseStats GetStats(const DatabaseSelection &selection) const = 0; /** diff --git a/src/mixer/MixerInternal.hxx b/src/mixer/MixerInternal.hxx index 0d62fb0f3..4e2e50657 100644 --- a/src/mixer/MixerInternal.hxx +++ b/src/mixer/MixerInternal.hxx @@ -84,7 +84,6 @@ public: * @return the current volume (0..100 including) or -1 if * unavailable */ - gcc_pure virtual int GetVolume() = 0; /** diff --git a/src/pcm/Resampler.hxx b/src/pcm/Resampler.hxx index a82387e39..26d5014da 100644 --- a/src/pcm/Resampler.hxx +++ b/src/pcm/Resampler.hxx @@ -63,11 +63,12 @@ public: /** * Resamples a block of PCM data. * + * Throws std::runtime_error on error. + * * @param src the input buffer * @return the destination buffer (will be invalidated by * filter_close() or filter_filter()) */ - gcc_pure virtual ConstBuffer Resample(ConstBuffer src) = 0; }; diff --git a/src/storage/StorageInterface.hxx b/src/storage/StorageInterface.hxx index 57d15ab15..810b31687 100644 --- a/src/storage/StorageInterface.hxx +++ b/src/storage/StorageInterface.hxx @@ -39,7 +39,6 @@ public: /** * Throws #std::runtime_error on error. */ - gcc_pure virtual StorageFileInfo GetInfo(bool follow) = 0; }; @@ -52,7 +51,6 @@ public: /** * Throws #std::runtime_error on error. */ - gcc_pure virtual StorageFileInfo GetInfo(const char *uri_utf8, bool follow) = 0; /**