forked from len0rd/rockbox
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
This commit is contained in:
parent
5dfde5c80b
commit
95cf600b6c
4 changed files with 35 additions and 27 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue