From 55c682b1b0a18bb5cb2ff192fcd1b9ed0d0faad5 Mon Sep 17 00:00:00 2001 From: carlo-bramini Date: Sun, 15 Oct 2017 17:27:30 +0200 Subject: [PATCH] Use FLUID_INLINE in all remaining parts of the sources --- src/rvoice/fluid_adsr_env.h | 12 ++++++------ src/rvoice/fluid_iir_filter.c | 2 +- src/rvoice/fluid_lfo.h | 6 +++--- src/rvoice/fluid_rvoice.c | 4 ++-- src/synth/fluid_synth.c | 4 ++-- src/synth/fluid_voice.c | 6 +++--- src/unused/fluid_dsp_float.c | 2 +- src/unused/fluid_rvoice_handler.c | 8 ++++---- src/unused/fluid_rvoice_handler.h | 2 +- src/utils/fluid_hash.c | 4 ++-- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/rvoice/fluid_adsr_env.h b/src/rvoice/fluid_adsr_env.h index 23e503b0..dd11e969 100644 --- a/src/rvoice/fluid_adsr_env.h +++ b/src/rvoice/fluid_adsr_env.h @@ -111,7 +111,7 @@ fluid_adsr_env_set_data(fluid_adsr_env_t* env, fluid_real_t min, fluid_real_t max); -static inline void +static FLUID_INLINE void fluid_adsr_env_reset(fluid_adsr_env_t* env) { env->count = 0; @@ -119,25 +119,25 @@ fluid_adsr_env_reset(fluid_adsr_env_t* env) env->val = 0.0f; } -static inline fluid_real_t +static FLUID_INLINE fluid_real_t fluid_adsr_env_get_val(fluid_adsr_env_t* env) { return env->val; } -static inline void +static FLUID_INLINE void fluid_adsr_env_set_val(fluid_adsr_env_t* env, fluid_real_t val) { env->val = val; } -static inline fluid_adsr_env_section_t +static FLUID_INLINE fluid_adsr_env_section_t fluid_adsr_env_get_section(fluid_adsr_env_t* env) { return env->section; } -static inline void +static FLUID_INLINE void fluid_adsr_env_set_section(fluid_adsr_env_t* env, fluid_adsr_env_section_t section) { @@ -148,7 +148,7 @@ fluid_adsr_env_set_section(fluid_adsr_env_t* env, /* Used for determining which voice to kill. Returns max amplitude from now, and forward in time. */ -static inline fluid_real_t +static FLUID_INLINE fluid_real_t fluid_adsr_env_get_max_val(fluid_adsr_env_t* env) { if (env->section > FLUID_VOICE_ENVATTACK){ diff --git a/src/rvoice/fluid_iir_filter.c b/src/rvoice/fluid_iir_filter.c index 8a3703c6..6e3f72c4 100644 --- a/src/rvoice/fluid_iir_filter.c +++ b/src/rvoice/fluid_iir_filter.c @@ -174,7 +174,7 @@ fluid_iir_filter_set_q_dB(fluid_iir_filter_t* iir_filter, } -static inline void +static FLUID_INLINE void fluid_iir_filter_calculate_coefficients(fluid_iir_filter_t* iir_filter, int transition_samples, fluid_real_t output_rate) diff --git a/src/rvoice/fluid_lfo.h b/src/rvoice/fluid_lfo.h index 2d5d32bb..25f2306c 100644 --- a/src/rvoice/fluid_lfo.h +++ b/src/rvoice/fluid_lfo.h @@ -31,7 +31,7 @@ struct _fluid_lfo_t { fluid_real_t increment; /* the lfo frequency is converted to a per-buffer increment */ }; -static inline void +static FLUID_INLINE void fluid_lfo_reset(fluid_lfo_t* lfo) { lfo->val = 0.0f; @@ -41,13 +41,13 @@ fluid_lfo_reset(fluid_lfo_t* lfo) void fluid_lfo_set_incr(fluid_lfo_t* lfo, fluid_real_t increment); void fluid_lfo_set_delay(fluid_lfo_t* lfo, unsigned int delay); -static inline fluid_real_t +static FLUID_INLINE fluid_real_t fluid_lfo_get_val(fluid_lfo_t* lfo) { return lfo->val; } -static inline void +static FLUID_INLINE void fluid_lfo_calc(fluid_lfo_t* lfo, unsigned int cur_delay) { if (cur_delay < lfo->delay) diff --git a/src/rvoice/fluid_rvoice.c b/src/rvoice/fluid_rvoice.c index a862f50b..44bdd05b 100644 --- a/src/rvoice/fluid_rvoice.c +++ b/src/rvoice/fluid_rvoice.c @@ -25,7 +25,7 @@ /** * @return -1 if voice has finished, 0 if it's currently quiet, 1 otherwise */ -static inline int +static FLUID_INLINE int fluid_rvoice_calc_amp(fluid_rvoice_t* voice) { fluid_real_t target_amp; /* target amplitude */ @@ -371,7 +371,7 @@ fluid_rvoice_write (fluid_rvoice_t* voice, fluid_real_t *dsp_buf) } -static inline fluid_real_t* +static FLUID_INLINE fluid_real_t* get_dest_buf(fluid_rvoice_buffers_t* buffers, int index, fluid_real_t** dest_bufs, int dest_bufcount) { diff --git a/src/synth/fluid_synth.c b/src/synth/fluid_synth.c index 22f85937..2cf97cd2 100644 --- a/src/synth/fluid_synth.c +++ b/src/synth/fluid_synth.c @@ -80,7 +80,7 @@ static int fluid_synth_update_polyphony(fluid_synth_t* synth, char* name, int value); static int fluid_synth_update_polyphony_LOCAL(fluid_synth_t* synth, int new_polyphony); static void init_dither(void); -static inline int roundi (float x); +static FLUID_INLINE int roundi (float x); static int fluid_synth_render_blocks(fluid_synth_t* synth, int blockcount); static fluid_voice_t* fluid_synth_free_voice_by_kill_LOCAL(fluid_synth_t* synth); @@ -2898,7 +2898,7 @@ init_dither(void) } /* A portable replacement for roundf(), seems it may actually be faster too! */ -static inline int +static FLUID_INLINE int roundi (float x) { if (x >= 0.0f) diff --git a/src/synth/fluid_voice.c b/src/synth/fluid_voice.c index 774e13f2..764eea1d 100644 --- a/src/synth/fluid_voice.c +++ b/src/synth/fluid_voice.c @@ -104,7 +104,7 @@ fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t* voice); #define UPDATE_RVOICE_ENVLFO_R1(proc, envp, rarg) UPDATE_RVOICE_GENERIC_R1(proc, &voice->rvoice->envlfo.envp, rarg) #define UPDATE_RVOICE_ENVLFO_I1(proc, envp, iarg) UPDATE_RVOICE_GENERIC_I1(proc, &voice->rvoice->envlfo.envp, iarg) -static inline void +static FLUID_INLINE void fluid_voice_update_volenv(fluid_voice_t* voice, fluid_adsr_env_section_t section, unsigned int count, @@ -120,7 +120,7 @@ fluid_voice_update_volenv(fluid_voice_t* voice, coeff, increment, min, max); } -static inline void +static FLUID_INLINE void fluid_voice_update_modenv(fluid_voice_t* voice, fluid_adsr_env_section_t section, unsigned int count, @@ -134,7 +134,7 @@ fluid_voice_update_modenv(fluid_voice_t* voice, coeff, increment, min, max); } -static inline void fluid_sample_null_ptr(fluid_sample_t** sample) +static FLUID_INLINE void fluid_sample_null_ptr(fluid_sample_t** sample) { if (*sample != NULL) { fluid_sample_decr_ref(*sample); diff --git a/src/unused/fluid_dsp_float.c b/src/unused/fluid_dsp_float.c index c319f9a5..0fd24d4d 100644 --- a/src/unused/fluid_dsp_float.c +++ b/src/unused/fluid_dsp_float.c @@ -123,7 +123,7 @@ void fluid_dsp_float_config (void) } -static inline int +static FLUID_INLINE int fluid_voice_is_looping(fluid_voice_t *voice) { return _SAMPLEMODE (voice) == FLUID_LOOP_DURING_RELEASE diff --git a/src/unused/fluid_rvoice_handler.c b/src/unused/fluid_rvoice_handler.c index 2bc4ccdb..c3c952bf 100644 --- a/src/unused/fluid_rvoice_handler.c +++ b/src/unused/fluid_rvoice_handler.c @@ -112,7 +112,7 @@ fluid_rvoice_handler_remove_voice(fluid_rvoice_handler_t* handler, int index) * @return Number of samples written */ #if 0 -static inline int +static FLUID_INLINE int fluid_rvoice_handler_write_one(fluid_rvoice_handler_t* handler, int index, fluid_real_t* buf, int blockcount) { @@ -137,7 +137,7 @@ fluid_rvoice_handler_write_one(fluid_rvoice_handler_t* handler, int index, * voice has been finished, removed and possibly replaced with another voice. * @return Number of samples written */ -static inline int +static FLUID_INLINE int fluid_rvoice_handler_mix_one(fluid_rvoice_handler_t* handler, int index, fluid_real_t** bufs, unsigned int blockcount, unsigned int bufcount) { @@ -166,7 +166,7 @@ fluid_rvoice_handler_mix_one(fluid_rvoice_handler_t* handler, int index, return result; } -static inline void +static FLUID_INLINE void fluid_resetbufs(int blockcount, int bufcount, fluid_real_t** bufs) { int i; @@ -177,7 +177,7 @@ fluid_resetbufs(int blockcount, int bufcount, fluid_real_t** bufs) /** * Single-threaded scenario, no worker threads */ -static inline void +static FLUID_INLINE void fluid_rvoice_handler_render_loop_simple(fluid_rvoice_handler_t* handler, int blockcount, int bufcount, fluid_real_t** bufs) { diff --git a/src/unused/fluid_rvoice_handler.h b/src/unused/fluid_rvoice_handler.h index 0b4c61ce..beda1c72 100644 --- a/src/unused/fluid_rvoice_handler.h +++ b/src/unused/fluid_rvoice_handler.h @@ -66,7 +66,7 @@ fluid_rvoice_handler_get_finished_voices(fluid_rvoice_handler_t* handler, return handler->finished_voices; } -static inline void +static FLUID_INLINE void fluid_rvoice_handler_clear_finished_voices(fluid_rvoice_handler_t* handler) { handler->finished_voice_count = 0; diff --git a/src/utils/fluid_hash.c b/src/utils/fluid_hash.c index de29a77a..af6fb704 100644 --- a/src/utils/fluid_hash.c +++ b/src/utils/fluid_hash.c @@ -136,7 +136,7 @@ spaced_primes_closest (unsigned int num) * save insertions from having to compute the hash record again for * the new record. */ -static inline fluid_hashnode_t ** +static FLUID_INLINE fluid_hashnode_t ** fluid_hashtable_lookup_node (fluid_hashtable_t *hashtable, const void *key, unsigned int *hash_return) { @@ -316,7 +316,7 @@ fluid_hashtable_resize (fluid_hashtable_t *hashtable) * Essentially, calls fluid_hashtable_resize() if the table has strayed * too far from its ideal size for its number of nodes. */ -static inline void +static FLUID_INLINE void fluid_hashtable_maybe_resize (fluid_hashtable_t *hashtable) { int nnodes = hashtable->nnodes;