From f4c685f838f631557aadd41965fbcc30a98d3013 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Wed, 12 Dec 2007 14:17:27 +0100 Subject: [PATCH] Finally got rid of all floats in compiler.y. --- compiler.y | 14 +++++++------- midiin.c | 2 +- test.sh | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler.y b/compiler.y index 193c68c..29d4029 100644 --- a/compiler.y +++ b/compiler.y @@ -169,9 +169,9 @@ static void forward(double step) } -static float volume(void) +static sample_t volume(void) { - float f; + sample_t f; if (volume_from == volume_to) f = volume_from; @@ -179,7 +179,7 @@ static float volume(void) unsigned long r = ah_rnd(&volume_seed) % 1000; f = volume_from + (volume_to - volume_from) * - (((float)r) / 1000.0); + (((sample_t) r) / 1000.0); } return f; @@ -604,7 +604,7 @@ static void add_ss_portamento_event(double portamento) } -static void add_ss_channel_event(int channel, float vol) +static void add_ss_channel_event(int channel, sample_t vol) { struct song_ev *e = add_song_ev(SONG_EV_SS_CHANNEL); @@ -637,8 +637,8 @@ static void add_ss_pat_event(char * pat_file) } -static void add_ss_eff_event(int type, int channel, double size, float gain, - double depth, double freq, double phase, float initial, float final) +static void add_ss_eff_event(int type, int channel, double size, sample_t gain, + double depth, double freq, double phase, sample_t initial, sample_t final) { struct song_ev *e = add_song_ev(type); @@ -653,7 +653,7 @@ static void add_ss_eff_event(int type, int channel, double size, float gain, } -static void add_ss_pitch_stretch(int note, double len, float vol) +static void add_ss_pitch_stretch(int note, double len, sample_t vol) { struct song_ev *e = add_song_ev(SONG_EV_SS_PITCH_STRETCH); diff --git a/midiin.c b/midiin.c index f51773d..ae1a54c 100644 --- a/midiin.c +++ b/midiin.c @@ -102,7 +102,7 @@ void process_MIDI(void) ss_ins_note_off(&ss_song_ins[0], midimsg[1]); else if (midimsg[0] == MIDI_NOTE_ON) { ss_ins_note_on(&ss_song_ins[0], midimsg[1], - ((float) midimsg[2]) / 127.0, midimsg[1]); + ((sample_t) midimsg[2]) / 127.0, midimsg[1]); print_note(midimsg[1]); } diff --git a/test.sh b/test.sh index ed7a810..b5d3ada 100755 --- a/test.sh +++ b/test.sh @@ -13,13 +13,13 @@ while read script sum ; do done <