summaryrefslogtreecommitdiff
path: root/apps/plugins/midi/synth.c
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2008-11-22 16:56:20 +0000
committerNils Wallménius <nils@rockbox.org>2008-11-22 16:56:20 +0000
commit95cf600b6cbc4529a181ab8f60b552138d998a03 (patch)
tree0e9e8a543f9ce498a9b59b22051b3de860bf8db8 /apps/plugins/midi/synth.c
parent5dfde5c80b7450aa6c1b25257f90ae62d471065f (diff)
Macros should be ALL CAPS, so rename (un)likely() to (UN)LIKELY()
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19181 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/midi/synth.c')
-rw-r--r--apps/plugins/midi/synth.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c
index 7e283d4ef1..969d9b939a 100644
--- a/apps/plugins/midi/synth.c
+++ b/apps/plugins/midi/synth.c
@@ -293,10 +293,10 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
const unsigned int start_loop = wf->startLoop << FRACTSIZE;
const int diff_loop = end_loop-start_loop;
- while(likely(samples-- > 0))
+ while(LIKELY(samples-- > 0))
{
/* Is voice being ramped? */
- if(unlikely(so->state == STATE_RAMPDOWN))
+ if(UNLIKELY(so->state == STATE_RAMPDOWN))
{
if(so->decay != 0) /* Ramp has been started */
{
@@ -318,12 +318,12 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
s2 = getSample((cp_temp >> FRACTSIZE)+1, wf);
- if(likely(mode_mask28))
+ if(LIKELY(mode_mask28))
{
/* LOOP_REVERSE|LOOP_PINGPONG = 24 */
- if(unlikely(mode_mask24 && so->loopState == STATE_LOOPING && (cp_temp < start_loop)))
+ if(UNLIKELY(mode_mask24 && so->loopState == STATE_LOOPING && (cp_temp < start_loop)))
{
- if(unlikely(mode_mask_looprev))
+ if(UNLIKELY(mode_mask_looprev))
{
cp_temp += diff_loop;
s2=getSample((cp_temp >> FRACTSIZE), wf);
@@ -334,10 +334,10 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
}
}
- if(unlikely(cp_temp >= end_loop))
+ if(UNLIKELY(cp_temp >= end_loop))
{
so->loopState = STATE_LOOPING;
- if(unlikely(!mode_mask24))
+ if(UNLIKELY(!mode_mask24))
{
cp_temp -= diff_loop;
s2=getSample((cp_temp >> FRACTSIZE), wf);
@@ -350,7 +350,7 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
}
/* Have we overrun? */
- if(unlikely(cp_temp >= num_samples))
+ if(UNLIKELY(cp_temp >= num_samples))
{
cp_temp -= so->delta;
s2 = getSample((cp_temp >> FRACTSIZE)+1, wf);
@@ -362,21 +362,21 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
s1 +=((signed)((s2 - s1) * (cp_temp & ((1<<FRACTSIZE)-1)))>>FRACTSIZE);
- if(unlikely(so->curRate == 0))
+ if(UNLIKELY(so->curRate == 0))
{
stopVoice(so);
// so->isUsed = false;
}
- if(likely(so->ch != 9 && so->state != STATE_RAMPDOWN)) /* Stupid ADSR code... and don't do ADSR for drums */
+ if(LIKELY(so->ch != 9 && so->state != STATE_RAMPDOWN)) /* Stupid ADSR code... and don't do ADSR for drums */
{
- if(unlikely(so->curOffset < so->targetOffset))
+ if(UNLIKELY(so->curOffset < so->targetOffset))
{
so->curOffset += (so->curRate);
- if(unlikely(so -> curOffset > so->targetOffset && so->curPoint != 2))
+ if(UNLIKELY(so -> curOffset > so->targetOffset && so->curPoint != 2))
{
- if(unlikely(so->curPoint != 5))
+ if(UNLIKELY(so->curPoint != 5))
{
setPoint(so, so->curPoint+1);
}
@@ -388,9 +388,9 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
} else
{
so->curOffset -= (so->curRate);
- if(unlikely(so -> curOffset < so->targetOffset && so->curPoint != 2))
+ if(UNLIKELY(so -> curOffset < so->targetOffset && so->curPoint != 2))
{
- if(unlikely(so->curPoint != 5))
+ if(UNLIKELY(so->curPoint != 5))
{
setPoint(so, so->curPoint+1);
}
@@ -403,7 +403,7 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
}
}
- if(unlikely(so->curOffset < 0))
+ if(UNLIKELY(so->curOffset < 0))
{
so->curOffset = so->targetOffset;
stopVoice(so);
@@ -416,7 +416,7 @@ static inline void synthVoice(struct SynthObject * so, int32_t * out, unsigned i
s1 = s1 * volscale >> 14;
/* need to set ramp beginning */
- if(unlikely(so->state == STATE_RAMPDOWN && so->decay == 0))
+ if(UNLIKELY(so->state == STATE_RAMPDOWN && so->decay == 0))
{
so->decay = s1;
if(so->decay == 0)
@@ -442,7 +442,7 @@ int32_t samp_buf[512] IBSS_ATTR;
void synthSamples(int32_t *buf_ptr, unsigned int num_samples) ICODE_ATTR;
void synthSamples(int32_t *buf_ptr, unsigned int num_samples)
{
- if (unlikely(num_samples > 512))
+ if (UNLIKELY(num_samples > 512))
DEBUGF("num_samples is too big!\n");
else
{