summaryrefslogtreecommitdiffstats
path: root/apps/screen_access.h
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-11-09 22:47:15 +0000
committerJens Arnold <amiconn@rockbox.org>2005-11-09 22:47:15 +0000
commitedf5a70e276b5440ebb60713cf5db936eae09498 (patch)
tree335de901da47468f59c6f2b47954e2b83b6df9e7 /apps/screen_access.h
parentc83216ad891339c140358ee342e883d14b3d7158 (diff)
downloadrockbox-edf5a70e276b5440ebb60713cf5db936eae09498.tar.gz
rockbox-edf5a70e276b5440ebb60713cf5db936eae09498.tar.bz2
rockbox-edf5a70e276b5440ebb60713cf5db936eae09498.zip
Replaced the common for(i = 0; i < NB_SCREENS; i++) loop with a macro that just expands to i = 0; instead of the for() loop if NB_SCREENS == 1. Reduces binary size on platforms with only one screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7805 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/screen_access.h')
-rw-r--r--apps/screen_access.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/screen_access.h b/apps/screen_access.h
index 5b30cb0aa7..c167708fbf 100644
--- a/apps/screen_access.h
+++ b/apps/screen_access.h
@@ -36,6 +36,12 @@ enum screen_type {
#define NB_SCREENS 1
#endif
+#if NB_SCREENS == 1
+#define FOR_NB_SCREENS(i) i = 0;
+#else
+#define FOR_NB_SCREENS(i) for(i = 0; i < NB_SCREENS; i++)
+#endif
+
#ifdef HAVE_LCD_CHARCELLS
#define MAX_LINES_ON_SCREEN 2
#endif