fix cast operator precedence

This commit is contained in:
derselbst 2017-10-21 18:05:54 +02:00
parent 53e8e27049
commit 79cef163a1

View file

@ -89,7 +89,7 @@ fluid_ladspa_fx_t *new_fluid_ladspa_fx(fluid_real_t sample_rate, int audio_group
fx->state = FLUID_LADSPA_INACTIVE; fx->state = FLUID_LADSPA_INACTIVE;
/* add 0.5 to minimize overall casting error */ /* add 0.5 to minimize overall casting error */
fx->sample_rate = (unsigned long)sample_rate + 0.5; fx->sample_rate = (unsigned long)(sample_rate + 0.5);
fx->audio_groups = audio_groups; fx->audio_groups = audio_groups;
fx->effects_channels = effects_channels; fx->effects_channels = effects_channels;
@ -176,7 +176,7 @@ int fluid_ladspa_set_sample_rate(fluid_ladspa_fx_t *fx, fluid_real_t sample_rate
LADSPA_API_ENTER(fx); LADSPA_API_ENTER(fx);
/* Add 0.5 to minimize rounding errors */ /* Add 0.5 to minimize rounding errors */
new_sample_rate = (unsigned long)sample_rate + 0.5; new_sample_rate = (unsigned long)(sample_rate + 0.5);
if (fx->sample_rate == new_sample_rate) if (fx->sample_rate == new_sample_rate)
{ {