diff options
author | Gregory Maxwell <greg@xiph.org> | 2013-10-18 02:56:52 +0400 |
---|---|---|
committer | Gregory Maxwell <greg@xiph.org> | 2013-10-28 21:18:54 +0400 |
commit | 7830cf1bd2c71bad9aa296254cf5c5f9842e8b8e (patch) | |
tree | 53f28e34554bee867a239849b96283bec549a607 /src | |
parent | 2891d852a38b3acb1810fad9f26ba7e0b181cfb2 (diff) |
Replace "inline" with OPUS_INLINE.
Newer versions of MSVC are unhappy with the strategy of the build
environment redefining "inline" (even though they don't support the
actual keyword). Instead we define OPUS_INLINE to the right thing
in opus_defines.h.
This is the same approach we use for restrict.
Diffstat (limited to 'src')
-rw-r--r-- | src/analysis.c | 2 | ||||
-rw-r--r-- | src/mlp.c | 7 | ||||
-rw-r--r-- | src/opus_decoder.c | 2 | ||||
-rw-r--r-- | src/opus_private.h | 2 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/analysis.c b/src/analysis.c index 53247df9..2dd087b8 100644 --- a/src/analysis.c +++ b/src/analysis.c @@ -115,7 +115,7 @@ static const int extra_bands[NB_TOT_BANDS+1] = { #define cB 0.67848403f #define cC 0.08595542f #define cE ((float)M_PI/2) -static inline float fast_atan2f(float y, float x) { +static OPUS_INLINE float fast_atan2f(float y, float x) { float x2, y2; /* Should avoid underflow on the values we'll get */ if (ABS16(x)+ABS16(y)<1e-9f) @@ -29,6 +29,9 @@ #include "config.h" #endif +#include "opus_types.h" +#include "opus_defines.h" + #include <math.h> #include "mlp.h" #include "arch.h" @@ -36,7 +39,7 @@ #define MAX_NEURONS 100 #if 0 -static inline opus_val16 tansig_approx(opus_val32 _x) /* Q19 */ +static OPUS_INLINE opus_val16 tansig_approx(opus_val32 _x) /* Q19 */ { int i; opus_val16 xx; /* Q11 */ @@ -62,7 +65,7 @@ static inline opus_val16 tansig_approx(opus_val32 _x) /* Q19 */ } #else /*extern const float tansig_table[501];*/ -static inline float tansig_approx(float x) +static OPUS_INLINE float tansig_approx(float x) { int i; float y, dy; diff --git a/src/opus_decoder.c b/src/opus_decoder.c index ca95ed40..ff21767f 100644 --- a/src/opus_decoder.c +++ b/src/opus_decoder.c @@ -75,7 +75,7 @@ struct OpusDecoder { }; #ifdef FIXED_POINT -static inline opus_int16 SAT16(opus_int32 x) { +static OPUS_INLINE opus_int16 SAT16(opus_int32 x) { return x > 32767 ? 32767 : x < -32768 ? -32768 : (opus_int16)x; } #endif diff --git a/src/opus_private.h b/src/opus_private.h index 042b641e..df526c22 100644 --- a/src/opus_private.h +++ b/src/opus_private.h @@ -107,7 +107,7 @@ int opus_decode_native(OpusDecoder *st, const unsigned char *data, opus_int32 le opus_int32 *packet_offset, int soft_clip); /* Make sure everything's aligned to sizeof(void *) bytes */ -static inline int align(int i) +static OPUS_INLINE int align(int i) { return (i+(int)sizeof(void *)-1)&-(int)sizeof(void *); } |