diff options
author | Chris Robinson <[email protected]> | 2018-11-22 19:47:41 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-11-22 19:47:41 -0800 |
commit | 976e49711b47d6c742995986e976275badb5c9f0 (patch) | |
tree | 684aacff7bcf8e21b001914cc1b82d87b4c4e62b | |
parent | 30ee6e1b3f3e859b10816234149795219c9108f9 (diff) |
Add noexcept to a bunch of inline functions
-rw-r--r-- | OpenAL32/Include/alMain.h | 10 | ||||
-rw-r--r-- | OpenAL32/Include/alu.h | 46 |
2 files changed, 28 insertions, 28 deletions
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 036d4ec3..efec58a0 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -219,7 +219,7 @@ struct bs2b; /* Find the next power-of-2 for non-power-of-2 numbers. */ -inline ALuint NextPowerOf2(ALuint value) +inline ALuint NextPowerOf2(ALuint value) noexcept { if(value > 0) { @@ -234,7 +234,7 @@ inline ALuint NextPowerOf2(ALuint value) } /** Round up a value to the next multiple. */ -inline size_t RoundUp(size_t value, size_t r) +inline size_t RoundUp(size_t value, size_t r) noexcept { value += r-1; return value - (value%r); @@ -245,7 +245,7 @@ inline size_t RoundUp(size_t value, size_t r) * change it on its own threads. On some systems, a truncating conversion may * always be the fastest method. */ -inline ALint fastf2i(ALfloat f) +inline ALint fastf2i(ALfloat f) noexcept { #if defined(HAVE_INTRIN_H) && ((defined(_M_IX86_FP) && (_M_IX86_FP > 0)) || defined(_M_X64)) return _mm_cvt_ss2si(_mm_set1_ps(f)); @@ -283,7 +283,7 @@ inline ALint fastf2i(ALfloat f) } /* Converts float-to-int using standard behavior (truncation). */ -inline int float2int(float f) +inline int float2int(float f) noexcept { #if ((defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \ !defined(__SSE_MATH__)) || (defined(_MSC_VER) && defined(_M_IX86_FP) && _M_IX86_FP == 0) @@ -316,7 +316,7 @@ inline int float2int(float f) * rounding mode. This is essentially an inlined version of rintf, although * makes fewer promises (e.g. -0 or -0.25 rounded to 0 may result in +0). */ -inline float fast_roundf(float f) +inline float fast_roundf(float f) noexcept { #if (defined(__GNUC__) || defined(__clang__)) && (defined(__i386__) || defined(__x86_64__)) && \ !defined(__SSE_MATH__) diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index d086bcc7..eb71290a 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -304,61 +304,61 @@ typedef void (*HrtfDirectMixerFunc)(ALfloat *RESTRICT LeftOut, ALfloat *RESTRICT #define FRACTIONMASK (FRACTIONONE-1) -inline ALfloat minf(ALfloat a, ALfloat b) +inline ALfloat minf(ALfloat a, ALfloat b) noexcept { return ((a > b) ? b : a); } -inline ALfloat maxf(ALfloat a, ALfloat b) +inline ALfloat maxf(ALfloat a, ALfloat b) noexcept { return ((a > b) ? a : b); } -inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max) +inline ALfloat clampf(ALfloat val, ALfloat min, ALfloat max) noexcept { return minf(max, maxf(min, val)); } -inline ALdouble mind(ALdouble a, ALdouble b) +inline ALdouble mind(ALdouble a, ALdouble b) noexcept { return ((a > b) ? b : a); } -inline ALdouble maxd(ALdouble a, ALdouble b) +inline ALdouble maxd(ALdouble a, ALdouble b) noexcept { return ((a > b) ? a : b); } -inline ALdouble clampd(ALdouble val, ALdouble min, ALdouble max) +inline ALdouble clampd(ALdouble val, ALdouble min, ALdouble max) noexcept { return mind(max, maxd(min, val)); } -inline ALuint minu(ALuint a, ALuint b) +inline ALuint minu(ALuint a, ALuint b) noexcept { return ((a > b) ? b : a); } -inline ALuint maxu(ALuint a, ALuint b) +inline ALuint maxu(ALuint a, ALuint b) noexcept { return ((a > b) ? a : b); } -inline ALuint clampu(ALuint val, ALuint min, ALuint max) +inline ALuint clampu(ALuint val, ALuint min, ALuint max) noexcept { return minu(max, maxu(min, val)); } -inline ALint mini(ALint a, ALint b) +inline ALint mini(ALint a, ALint b) noexcept { return ((a > b) ? b : a); } -inline ALint maxi(ALint a, ALint b) +inline ALint maxi(ALint a, ALint b) noexcept { return ((a > b) ? a : b); } -inline ALint clampi(ALint val, ALint min, ALint max) +inline ALint clampi(ALint val, ALint min, ALint max) noexcept { return mini(max, maxi(min, val)); } -inline ALint64 mini64(ALint64 a, ALint64 b) +inline ALint64 mini64(ALint64 a, ALint64 b) noexcept { return ((a > b) ? b : a); } -inline ALint64 maxi64(ALint64 a, ALint64 b) +inline ALint64 maxi64(ALint64 a, ALint64 b) noexcept { return ((a > b) ? a : b); } -inline ALint64 clampi64(ALint64 val, ALint64 min, ALint64 max) +inline ALint64 clampi64(ALint64 val, ALint64 min, ALint64 max) noexcept { return mini64(max, maxi64(min, val)); } -inline ALuint64 minu64(ALuint64 a, ALuint64 b) +inline ALuint64 minu64(ALuint64 a, ALuint64 b) noexcept { return ((a > b) ? b : a); } -inline ALuint64 maxu64(ALuint64 a, ALuint64 b) +inline ALuint64 maxu64(ALuint64 a, ALuint64 b) noexcept { return ((a > b) ? a : b); } -inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max) +inline ALuint64 clampu64(ALuint64 val, ALuint64 min, ALuint64 max) noexcept { return minu64(max, maxu64(min, val)); } -inline size_t minz(size_t a, size_t b) +inline size_t minz(size_t a, size_t b) noexcept { return ((a > b) ? b : a); } -inline size_t maxz(size_t a, size_t b) +inline size_t maxz(size_t a, size_t b) noexcept { return ((a > b) ? a : b); } -inline size_t clampz(size_t val, size_t min, size_t max) +inline size_t clampz(size_t val, size_t min, size_t max) noexcept { return minz(max, maxz(min, val)); } -inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) +inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) noexcept { return val1 + (val2-val1)*mu; } -inline ALfloat cubic(ALfloat val1, ALfloat val2, ALfloat val3, ALfloat val4, ALfloat mu) +inline ALfloat cubic(ALfloat val1, ALfloat val2, ALfloat val3, ALfloat val4, ALfloat mu) noexcept { ALfloat mu2 = mu*mu, mu3 = mu2*mu; ALfloat a0 = -0.5f*mu3 + mu2 + -0.5f*mu; |