Commit 62b03cfd authored by Max Kellermann's avatar Max Kellermann

storage, db, mixer, command: remove more bogus "pure" attributes

This commit is similar to 788e3b31, 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
parent 18b827b9
...@@ -2,6 +2,7 @@ ver 0.20.9 (not yet released) ...@@ -2,6 +2,7 @@ ver 0.20.9 (not yet released)
* decoder * decoder
- ffmpeg: support *.adx - ffmpeg: support *.adx
* fix byte order detection on FreeBSD/aarch64 * fix byte order detection on FreeBSD/aarch64
* fix more random crashes when compiled with clang
ver 0.20.8 (2017/05/19) ver 0.20.8 (2017/05/19)
* output * output
......
...@@ -45,68 +45,57 @@ public: ...@@ -45,68 +45,57 @@ public:
: default_value; : default_value;
} }
gcc_pure
int ParseInt(unsigned idx) const { int ParseInt(unsigned idx) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgInt(data[idx]); return ParseCommandArgInt(data[idx]);
} }
gcc_pure
int ParseInt(unsigned idx, int min_value, int max_value) const { int ParseInt(unsigned idx, int min_value, int max_value) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgInt(data[idx], min_value, max_value); return ParseCommandArgInt(data[idx], min_value, max_value);
} }
gcc_pure
int ParseUnsigned(unsigned idx) const { int ParseUnsigned(unsigned idx) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgUnsigned(data[idx]); return ParseCommandArgUnsigned(data[idx]);
} }
gcc_pure
int ParseUnsigned(unsigned idx, unsigned max_value) const { int ParseUnsigned(unsigned idx, unsigned max_value) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgUnsigned(data[idx], max_value); return ParseCommandArgUnsigned(data[idx], max_value);
} }
gcc_pure
bool ParseBool(unsigned idx) const { bool ParseBool(unsigned idx) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgBool(data[idx]); return ParseCommandArgBool(data[idx]);
} }
gcc_pure
RangeArg ParseRange(unsigned idx) const { RangeArg ParseRange(unsigned idx) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgRange(data[idx]); return ParseCommandArgRange(data[idx]);
} }
gcc_pure
float ParseFloat(unsigned idx) const { float ParseFloat(unsigned idx) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgFloat(data[idx]); return ParseCommandArgFloat(data[idx]);
} }
gcc_pure
SongTime ParseSongTime(unsigned idx) const { SongTime ParseSongTime(unsigned idx) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgSongTime(data[idx]); return ParseCommandArgSongTime(data[idx]);
} }
gcc_pure
SignedSongTime ParseSignedSongTime(unsigned idx) const { SignedSongTime ParseSignedSongTime(unsigned idx) const {
assert(idx < size); assert(idx < size);
return ParseCommandArgSignedSongTime(data[idx]); return ParseCommandArgSignedSongTime(data[idx]);
} }
gcc_pure
int ParseOptional(unsigned idx, int default_value) const { int ParseOptional(unsigned idx, int default_value) const {
return idx < size return idx < size
? ParseInt(idx) ? ParseInt(idx)
: default_value; : default_value;
} }
gcc_pure
RangeArg ParseOptional(unsigned idx, RangeArg default_value) const { RangeArg ParseOptional(unsigned idx, RangeArg default_value) const {
return idx < size return idx < size
? ParseRange(idx) ? ParseRange(idx)
......
...@@ -106,7 +106,6 @@ public: ...@@ -106,7 +106,6 @@ public:
TagType tag_type, tag_mask_t group_mask, TagType tag_type, tag_mask_t group_mask,
VisitTag visit_tag) const = 0; VisitTag visit_tag) const = 0;
gcc_pure
virtual DatabaseStats GetStats(const DatabaseSelection &selection) const = 0; virtual DatabaseStats GetStats(const DatabaseSelection &selection) const = 0;
/** /**
......
...@@ -84,7 +84,6 @@ public: ...@@ -84,7 +84,6 @@ public:
* @return the current volume (0..100 including) or -1 if * @return the current volume (0..100 including) or -1 if
* unavailable * unavailable
*/ */
gcc_pure
virtual int GetVolume() = 0; virtual int GetVolume() = 0;
/** /**
......
...@@ -63,11 +63,12 @@ public: ...@@ -63,11 +63,12 @@ public:
/** /**
* Resamples a block of PCM data. * Resamples a block of PCM data.
* *
* Throws std::runtime_error on error.
*
* @param src the input buffer * @param src the input buffer
* @return the destination buffer (will be invalidated by * @return the destination buffer (will be invalidated by
* filter_close() or filter_filter()) * filter_close() or filter_filter())
*/ */
gcc_pure
virtual ConstBuffer<void> Resample(ConstBuffer<void> src) = 0; virtual ConstBuffer<void> Resample(ConstBuffer<void> src) = 0;
}; };
......
...@@ -39,7 +39,6 @@ public: ...@@ -39,7 +39,6 @@ public:
/** /**
* Throws #std::runtime_error on error. * Throws #std::runtime_error on error.
*/ */
gcc_pure
virtual StorageFileInfo GetInfo(bool follow) = 0; virtual StorageFileInfo GetInfo(bool follow) = 0;
}; };
...@@ -52,7 +51,6 @@ public: ...@@ -52,7 +51,6 @@ public:
/** /**
* Throws #std::runtime_error on error. * Throws #std::runtime_error on error.
*/ */
gcc_pure
virtual StorageFileInfo GetInfo(const char *uri_utf8, bool follow) = 0; virtual StorageFileInfo GetInfo(const char *uri_utf8, bool follow) = 0;
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment