summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2010-01-01 22:47:25 +0000
committerBertrik Sikken <bertrik@sikken.nl>2010-01-01 22:47:25 +0000
commit5c4ef78cc983212a0c2e0868929aa2b699855087 (patch)
tree6bf9a1e14b5aaf4961561673ee4ef364b3790562 /apps
parente35a15cf54a104ff58ee889112d5040654f85ccc (diff)
downloadrockbox-5c4ef78cc983212a0c2e0868929aa2b699855087.tar.gz
rockbox-5c4ef78cc983212a0c2e0868929aa2b699855087.tar.bz2
rockbox-5c4ef78cc983212a0c2e0868929aa2b699855087.zip
Simplify some expressions using the ? operator
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24136 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/codecs/mod.c8
-rw-r--r--apps/gui/viewport.c2
-rw-r--r--apps/onplay.c2
-rw-r--r--apps/plugins/blackjack.c2
-rw-r--r--apps/plugins/clix.c2
5 files changed, 7 insertions, 9 deletions
diff --git a/apps/codecs/mod.c b/apps/codecs/mod.c
index cbeaf0837f..3e2e4284de 100644
--- a/apps/codecs/mod.c
+++ b/apps/codecs/mod.c
@@ -250,7 +250,7 @@ void mixer_playsample(int channel, int instrument)
p_channel->channelactive = true;
p_channel->samplepos = p_instrument->sampledataoffset;
p_channel->samplefractpos = 0;
- p_channel->loopsample = (p_instrument->repeatlength > 2) ? true : false;
+ p_channel->loopsample = (p_instrument->repeatlength > 2);
if (p_channel->loopsample) {
p_channel->loopstart = p_instrument->repeatoffset +
p_instrument->sampledataoffset;
@@ -807,8 +807,7 @@ void playline(int pattern, int line)
{
/* Set Filter */
case 0x0:
- modplayer.amigafilterenabled =
- (effecty>0) ? false : true;
+ modplayer.amigafilterenabled = (effecty == 0);
break;
/* Fineslide up */
case 0x1:
@@ -834,8 +833,7 @@ void playline(int pattern, int line)
break;
/* Set glissando on/off */
case 0x3:
- modplayer.glissandoenabled =
- (effecty > 0) ? true:false;
+ modplayer.glissandoenabled = (effecty > 0);
break;
/* Set Vibrato waveform */
case 0x4:
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c
index 6e0d269228..22eccc161f 100644
--- a/apps/gui/viewport.c
+++ b/apps/gui/viewport.c
@@ -285,7 +285,7 @@ static unsigned viewport_init_ui_vp(void)
ret = viewport_parse_viewport(&custom_vp[screen], screen,
setting, ',');
- custom_vp_loaded_ok[screen] = ret?true:false;
+ custom_vp_loaded_ok[screen] = (ret != NULL);
}
return true; /* meh fixme */
}
diff --git a/apps/onplay.c b/apps/onplay.c
index cfda5f4105..c7b0f7ac7d 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -571,7 +571,7 @@ static bool delete_handler(bool is_dir)
if (!res)
onplay_result = ONPLAY_RELOAD_DIR;
- return ((res == 0) ? true:false);
+ return (res == 0);
}
diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c
index 1e574dc2bd..9096673bba 100644
--- a/apps/plugins/blackjack.c
+++ b/apps/plugins/blackjack.c
@@ -608,7 +608,7 @@ static struct card new_card(void) {
new_card.suit = rb->rand()%4; /* Random number 0-3 */
new_card.num = rb->rand()%13; /* Random number 0-12 */
new_card.value = find_value(new_card.num);
- new_card.is_soft_ace = new_card.num == 0 ? true : false;
+ new_card.is_soft_ace = (new_card.num == 0);
return new_card;
}
diff --git a/apps/plugins/clix.c b/apps/plugins/clix.c
index e5f65ce36c..6fa6931300 100644
--- a/apps/plugins/clix.c
+++ b/apps/plugins/clix.c
@@ -693,7 +693,7 @@ static int clix_handle_game(struct clix_game_state_t* state)
while(true)
{
if (TIME_AFTER(*rb->current_tick, blink_tick)) {
- state->blink = state->blink ? false : true;
+ state->blink = !state->blink;
blink_tick = *rb->current_tick + BLINK_TICKCOUNT;
}