From 8219f2801a9484aed0c35143ab9b2d2c8b6dee15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Fri, 5 Oct 2007 11:15:04 +0000 Subject: Make synthVoice return int instead of short, gives a nice speed up also add a comment git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14988 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/midi/synth.c | 4 ++-- apps/plugins/midi/synth.h | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'apps/plugins/midi') diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c index 322d0f792d..327f32e288 100644 --- a/apps/plugins/midi/synth.c +++ b/apps/plugins/midi/synth.c @@ -255,8 +255,8 @@ inline void stopVoice(struct SynthObject * so) so->decay = 0; } -signed short int synthVoice(struct SynthObject * so) ICODE_ATTR; -signed short int synthVoice(struct SynthObject * so) +int synthVoice(struct SynthObject * so) ICODE_ATTR; +int synthVoice(struct SynthObject * so) { struct GWaveform * wf; register int s; diff --git a/apps/plugins/midi/synth.h b/apps/plugins/midi/synth.h index 2b7187e819..dd52c40a7d 100644 --- a/apps/plugins/midi/synth.h +++ b/apps/plugins/midi/synth.h @@ -17,7 +17,7 @@ * ****************************************************************************/ int initSynth(struct MIDIfile * mf, char * filename, char * drumConfig); -signed short int synthVoice(struct SynthObject * so); +int synthVoice(struct SynthObject * so); void setPoint(struct SynthObject * so, int pt); static inline void synthSample(int * mixL, int * mixR) @@ -48,6 +48,8 @@ static inline void synthSample(int * mixL, int * mixR) voicept++; } + /* if max voices is an even number gcc is smart enough to not + include this loop */ for(i=MAX_VOICES%2; i > 0; i--) { if(voicept->isUsed==1) -- cgit v1.2.3