Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions spandsp-sim/g1050.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,32 +900,32 @@ g1050_model_t g1050_standard_models[9] =
};

#if defined(HAVE_DRAND48)
static __inline__ void q1050_rand_init(void)
static inline void q1050_rand_init(void)
{
srand48(time(NULL));
}
/*- End of function --------------------------------------------------------*/

static __inline__ double q1050_rand(void)
static inline double q1050_rand(void)
{
return drand48();
}
/*- End of function --------------------------------------------------------*/
#else
static __inline__ void q1050_rand_init(void)
static inline void q1050_rand_init(void)
{
srand(time(NULL));
}
/*- End of function --------------------------------------------------------*/

static __inline__ double q1050_rand(void)
static inline double q1050_rand(void)
{
return (double) rand()/(double) RAND_MAX;
}
/*- End of function --------------------------------------------------------*/
#endif

static __inline__ double scale_probability(double prob, double scale)
static inline double scale_probability(double prob, double scale)
{
/* Re-calculate probability based on a different time interval */
return 1.0 - pow(1.0 - prob, scale);
Expand Down
2 changes: 1 addition & 1 deletion spandsp-sim/test_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ SPAN_DECLARE(complexf_t) complexify(complexify_state_t *s, int16_t amp)
}
/*- End of function --------------------------------------------------------*/

static __inline__ complex_t expj(double theta)
static inline complex_t expj(double theta)
{
return complex_set(cos(theta), sin(theta));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ $(VCPROJ12): msvc/vc12proj.head msvc/vc12proj.foot Makefile.am

$(srcdir)/msvc/spandsp.h: spandsp.h.in
echo "creating $(srcdir)/msvc/spandsp.h"
@sed -e "s/#define _SPANDSP_H_/#define _SPANDSP_H_\n\n#define __inline__ __inline\n#pragma warning(disable:4200)/" \
@sed -e "s/#define _SPANDSP_H_/#define _SPANDSP_H_\n\n#pragma warning(disable:4200)/" \
-e "s/\@SPANDSP_USE_FIXED_POINT\@/#undef SPANDSP_USE_FIXED_POINT/" \
-e "s/\@SPANDSP_MISALIGNED_ACCESS_FAILS\@/#undef SPANDSP_MISALIGNED_ACCESS_FAILS/" \
-e "s/\@SPANDSP_USE_EXPORT_CAPABILITY\@/#define SPANDSP_USE_EXPORT_CAPABILITY 1/" \
Expand Down
2 changes: 1 addition & 1 deletion src/dds_float.c
Original file line number Diff line number Diff line change
Expand Up @@ -2130,7 +2130,7 @@ SPAN_DECLARE(float) dds_scaling_dbovf(float level)
}
/*- End of function --------------------------------------------------------*/

static __inline__ float dds_lookupx(uint32_t phase)
static inline float dds_lookupx(uint32_t phase)
{
return sine_table[phase >> (32 - SLENK)];
}
Expand Down
4 changes: 2 additions & 2 deletions src/echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static int narrowband_detect(echo_can_state_t *ec)
return score;
}

static __inline__ void lms_adapt(echo_can_state_t *ec, int factor)
static inline void lms_adapt(echo_can_state_t *ec, int factor)
{
int i;

Expand Down Expand Up @@ -379,7 +379,7 @@ SPAN_DECLARE(void) echo_can_snapshot(echo_can_state_t *ec)
}
/*- End of function --------------------------------------------------------*/

