From 799a0a5cd4001954d8e0e855af4236e1f7b0898d Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Sat, 2 Jan 2010 16:03:30 +0000 Subject: [PATCH] Simplify some boolean expressions that compare directly against 'true' git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24144 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/blackjack.c | 2 +- apps/plugins/random_folder_advance_config.c | 2 +- apps/plugins/starfield.c | 2 +- apps/plugins/stats.c | 4 ++-- firmware/drivers/serial.c | 2 +- firmware/drivers/tuner/ipod_remote_tuner.c | 4 ++-- firmware/usbstack/usb_storage.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/plugins/blackjack.c b/apps/plugins/blackjack.c index 9096673bba..a7876c6e12 100644 --- a/apps/plugins/blackjack.c +++ b/apps/plugins/blackjack.c @@ -701,7 +701,7 @@ static void update_total(struct game_context* bj) { static signed int check_for_aces(struct card temp_cards[], unsigned int size) { unsigned int i; for(i = 0; i < size; i++) { - if (temp_cards[i].is_soft_ace == true) + if (temp_cards[i].is_soft_ace) return i; } return -1; diff --git a/apps/plugins/random_folder_advance_config.c b/apps/plugins/random_folder_advance_config.c index 36b9ebfcbf..5f837980d3 100644 --- a/apps/plugins/random_folder_advance_config.c +++ b/apps/plugins/random_folder_advance_config.c @@ -70,7 +70,7 @@ void traversedir(char* location, char* name) if (dir) { entry = rb->readdir(dir); while (entry) { - if (abort == true) + if (abort) break; /* Skip .. and . */ if (entry->d_name[0] == '.') diff --git a/apps/plugins/starfield.c b/apps/plugins/starfield.c index 0da3305a6f..01d0acfb4a 100644 --- a/apps/plugins/starfield.c +++ b/apps/plugins/starfield.c @@ -389,7 +389,7 @@ int plugin_main(void) ((CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F))) /* This will make the stars pulse to the music */ - if(pulse==true){ + if(pulse){ /* Get the peaks. ( Borrowed from vu_meter ) */ #if (CONFIG_CODEC == SWCODEC) diff --git a/apps/plugins/stats.c b/apps/plugins/stats.c index d3cf9dc5a7..b928c0c4db 100644 --- a/apps/plugins/stats.c +++ b/apps/plugins/stats.c @@ -164,7 +164,7 @@ void traversedir(char* location, char* name) if (dir) { entry = rb->readdir(dir); while (entry) { - if (abort == true) + if (abort) break; /* Skip .. and . */ if (rb->strcmp(entry->d_name, ".") && rb->strcmp(entry->d_name, "..")) @@ -227,7 +227,7 @@ enum plugin_status plugin_start(const void* parameter) lasttick = *rb->current_tick; traversedir("", ""); - if (abort == true) { + if (abort) { rb->splash(HZ, "Aborted"); return PLUGIN_OK; } diff --git a/firmware/drivers/serial.c b/firmware/drivers/serial.c index 30e5f33900..eb2df9890b 100644 --- a/firmware/drivers/serial.c +++ b/firmware/drivers/serial.c @@ -416,7 +416,7 @@ void SERIAL0(void) } } bool pkt = iap_getc(temp); - if(newpkt == true && pkt == false) + if(newpkt && !pkt) autobaud = 0; /* Found good baud */ newpkt = pkt; } diff --git a/firmware/drivers/tuner/ipod_remote_tuner.c b/firmware/drivers/tuner/ipod_remote_tuner.c index 07a5eeb9a6..82357593d4 100644 --- a/firmware/drivers/tuner/ipod_remote_tuner.c +++ b/firmware/drivers/tuner/ipod_remote_tuner.c @@ -300,7 +300,7 @@ int ipod_rmt_tuner_set(int setting, int value) case RADIO_FREQUENCY: { rmt_tuner_set_freq(value); - if (reply_timeout() == true) + if (reply_timeout()) return 0; break; } @@ -326,7 +326,7 @@ int ipod_rmt_tuner_set(int setting, int value) else rmt_tuner_scan(1); - if (reply_timeout() == true) + if (reply_timeout()) return 0; radio_tuned = 0; } diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c index 3f3baa383c..f84cd4eefe 100644 --- a/firmware/usbstack/usb_storage.c +++ b/firmware/usbstack/usb_storage.c @@ -356,7 +356,7 @@ void usb_storage_try_release_storage(void) bool canrelease=true; int i; for(i=0;i