*: add "noexcept" to many, many function prototypes

This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
This commit is contained in:
Max Kellermann
2017-05-08 14:44:49 +02:00
parent ac2e4e593d
commit 71f0ed8b74
272 changed files with 873 additions and 846 deletions

View File

@@ -151,7 +151,7 @@ PlayerControl::LockSetBorderPause(bool _border_pause)
}
player_status
PlayerControl::LockGetStatus()
PlayerControl::LockGetStatus() noexcept
{
player_status status;

View File

@@ -317,7 +317,7 @@ private:
* To be called from the main thread. Caller must lock the
* object.
*/
void SynchronousCommand(PlayerCommand cmd) {
void SynchronousCommand(PlayerCommand cmd) noexcept {
assert(command == PlayerCommand::NONE);
command = cmd;
@@ -332,7 +332,7 @@ private:
* To be called from the main thread. This method locks the
* object.
*/
void LockSynchronousCommand(PlayerCommand cmd) {
void LockSynchronousCommand(PlayerCommand cmd) noexcept {
const std::lock_guard<Mutex> protect(mutex);
SynchronousCommand(cmd);
}
@@ -383,7 +383,7 @@ public:
void Kill();
gcc_pure
player_status LockGetStatus();
player_status LockGetStatus() noexcept;
PlayerState GetState() const {
return state;

View File

@@ -32,7 +32,7 @@ static constexpr Domain cross_fade_domain("cross_fade");
gcc_pure
static float
mixramp_interpolate(const char *ramp_list, float required_db)
mixramp_interpolate(const char *ramp_list, float required_db) noexcept
{
float last_db = 0, last_secs = 0;
bool have_last = false;
@@ -91,7 +91,7 @@ CrossFadeSettings::Calculate(SignedSongTime total_time,
const char *mixramp_start, const char *mixramp_prev_end,
const AudioFormat af,
const AudioFormat old_format,
unsigned max_chunks) const
unsigned max_chunks) const noexcept
{
unsigned int chunks = 0;
float chunks_f;

View File

@@ -66,7 +66,7 @@ struct CrossFadeSettings {
const char *mixramp_start,
const char *mixramp_prev_end,
AudioFormat af, AudioFormat old_format,
unsigned max_chunks) const;
unsigned max_chunks) const noexcept;
};
#endif