summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-12-22 20:15:03 +0100
committerThomas Martitz <kugel@rockbox.org>2013-12-22 20:15:03 +0100
commita62bd9282e8cebe4e34c1930da04670695f8974b (patch)
treec00deab2f76e7e7bac958eefc08f5cef43ee88cb
parentef92ed4a6a997524944f42aa7abffddca7bef05e (diff)
downloadrockbox-a62bd9282e8cebe4e34c1930da04670695f8974b.tar.gz
rockbox-a62bd9282e8cebe4e34c1930da04670695f8974b.zip
Fix warning and re-order code a bit.
Change-Id: I1d733b3d0bd17cc541218f9a2b7712712ad314dd
-rw-r--r--apps/recorder/bmp.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c
index 75d82b449f..58393bfc11 100644
--- a/apps/recorder/bmp.c
+++ b/apps/recorder/bmp.c
@@ -718,11 +718,11 @@ int read_bmp_fd(int fd,
718 718
719 case 32: 719 case 32:
720 if (compression == 3) { /* BI_BITFIELDS */ 720 if (compression == 3) { /* BI_BITFIELDS */
721 bool found; 721 bool found = false;
722 int i, j; 722 int i, j;
723 723
724 /* (i == 0) is 15bit, (i == 1) is 16bit, (i == 2) is 32bit */ 724 /* (i == 0) is 15bit, (i == 1) is 16bit, (i == 2) is 32bit */
725 for (i = 0; i < ARRAY_SIZE(bitfields); i++) { 725 for (i = 0; i < ARRAY_SIZE(bitfields) && !found; i++) {
726 /* for 15bpp and higher numcolors has the number of color masks */ 726 /* for 15bpp and higher numcolors has the number of color masks */
727 for (j = 0; j < numcolors; j++) { 727 for (j = 0; j < numcolors; j++) {
728 if (!rgbcmp(&palette[j], &bitfields[i][j])) { 728 if (!rgbcmp(&palette[j], &bitfields[i][j])) {
@@ -732,16 +732,13 @@ int read_bmp_fd(int fd,
732 break; 732 break;
733 } 733 }
734 } 734 }
735 if (found) {
736 if (i == 0) /* 15bit */
737 depth = 15;
738 else if (i == 3) /* 32bit, ABGR bitmap */
739 order = ABGR;
740 break;
741 }
742 } 735 }
743 if (found) 736 if (found) {
744 break; 737 if (i == 0) /* 15bit */
738 depth = 15;
739 else if (i == 3) /* 32bit, ABGR bitmap */
740 order = ABGR;
741 }
745 } /* else fall through */ 742 } /* else fall through */
746 743
747 default: 744 default: