summaryrefslogtreecommitdiffstats
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
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
-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
-rw-r--r--firmware/drivers/ata_mmc.c2
-rw-r--r--firmware/target/arm/as3525/ata_sd_as3525.c2
-rw-r--r--uisimulator/common/fmradio.c2
8 files changed, 10 insertions, 12 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;
}
diff --git a/firmware/drivers/ata_mmc.c b/firmware/drivers/ata_mmc.c
index 01b8a6f029..16d06584c5 100644
--- a/firmware/drivers/ata_mmc.c
+++ b/firmware/drivers/ata_mmc.c
@@ -816,7 +816,7 @@ void mmc_enable_monitoring(bool on)
bool mmc_detect(void)
{
- return adc_read(ADC_MMC_SWITCH) < 0x200 ? true : false;
+ return (adc_read(ADC_MMC_SWITCH) < 0x200);
}
bool mmc_touched(void)
diff --git a/firmware/target/arm/as3525/ata_sd_as3525.c b/firmware/target/arm/as3525/ata_sd_as3525.c
index 8d0dc042b9..99bf668ec4 100644
--- a/firmware/target/arm/as3525/ata_sd_as3525.c
+++ b/firmware/target/arm/as3525/ata_sd_as3525.c
@@ -359,7 +359,7 @@ static int sd_init_card(const int drive)
sd_parse_csd(&card_info[drive]);
#if defined(HAVE_MULTIDRIVE)
- hs_card = (card_info[drive].speed == 50000000) ? true : false;
+ hs_card = (card_info[drive].speed == 50000000);
#endif
/* Boost MCICLK to operating speed */
diff --git a/uisimulator/common/fmradio.c b/uisimulator/common/fmradio.c
index 3fd61b6f4a..64bd7f1f91 100644
--- a/uisimulator/common/fmradio.c
+++ b/uisimulator/common/fmradio.c
@@ -53,7 +53,7 @@ int tuner_set(int setting, int value)
break;
case RADIO_FORCE_MONO:
- mono = value?true:false;
+ mono = (value != 0);
break;
default: