diff options
| author | Nils Wallménius <nils@rockbox.org> | 2007-10-24 10:29:45 +0000 |
|---|---|---|
| committer | Nils Wallménius <nils@rockbox.org> | 2007-10-24 10:29:45 +0000 |
| commit | 537b27d58f382277e239bbefaab3bb48a8df245e (patch) | |
| tree | 67efb7edfc1bf09fb3cbe6376f15ee6729d384ae | |
| parent | 56ddddc274cf3fbefba2f7f634ca4bcb48778883 (diff) | |
| download | rockbox-537b27d58f382277e239bbefaab3bb48a8df245e.zip rockbox-537b27d58f382277e239bbefaab3bb48a8df245e.tar.gz rockbox-537b27d58f382277e239bbefaab3bb48a8df245e.tar.bz2 rockbox-537b27d58f382277e239bbefaab3bb48a8df245e.tar.xz | |
Save a few bytes by changing unit selection strategy
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15283 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/screens.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/screens.c b/apps/screens.c index 8cdacd7..dc54a00 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -819,8 +819,8 @@ const int monthname[] = { /* little helper function for voice output */ static void say_time(int cursorpos, const struct tm *tm) { - static const int unit[] = { UNIT_HOUR, UNIT_MIN, UNIT_SEC, 0, 0, 0 }; int value = 0; + int unit = 0; if (!global_settings.talk_menu) return; @@ -829,12 +829,15 @@ static void say_time(int cursorpos, const struct tm *tm) { case 0: value = tm->tm_hour; + unit = UNIT_HOUR; break; case 1: value = tm->tm_min; + unit = UNIT_MIN; break; case 2: value = tm->tm_sec; + unit = UNIT_SEC; break; case 3: value = tm->tm_year + 1900; @@ -847,7 +850,7 @@ static void say_time(int cursorpos, const struct tm *tm) if (cursorpos == 4) /* month */ talk_id(LANG_MONTH_JANUARY + tm->tm_mon, false); else - talk_value(value, unit[cursorpos], false); + talk_value(value, unit, false); } |