summaryrefslogtreecommitdiff
path: root/src/pcm/SampleFormat.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-01-17 22:52:09 +0100
committerMax Kellermann <max@musicpd.org>2017-01-17 22:52:09 +0100
commit3f321ae9a05a88b6b036b6bd845d5b60b586ceb3 (patch)
tree71e869c5f70cc62c819169b6069cefccad5f2667 /src/pcm/SampleFormat.hxx
parent161d32a7e79cdbfed22ad97c6cc1cec15958b4f2 (diff)
pcm/SampleFormat: make the two inline functions "constexpr"
Diffstat (limited to 'src/pcm/SampleFormat.hxx')
-rw-r--r--src/pcm/SampleFormat.hxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/pcm/SampleFormat.hxx b/src/pcm/SampleFormat.hxx
index e5b4c5985..25e6352b6 100644
--- a/src/pcm/SampleFormat.hxx
+++ b/src/pcm/SampleFormat.hxx
@@ -22,7 +22,6 @@
#include "Compiler.h"
-#include <assert.h>
#include <stdint.h>
#if defined(WIN32) && GCC_CHECK_VERSION(4,6)
@@ -65,7 +64,7 @@ enum class SampleFormat : uint8_t {
/**
* Checks whether the sample format is valid.
*/
-static inline bool
+static constexpr inline bool
audio_valid_sample_format(SampleFormat format)
{
switch (format) {
@@ -84,8 +83,7 @@ audio_valid_sample_format(SampleFormat format)
return false;
}
-gcc_const
-static inline unsigned
+static constexpr inline unsigned
sample_format_size(SampleFormat format)
{
switch (format) {
@@ -108,7 +106,6 @@ sample_format_size(SampleFormat format)
return 0;
}
- assert(false);
gcc_unreachable();
}