static __inline__ int16_t echo_can_hpf(int32_t coeff[2], int16_t amp)
static inline int16_t echo_can_hpf(int32_t coeff[2], int16_t amp)
{
int32_t z;

Expand Down
4 changes: 2 additions & 2 deletions src/filter_tools.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@

static complex_t circle[MAX_FFT_LEN/2];

static __inline__ complex_t expj(double theta)
static inline complex_t expj(double theta)
{
return complex_set(cos(theta), sin(theta));
}
/*- End of function --------------------------------------------------------*/

static __inline__ double fix(double x)
static inline double fix(double x)
{
/* Nearest integer */
return (x >= 0.0) ? floor(0.5 + x) : -floor(0.5 - x);
Expand Down
26 changes: 13 additions & 13 deletions src/floating_fudge.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,94 +35,94 @@ extern "C"
#endif

#if !defined(HAVE_SINF)
static __inline__ float sinf(float x)
static inline float sinf(float x)
{
return (float) sin((double) x);
}
#endif

#if !defined(HAVE_COSF)
static __inline__ float cosf(float x)
static inline float cosf(float x)
{
return (float) cos((double) x);
}
#endif

#if !defined(HAVE_TANF)
static __inline__ float tanf(float x)
static inline float tanf(float x)
{
return (float) tan((double) x);
}
#endif

#if !defined(HAVE_ASINF)
static __inline__ float asinf(float x)
static inline float asinf(float x)
{
return (float) asin((double) x);
}
#endif

#if !defined(HAVE_ACOSF)
static __inline__ float acosf(float x)
static inline float acosf(float x)
{
return (float) acos((double) x);
}
#endif

#if !defined(HAVE_ATANF)
static __inline__ float atanf(float x)
static inline float atanf(float x)
{
return (float) atan((double) x);
}

#endif

#if !defined(HAVE_ATAN2F)
static __inline__ float atan2f(float y, float x)
static inline float atan2f(float y, float x)
{
return (float) atan2((double) y, (double) x);
}

#endif

#if !defined(HAVE_CEILF)
static __inline__ float ceilf(float x)
static inline float ceilf(float x)
{
return (float) ceil((double) x);
}
#endif

#if !defined(HAVE_FLOORF)
static __inline__ float floorf(float x)
static inline float floorf(float x)
{
return (float) floor((double) x);
}

#endif

#if !defined(HAVE_POWF)
static __inline__ float powf(float x, float y)
static inline float powf(float x, float y)
{
return (float) pow((double) x, (double) y);
}
#endif

#if !defined(HAVE_EXPF)
static __inline__ float expf(float x)
static inline float expf(float x)
{
return (float) expf((double) x);
}
#endif

#if !defined(HAVE_LOGF)
static __inline__ float logf(float x)
static inline float logf(float x)
{
return (float) logf((double) x);
}
#endif

#if !defined(HAVE_LOG10F)
static __inline__ float log10f(float x)
static inline float log10f(float x)
{
return (float) log10((double) x);
}
Expand Down
4 changes: 2 additions & 2 deletions src/g726.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static int16_t fmult(int16_t an, int16_t srn)
/*
* Compute the estimated signal from the 6-zero predictor.
*/
static __inline__ int16_t predictor_zero(g726_state_t *s)
static inline int16_t predictor_zero(g726_state_t *s)
{
int i;
int sezi;
Expand All @@ -259,7 +259,7 @@ static __inline__ int16_t predictor_zero(g726_state_t *s)
/*
* Computes the estimated signal from the 2-pole predictor.
*/
static __inline__ int16_t predictor_pole(g726_state_t *s)
static inline int16_t predictor_pole(g726_state_t *s)
{
return (fmult(s->a[1] >> 2, s->sr[1]) + fmult(s->a[0] >> 2, s->sr[0]));
}
Expand Down
18 changes: 9 additions & 9 deletions src/gsm0610_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

#include "spandsp/private/gsm0610.h"

static __inline__ int16_t gsm_add(int16_t a, int16_t b)
static inline int16_t gsm_add(int16_t a, int16_t b)
{
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
__asm__ __volatile__(
Expand All @@ -58,7 +58,7 @@ static __inline__ int16_t gsm_add(int16_t a, int16_t b)
}
/*- End of function --------------------------------------------------------*/

static __inline__ int32_t gsm_l_add(int32_t a, int32_t b)
static inline int32_t gsm_l_add(int32_t a, int32_t b)
{
#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
__asm__ __volatile__(
Expand Down Expand Up @@ -93,7 +93,7 @@ static __inline__ int32_t gsm_l_add(int32_t a, int32_t b)
}
/*- End of function --------------------------------------------------------*/

static __inline__ int16_t gsm_sub(int16_t a, int16_t b)
static inline int16_t gsm_sub(int16_t a, int16_t b)
{
int32_t diff;

Expand All @@ -102,7 +102,7 @@ static __inline__ int16_t gsm_sub(int16_t a, int16_t b)
}
/*- End of function --------------------------------------------------------*/

static __inline__ int16_t gsm_mult(int16_t a, int16_t b)
static inline int16_t gsm_mult(int16_t a, int16_t b)
{
if (a == INT16_MIN && b == INT16_MIN)
return INT16_MAX;
Expand All @@ -111,14 +111,14 @@ static __inline__ int16_t gsm_mult(int16_t a, int16_t b)
}
/*- End of function --------------------------------------------------------*/

static __inline__ int32_t gsm_l_mult(int16_t a, int16_t b)
static inline int32_t gsm_l_mult(int16_t a, int16_t b)
{
assert (a != INT16_MIN || b != INT16_MIN);
return ((int32_t) a * (int32_t) b) << 1;
}
/*- End of function --------------------------------------------------------*/

static __inline__ int16_t gsm_mult_r(int16_t a, int16_t b)
static inline int16_t gsm_mult_r(int16_t a, int16_t b)
{
int32_t prod;

Expand All @@ -131,13 +131,13 @@ static __inline__ int16_t gsm_mult_r(int16_t a, int16_t b)
}
/*- End of function --------------------------------------------------------*/

static __inline__ int16_t gsm_abs(int16_t a)
static inline int16_t gsm_abs(int16_t a)
{
return (a == INT16_MIN) ? INT16_MAX : (int16_t) abs(a);
}
/*- End of function --------------------------------------------------------*/

static __inline__ int16_t gsm_asr(int16_t a, int n)
static inline int16_t gsm_asr(int16_t a, int n)
{
if (n >= 16)
return (int16_t) (-(a < 0));
Expand All @@ -152,7 +152,7 @@ static __inline__ int16_t gsm_asr(int16_t a, int n)
}
/*- End of function --------------------------------------------------------*/

static __inline__ int16_t gsm_asl(int16_t a, int n)
static inline int16_t gsm_asl(int16_t a, int n)
{
if (n >= 16)
return 0;
Expand Down
6 changes: 3 additions & 3 deletions src/hdlc.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void rx_special_condition(hdlc_rx_state_t *s, int status)
}
/*- End of function --------------------------------------------------------*/

static __inline__ void octet_set_and_count(hdlc_rx_state_t *s)
static inline void octet_set_and_count(hdlc_rx_state_t *s)
{
if (s->octet_count_report_interval == 0)
return;
Expand All @@ -111,7 +111,7 @@ static __inline__ void octet_set_and_count(hdlc_rx_state_t *s)
}
/*- End of function --------------------------------------------------------*/

static __inline__ void octet_count(hdlc_rx_state_t *s)
static inline void octet_count(hdlc_rx_state_t *s)
{
if (s->octet_count_report_interval == 0)
return;
Expand Down Expand Up @@ -245,7 +245,7 @@ static void rx_flag_or_abort(hdlc_rx_state_t *s)
}
/*- End of function --------------------------------------------------------*/

static __inline__ void hdlc_rx_put_bit_core(hdlc_rx_state_t *s)
static inline void hdlc_rx_put_bit_core(hdlc_rx_state_t *s)
{
if ((s->raw_bit_stream & 0x3E00) == 0x3E00)
{
Expand Down
2 changes: 1 addition & 1 deletion src/image_translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ static int image_resize_row(image_translate_state_t *s, uint8_t buf[])
}
/*- End of function --------------------------------------------------------*/

static __inline__ uint8_t find_closest_palette_color(int in)
static inline uint8_t find_closest_palette_color(int in)
{
return (in >= 128) ? 255 : 0;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lpc10_analyse.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

#include "lpc10_encdecs.h"

static __inline__ float energyf(float amp[], int len)
static inline float energyf(float amp[], int len)
{
int i;
float rms;
Expand Down
4 changes: 2 additions & 2 deletions src/lpc10_encdecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void lpc10_voicing(lpc10_encode_state_t *st,

void lpc10_analyse(lpc10_encode_state_t *st, float *speech, int32_t *voice, int32_t *pitch, float *rms, float rc[]);

static __inline__ int32_t pow_ii(int32_t x, int32_t n)
static inline int32_t pow_ii(int32_t x, int32_t n)
{
int32_t pow;
uint32_t u;
Expand All @@ -94,7 +94,7 @@ static __inline__ int32_t pow_ii(int32_t x, int32_t n)
}
/*- End of function --------------------------------------------------------*/

static __inline__ float r_sign(float a, float b)
static inline float r_sign(float a, float b)
{
float x;

Expand Down
4 changes: 0 additions & 4 deletions src/make_modem_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
#include <getopt.h>
#endif

#if defined (_MSC_VER)
#define __inline__ __inline
#endif

#include "spandsp/telephony.h"
#include "spandsp/complex.h"
#include "filter_tools.h"
Expand Down
2 changes: 0 additions & 2 deletions src/msvc/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif
#define inline __inline
#define __inline__ __inline

#define _MMX_H_

Expand Down
1 change: 0 additions & 1 deletion src/msvc/spandsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#if !defined(_SPANDSP_H_)
#define _SPANDSP_H_

#define __inline__ __inline
#pragma warning(disable:4200)

#undef SPANDSP_USE_FIXED_POINT
Expand Down
Loading
Loading