Commit 7830cf1b authored by Gregory Maxwell's avatar Gregory Maxwell
Browse files

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.
parent 2891d852
...@@ -12,9 +12,7 @@ CFLAGS := -DUSE_ALLOCA $(CFLAGS) ...@@ -12,9 +12,7 @@ CFLAGS := -DUSE_ALLOCA $(CFLAGS)
# These options affect performance # These options affect performance
# HAVE_LRINTF: Use C99 intrinsics to speed up float-to-int conversion # HAVE_LRINTF: Use C99 intrinsics to speed up float-to-int conversion
# inline: Don't use the 'inline' keyword (for ANSI C compilers)
#CFLAGS := -DHAVE_LRINTF $(CFLAGS) #CFLAGS := -DHAVE_LRINTF $(CFLAGS)
#CFLAGS := -Dinline= $(CFLAGS)
###################### END OF OPTIONS ###################### ###################### END OF OPTIONS ######################
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#define ARCH_H #define ARCH_H
#include "opus_types.h" #include "opus_types.h"
#include "opus_defines.h"
# if !defined(__GNUC_PREREQ) # if !defined(__GNUC_PREREQ)
# if defined(__GNUC__)&&defined(__GNUC_MINOR__) # if defined(__GNUC__)&&defined(__GNUC_MINOR__)
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
#ifdef __GNUC__ #ifdef __GNUC__
__attribute__((noreturn)) __attribute__((noreturn))
#endif #endif
static inline void _celt_fatal(const char *str, const char *file, int line) static OPUS_INLINE void _celt_fatal(const char *str, const char *file, int line)
{ {
fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str); fprintf (stderr, "Fatal (internal) error in %s, line %d: %s\n", file, line, str);
abort(); abort();
......
...@@ -49,10 +49,10 @@ ...@@ -49,10 +49,10 @@
# define WIN32_EXTRA_LEAN # define WIN32_EXTRA_LEAN
# include <windows.h> # include <windows.h>
static inline opus_uint32 opus_cpu_capabilities(void){ static OPUS_INLINE opus_uint32 opus_cpu_capabilities(void){
opus_uint32 flags; opus_uint32 flags;
flags=0; flags=0;
/* MSVC has no inline __asm support for ARM, but it does let you __emit /* MSVC has no OPUS_INLINE __asm support for ARM, but it does let you __emit
* instructions via their assembled hex code. * instructions via their assembled hex code.
* All of these instructions should be essentially nops. */ * All of these instructions should be essentially nops. */
# if defined(ARMv5E_ASM) # if defined(ARMv5E_ASM)
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */ /** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q16 #undef MULT16_32_Q16
static inline opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b) static OPUS_INLINE opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
{ {
unsigned rd_lo; unsigned rd_lo;
int rd_hi; int rd_hi;
...@@ -46,7 +46,7 @@ static inline opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b) ...@@ -46,7 +46,7 @@ static inline opus_val32 MULT16_32_Q16_armv4(opus_val16 a, opus_val32 b)
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */ /** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q15 #undef MULT16_32_Q15
static inline opus_val32 MULT16_32_Q15_armv4(opus_val16 a, opus_val32 b) static OPUS_INLINE opus_val32 MULT16_32_Q15_armv4(opus_val16 a, opus_val32 b)
{ {
unsigned rd_lo; unsigned rd_lo;
int rd_hi; int rd_hi;
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
/** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */ /** 16x32 multiplication, followed by a 16-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q16 #undef MULT16_32_Q16
static inline opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b) static OPUS_INLINE opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b)
{ {
int res; int res;
__asm__( __asm__(
...@@ -50,7 +50,7 @@ static inline opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b) ...@@ -50,7 +50,7 @@ static inline opus_val32 MULT16_32_Q16_armv5e(opus_val16 a, opus_val32 b)
/** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */ /** 16x32 multiplication, followed by a 15-bit shift right. Results fits in 32 bits */
#undef MULT16_32_Q15 #undef MULT16_32_Q15
static inline opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b) static OPUS_INLINE opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b)
{ {
int res; int res;
__asm__( __asm__(
...@@ -68,7 +68,7 @@ static inline opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b) ...@@ -68,7 +68,7 @@ static inline opus_val32 MULT16_32_Q15_armv5e(opus_val16 a, opus_val32 b)
b must fit in 31 bits. b must fit in 31 bits.
Result fits in 32 bits. */ Result fits in 32 bits. */
#undef MAC16_32_Q15 #undef MAC16_32_Q15
static inline opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a, static OPUS_INLINE opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a,
opus_val32 b) opus_val32 b)
{ {
int res; int res;
...@@ -84,7 +84,7 @@ static inline opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a, ...@@ -84,7 +84,7 @@ static inline opus_val32 MAC16_32_Q15_armv5e(opus_val32 c, opus_val16 a,
/** 16x16 multiply-add where the result fits in 32 bits */ /** 16x16 multiply-add where the result fits in 32 bits */
#undef MAC16_16 #undef MAC16_16
static inline opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a, static OPUS_INLINE opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
opus_val16 b) opus_val16 b)
{ {
int res; int res;
...@@ -100,7 +100,7 @@ static inline opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a, ...@@ -100,7 +100,7 @@ static inline opus_val32 MAC16_16_armv5e(opus_val32 c, opus_val16 a,
/** 16x16 multiplication where the result fits in 32 bits */ /** 16x16 multiplication where the result fits in 32 bits */
#undef MULT16_16 #undef MULT16_16
static inline opus_val32 MULT16_16_armv5e(opus_val16 a, opus_val16 b) static OPUS_INLINE opus_val32 MULT16_16_armv5e(opus_val16 a, opus_val16 b)
{ {
int res; int res;
__asm__( __asm__(
......
...@@ -138,7 +138,7 @@ int celt_decode_with_ec(OpusCustomDecoder * OPUS_RESTRICT st, const unsigned cha ...@@ -138,7 +138,7 @@ int celt_decode_with_ec(OpusCustomDecoder * OPUS_RESTRICT st, const unsigned cha
#ifdef CUSTOM_MODES #ifdef CUSTOM_MODES
#define OPUS_CUSTOM_NOSTATIC #define OPUS_CUSTOM_NOSTATIC
#else #else
#define OPUS_CUSTOM_NOSTATIC static inline #define OPUS_CUSTOM_NOSTATIC static OPUS_INLINE
#endif #endif
static const unsigned char trim_icdf[11] = {126, 124, 119, 109, 87, 41, 19, 9, 4, 2, 0}; static const unsigned char trim_icdf[11] = {126, 124, 119, 109, 87, 41, 19, 9, 4, 2, 0};
...@@ -163,7 +163,7 @@ static const unsigned char fromOpusTable[16] = { ...@@ -163,7 +163,7 @@ static const unsigned char fromOpusTable[16] = {
0x00, 0x08, 0x10, 0x18 0x00, 0x08, 0x10, 0x18
}; };
static inline int toOpus(unsigned char c) static OPUS_INLINE int toOpus(unsigned char c)
{ {
int ret=0; int ret=0;
if (c<0xA0) if (c<0xA0)
...@@ -174,7 +174,7 @@ static inline int toOpus(unsigned char c) ...@@ -174,7 +174,7 @@ static inline int toOpus(unsigned char c)
return ret|(c&0x7); return ret|(c&0x7);
} }
static inline int fromOpus(unsigned char c) static OPUS_INLINE int fromOpus(unsigned char c)
{ {
if (c<0x80) if (c<0x80)
return -1; return -1;
......
...@@ -175,7 +175,7 @@ void opus_custom_decoder_destroy(CELTDecoder *st) ...@@ -175,7 +175,7 @@ void opus_custom_decoder_destroy(CELTDecoder *st)
} }
#endif /* CUSTOM_MODES */ #endif /* CUSTOM_MODES */
static inline opus_val16 SIG2WORD16(celt_sig x) static OPUS_INLINE opus_val16 SIG2WORD16(celt_sig x)
{ {
#ifdef FIXED_POINT #ifdef FIXED_POINT
x = PSHR32(x, SIG_SHIFT); x = PSHR32(x, SIG_SHIFT);
......
...@@ -28,6 +28,9 @@ ...@@ -28,6 +28,9 @@
#ifndef CPU_SUPPORT_H #ifndef CPU_SUPPORT_H
#define CPU_SUPPORT_H #define CPU_SUPPORT_H
#include "opus_types.h"
#include "opus_defines.h"
#if defined(OPUS_HAVE_RTCD) && defined(ARMv4_ASM) #if defined(OPUS_HAVE_RTCD) && defined(ARMv4_ASM)
#include "arm/armcpu.h" #include "arm/armcpu.h"
...@@ -42,7 +45,7 @@ ...@@ -42,7 +45,7 @@
#else #else
#define OPUS_ARCHMASK 0 #define OPUS_ARCHMASK 0
static inline int opus_select_arch(void) static OPUS_INLINE int opus_select_arch(void)
{ {
return 0; return 0;
} }
......
...@@ -534,7 +534,7 @@ void decode_pulses(int *_y,int _n,int _k,ec_dec *_dec){ ...@@ -534,7 +534,7 @@ void decode_pulses(int *_y,int _n,int _k,ec_dec *_dec){
/*Computes the next row/column of any recurrence that obeys the relation /*Computes the next row/column of any recurrence that obeys the relation
u[i][j]=u[i-1][j]+u[i][j-1]+u[i-1][j-1]. u[i][j]=u[i-1][j]+u[i][j-1]+u[i-1][j-1].
_ui0 is the base case for the new row/column.*/ _ui0 is the base case for the new row/column.*/
static inline void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){ static OPUS_INLINE void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){
opus_uint32 ui1; opus_uint32 ui1;
unsigned j; unsigned j;
/*This do-while will overrun the array if we don't have storage for at least /*This do-while will overrun the array if we don't have storage for at least
...@@ -550,7 +550,7 @@ static inline void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){ ...@@ -550,7 +550,7 @@ static inline void unext(opus_uint32 *_ui,unsigned _len,opus_uint32 _ui0){
/*Computes the previous row/column of any recurrence that obeys the relation /*Computes the previous row/column of any recurrence that obeys the relation
u[i-1][j]=u[i][j]-u[i][j-1]-u[i-1][j-1]. u[i-1][j]=u[i][j]-u[i][j-1]-u[i-1][j-1].
_ui0 is the base case for the new row/column.*/ _ui0 is the base case for the new row/column.*/
static inline void uprev(opus_uint32 *_ui,unsigned _n,opus_uint32 _ui0){ static OPUS_INLINE void uprev(opus_uint32 *_ui,unsigned _n,opus_uint32 _ui0){
opus_uint32 ui1; opus_uint32 ui1;
unsigned j; unsigned j;
/*This do-while will overrun the array if we don't have storage for at least /*This do-while will overrun the array if we don't have storage for at least
...@@ -617,7 +617,7 @@ static void cwrsi(int _n,int _k,opus_uint32 _i,int *_y,opus_uint32 *_u){ ...@@ -617,7 +617,7 @@ static void cwrsi(int _n,int _k,opus_uint32 _i,int *_y,opus_uint32 *_u){
of size 1 with associated sign bits. of size 1 with associated sign bits.
_y: The vector of pulses, whose sum of absolute values is K. _y: The vector of pulses, whose sum of absolute values is K.
_k: Returns K.*/ _k: Returns K.*/
static inline opus_uint32 icwrs1(const int *_y,int *_k){ static OPUS_INLINE opus_uint32 icwrs1(const int *_y,int *_k){
*_k=abs(_y[0]); *_k=abs(_y[0]);
return _y[0]<0; return _y[0]<0;
} }
...@@ -626,7 +626,7 @@ static inline opus_uint32 icwrs1(const int *_y,int *_k){ ...@@ -626,7 +626,7 @@ static inline opus_uint32 icwrs1(const int *_y,int *_k){
of size _n with associated sign bits. of size _n with associated sign bits.
_y: The vector of pulses, whose sum of absolute values must be _k. _y: The vector of pulses, whose sum of absolute values must be _k.
_nc: Returns V(_n,_k).*/ _nc: Returns V(_n,_k).*/
static inline opus_uint32 icwrs(int _n,int _k,opus_uint32 *_nc,const int *_y, static OPUS_INLINE opus_uint32 icwrs(int _n,int _k,opus_uint32 *_nc,const int *_y,
opus_uint32 *_u){ opus_uint32 *_u){
opus_uint32 i; opus_uint32 i;
int j; int j;
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#if !defined(_ecintrin_H) #if !defined(_ecintrin_H)
# define _ecintrin_H (1) # define _ecintrin_H (1)
/*Some specific platforms may have optimized intrinsic or inline assembly /*Some specific platforms may have optimized intrinsic or OPUS_INLINE assembly
versions of these functions which can substantially improve performance. versions of these functions which can substantially improve performance.
We define macros for them to allow easy incorporation of these non-ANSI We define macros for them to allow easy incorporation of these non-ANSI
features.*/ features.*/
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
*/ */
#include "opus_types.h" #include "opus_types.h"
#include "opus_defines.h"
#if !defined(_entcode_H) #if !defined(_entcode_H)
# define _entcode_H (1) # define _entcode_H (1)
...@@ -83,15 +84,15 @@ struct ec_ctx{ ...@@ -83,15 +84,15 @@ struct ec_ctx{
int error; int error;
}; };
static inline opus_uint32 ec_range_bytes(ec_ctx *_this){ static OPUS_INLINE opus_uint32 ec_range_bytes(ec_ctx *_this){
return _this->offs; return _this->offs;
} }
static inline unsigned char *ec_get_buffer(ec_ctx *_this){ static OPUS_INLINE unsigned char *ec_get_buffer(ec_ctx *_this){
return _this->buf; return _this->buf;
} }
static inline int ec_get_error(ec_ctx *_this){ static OPUS_INLINE int ec_get_error(ec_ctx *_this){
return _this->error; return _this->error;
} }
...@@ -101,7 +102,7 @@ static inline int ec_get_error(ec_ctx *_this){ ...@@ -101,7 +102,7 @@ static inline int ec_get_error(ec_ctx *_this){
Return: The number of bits. Return: The number of bits.
This will always be slightly larger than the exact value (e.g., all This will always be slightly larger than the exact value (e.g., all
rounding error is in the positive direction).*/ rounding error is in the positive direction).*/
static inline int ec_tell(ec_ctx *_this){ static OPUS_INLINE int ec_tell(ec_ctx *_this){
return _this->nbits_total-EC_ILOG(_this->rng); return _this->nbits_total-EC_ILOG(_this->rng);
} }
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
#include "dsplib.h" #include "dsplib.h"
#undef IMUL32 #undef IMUL32
static inline long IMUL32(long i, long j) static OPUS_INLINE long IMUL32(long i, long j)
{ {
long ac0, ac1; long ac0, ac1;
ac0 = _lmpy(i>>16,j); ac0 = _lmpy(i>>16,j);
......
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
#define FIXED_DEBUG_H #define FIXED_DEBUG_H
#include <stdio.h> #include <stdio.h>
#include "opus_defines.h"
#ifdef CELT_C #ifdef CELT_C
#include "opus_defines.h"
OPUS_EXPORT opus_int64 celt_mips=0; OPUS_EXPORT opus_int64 celt_mips=0;
#else #else
extern opus_int64 celt_mips; extern opus_int64 celt_mips;
...@@ -59,7 +59,7 @@ extern opus_int64 celt_mips; ...@@ -59,7 +59,7 @@ extern opus_int64 celt_mips;
#define SHR(a,b) SHR32(a,b) #define SHR(a,b) SHR32(a,b)
#define PSHR(a,b) PSHR32(a,b) #define PSHR(a,b) PSHR32(a,b)
static inline short NEG16(int x) static OPUS_INLINE short NEG16(int x)
{ {
int res; int res;
if (!VERIFY_SHORT(x)) if (!VERIFY_SHORT(x))
...@@ -80,7 +80,7 @@ static inline short NEG16(int x) ...@@ -80,7 +80,7 @@ static inline short NEG16(int x)
celt_mips++; celt_mips++;
return res; return res;
} }
static inline int NEG32(opus_int64 x) static OPUS_INLINE int NEG32(opus_int64 x)
{ {
opus_int64 res; opus_int64 res;
if (!VERIFY_INT(x)) if (!VERIFY_INT(x))
...@@ -103,7 +103,7 @@ static inline int NEG32(opus_int64 x) ...@@ -103,7 +103,7 @@ static inline int NEG32(opus_int64 x)
} }
#define EXTRACT16(x) EXTRACT16_(x, __FILE__, __LINE__) #define EXTRACT16(x) EXTRACT16_(x, __FILE__, __LINE__)
static inline short EXTRACT16_(int x, char *file, int line) static OPUS_INLINE short EXTRACT16_(int x, char *file, int line)
{ {
int res; int res;
if (!VERIFY_SHORT(x)) if (!VERIFY_SHORT(x))
...@@ -119,7 +119,7 @@ static inline short EXTRACT16_(int x, char *file, int line) ...@@ -119,7 +119,7 @@ static inline short EXTRACT16_(int x, char *file, int line)
} }
#define EXTEND32(x) EXTEND32_(x, __FILE__, __LINE__) #define EXTEND32(x) EXTEND32_(x, __FILE__, __LINE__)
static inline int EXTEND32_(int x, char *file, int line) static OPUS_INLINE int EXTEND32_(int x, char *file, int line)
{ {
int res; int res;
if (!VERIFY_SHORT(x)) if (!VERIFY_SHORT(x))
...@@ -135,7 +135,7 @@ static inline int EXTEND32_(int x, char *file, int line) ...@@ -135,7 +135,7 @@ static inline int EXTEND32_(int x, char *file, int line)
} }
#define SHR16(a, shift) SHR16_(a, shift, __FILE__, __LINE__) #define SHR16(a, shift) SHR16_(a, shift, __FILE__, __LINE__)
static inline short SHR16_(int a, int shift, char *file, int line) static OPUS_INLINE short SHR16_(int a, int shift, char *file, int line)
{ {
int res; int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift)) if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift))
...@@ -157,7 +157,7 @@ static inline short SHR16_(int a, int shift, char *file, int line) ...@@ -157,7 +157,7 @@ static inline short SHR16_(int a, int shift, char *file, int line)
return res; return res;
} }
#define SHL16(a, shift) SHL16_(a, shift, __FILE__, __LINE__) #define SHL16(a, shift) SHL16_(a, shift, __FILE__, __LINE__)
static inline short SHL16_(int a, int shift, char *file, int line) static OPUS_INLINE short SHL16_(int a, int shift, char *file, int line)
{ {
int res; int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift)) if (!VERIFY_SHORT(a) || !VERIFY_SHORT(shift))
...@@ -179,7 +179,7 @@ static inline short SHL16_(int a, int shift, char *file, int line) ...@@ -179,7 +179,7 @@ static inline short SHL16_(int a, int shift, char *file, int line)
return res; return res;
} }
static inline int SHR32(opus_int64 a, int shift) static OPUS_INLINE int SHR32(opus_int64 a, int shift)
{ {
opus_int64 res; opus_int64 res;
if (!VERIFY_INT(a) || !VERIFY_SHORT(shift)) if (!VERIFY_INT(a) || !VERIFY_SHORT(shift))
...@@ -201,7 +201,7 @@ static inline int SHR32(opus_int64 a, int shift) ...@@ -201,7 +201,7 @@ static inline int SHR32(opus_int64 a, int shift)
return res; return res;
} }
#define SHL32(a, shift) SHL32_(a, shift, __FILE__, __LINE__) #define SHL32(a, shift) SHL32_(a, shift, __FILE__, __LINE__)
static inline int SHL32_(opus_int64 a, int shift, char *file, int line) static OPUS_INLINE int SHL32_(opus_int64 a, int shift, char *file, int line)
{ {
opus_int64 res; opus_int64 res;
if (!VERIFY_INT(a) || !VERIFY_SHORT(shift)) if (!VERIFY_INT(a) || !VERIFY_SHORT(shift))
...@@ -234,7 +234,7 @@ static inline int SHL32_(opus_int64 a, int shift, char *file, int line) ...@@ -234,7 +234,7 @@ static inline int SHL32_(opus_int64 a, int shift, char *file, int line)
//#define SHL(a,shift) ((a) << (shift)) //#define SHL(a,shift) ((a) << (shift))
#define ADD16(a, b) ADD16_(a, b, __FILE__, __LINE__) #define ADD16(a, b) ADD16_(a, b, __FILE__, __LINE__)
static inline short ADD16_(int a, int b, char *file, int line) static OPUS_INLINE short ADD16_(int a, int b, char *file, int line)
{ {
int res; int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
...@@ -257,7 +257,7 @@ static inline short ADD16_(int a, int b, char *file, int line) ...@@ -257,7 +257,7 @@ static inline short ADD16_(int a, int b, char *file, int line)
} }
#define SUB16(a, b) SUB16_(a, b, __FILE__, __LINE__) #define SUB16(a, b) SUB16_(a, b, __FILE__, __LINE__)
static inline short SUB16_(int a, int b, char *file, int line) static OPUS_INLINE short SUB16_(int a, int b, char *file, int line)
{ {
int res; int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
...@@ -280,7 +280,7 @@ static inline short SUB16_(int a, int b, char *file, int line) ...@@ -280,7 +280,7 @@ static inline short SUB16_(int a, int b, char *file, int line)
} }
#define ADD32(a, b) ADD32_(a, b, __FILE__, __LINE__) #define ADD32(a, b) ADD32_(a, b, __FILE__, __LINE__)
static inline int ADD32_(opus_int64 a, opus_int64 b, char *file, int line) static OPUS_INLINE int ADD32_(opus_int64 a, opus_int64 b, char *file, int line)
{ {
opus_int64 res; opus_int64 res;
if (!VERIFY_INT(a) || !VERIFY_INT(b)) if (!VERIFY_INT(a) || !VERIFY_INT(b))
...@@ -303,7 +303,7 @@ static inline int ADD32_(opus_int64 a, opus_int64 b, char *file, int line) ...@@ -303,7 +303,7 @@ static inline int ADD32_(opus_int64 a, opus_int64 b, char *file, int line)
} }
#define SUB32(a, b) SUB32_(a, b, __FILE__, __LINE__) #define SUB32(a, b) SUB32_(a, b, __FILE__, __LINE__)
static inline int SUB32_(opus_int64 a, opus_int64 b, char *file, int line) static OPUS_INLINE int SUB32_(opus_int64 a, opus_int64 b, char *file, int line)
{ {
opus_int64 res; opus_int64 res;
if (!VERIFY_INT(a) || !VERIFY_INT(b)) if (!VERIFY_INT(a) || !VERIFY_INT(b))
...@@ -327,7 +327,7 @@ static inline int SUB32_(opus_int64 a, opus_int64 b, char *file, int line) ...@@ -327,7 +327,7 @@ static inline int SUB32_(opus_int64 a, opus_int64 b, char *file, int line)
#undef UADD32 #undef UADD32
#define UADD32(a, b) UADD32_(a, b, __FILE__, __LINE__) #define UADD32(a, b) UADD32_(a, b, __FILE__, __LINE__)
static inline unsigned int UADD32_(opus_uint64 a, opus_uint64 b, char *file, int line) static OPUS_INLINE unsigned int UADD32_(opus_uint64 a, opus_uint64 b, char *file, int line)
{ {
opus_uint64 res; opus_uint64 res;
if (!VERIFY_UINT(a) || !VERIFY_UINT(b)) if (!VERIFY_UINT(a) || !VERIFY_UINT(b))
...@@ -351,7 +351,7 @@ static inline unsigned int UADD32_(opus_uint64 a, opus_uint64 b, char *file, int ...@@ -351,7 +351,7 @@ static inline unsigned int UADD32_(opus_uint64 a, opus_uint64 b, char *file, int
#undef USUB32 #undef USUB32
#define USUB32(a, b) USUB32_(a, b, __FILE__, __LINE__) #define USUB32(a, b) USUB32_(a, b, __FILE__, __LINE__)
static inline unsigned int USUB32_(opus_uint64 a, opus_uint64 b, char *file, int line) static OPUS_INLINE unsigned int USUB32_(opus_uint64 a, opus_uint64 b, char *file, int line)
{ {
opus_uint64 res; opus_uint64 res;
if (!VERIFY_UINT(a) || !VERIFY_UINT(b)) if (!VERIFY_UINT(a) || !VERIFY_UINT(b))
...@@ -381,7 +381,7 @@ static inline unsigned int USUB32_(opus_uint64 a, opus_uint64 b, char *file, int ...@@ -381,7 +381,7 @@ static inline unsigned int USUB32_(opus_uint64 a, opus_uint64 b, char *file, int
} }
/* result fits in 16 bits */ /* result fits in 16 bits */
static inline short MULT16_16_16(int a, int b) static OPUS_INLINE short MULT16_16_16(int a, int b)
{ {
int res; int res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
...@@ -404,7 +404,7 @@ static inline short MULT16_16_16(int a, int b) ...@@ -404,7 +404,7 @@ static inline short MULT16_16_16(int a, int b)
} }
#define MULT16_16(a, b) MULT16_16_(a, b, __FILE__, __LINE__) #define MULT16_16(a, b) MULT16_16_(a, b, __FILE__, __LINE__)
static inline int MULT16_16_(int a, int b, char *file, int line) static OPUS_INLINE int MULT16_16_(int a, int b, char *file, int line)
{ {
opus_int64 res; opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b)) if (!VERIFY_SHORT(a) || !VERIFY_SHORT(b))
...@@ -429,7 +429,7 @@ static inline int MULT16_16_(int a, int b, char *file, int line) ...@@ -429,7 +429,7 @@ static inline int MULT16_16_(int a, int b, char *file, int line)
#define MAC16_16(c,a,b) (celt_mips-=2,ADD32((c),MULT16_16((a),(b)))) #define MAC16_16(c,a,b) (celt_mips-=2,ADD32((c),MULT16_16((a),(b))))
#define MULT16_32_QX(a, b, Q) MULT16_32_QX_(a, b, Q, __FILE__, __LINE__) #define MULT16_32_QX(a, b, Q) MULT16_32_QX_(a, b, Q, __FILE__, __LINE__)
static inline int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int line) static OPUS_INLINE int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int line)
{ {
opus_int64 res; opus_int64 res;
if (!VERIFY_SHORT(a) || !VERIFY_INT(b)) if (!VERIFY_SHORT(a) || !VERIFY_INT(b))
...@@ -462,7 +462,7 @@ static inline int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int line ...@@ -462,7 +462,7 @@ static inline int MULT16_32_QX_(int a, opus_int64 b, int Q, char *file, int line
} }
#define MULT16_32_PX(a, b, Q) MULT16_32_PX_(a, b, Q, __FILE__, __LINE__) #define MULT16_32_PX(a, b, Q) MULT16_32_PX_(a, b, Q, __FILE__, __LINE__)
static inline int MULT16_32_PX_(int a, opus_int64 b, int Q, char *file, int line)