Commit 3f321ae9 authored by Max Kellermann's avatar Max Kellermann

pcm/SampleFormat: make the two inline functions "constexpr"

parent 161d32a7
......@@ -19,6 +19,8 @@
#include "SampleFormat.hxx"
#include <assert.h>
const char *
sample_format_to_string(SampleFormat format)
{
......
......@@ -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();
}
......
......@@ -27,6 +27,7 @@
#include "PcmDither.cxx" // including the .cxx file to get inlined templates
#include <assert.h>
#include <stdint.h>
#include <string.h>
......
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