From 033ba1669b1e4c7c29e0e4d4d3573a75b681abb5 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 26 Aug 2004 20:30:22 +0000 Subject: Made local constant arrays static, saving a few bytes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5014 a1c6a512-1295-4272-9138-f99709370657 --- apps/screens.c | 45 +++++++++++++++++++++++++-------------------- apps/talk.c | 4 ++-- apps/wps-display.c | 26 ++++++++++++++------------ 3 files changed, 41 insertions(+), 34 deletions(-) diff --git a/apps/screens.c b/apps/screens.c index 3e30e3e021..1026973697 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -815,7 +815,7 @@ void charging_splash(void) /* little helper function for voice output */ static void say_time(int cursorpos, const struct tm *tm) { - const int unit[] = { UNIT_HOUR, UNIT_MIN, UNIT_SEC, 0, 0, 0 }; + static const int unit[] = { UNIT_HOUR, UNIT_MIN, UNIT_SEC, 0, 0, 0 }; int value = 0; if (!global_settings.talk_menu) @@ -865,25 +865,30 @@ bool set_time_screen(const char* string, struct tm *tm) unsigned int width, height; unsigned int separator_width, weekday_width; unsigned int line_height, prev_line_height; - const int dayname[] = {LANG_WEEKDAY_SUNDAY, - LANG_WEEKDAY_MONDAY, - LANG_WEEKDAY_TUESDAY, - LANG_WEEKDAY_WEDNESDAY, - LANG_WEEKDAY_THURSDAY, - LANG_WEEKDAY_FRIDAY, - LANG_WEEKDAY_SATURDAY}; - const int monthname[] = {LANG_MONTH_JANUARY, - LANG_MONTH_FEBRUARY, - LANG_MONTH_MARCH, - LANG_MONTH_APRIL, - LANG_MONTH_MAY, - LANG_MONTH_JUNE, - LANG_MONTH_JULY, - LANG_MONTH_AUGUST, - LANG_MONTH_SEPTEMBER, - LANG_MONTH_OCTOBER, - LANG_MONTH_NOVEMBER, - LANG_MONTH_DECEMBER}; + + static const int dayname[] = { + LANG_WEEKDAY_SUNDAY, + LANG_WEEKDAY_MONDAY, + LANG_WEEKDAY_TUESDAY, + LANG_WEEKDAY_WEDNESDAY, + LANG_WEEKDAY_THURSDAY, + LANG_WEEKDAY_FRIDAY, + LANG_WEEKDAY_SATURDAY + }; + static const int monthname[] = { + LANG_MONTH_JANUARY, + LANG_MONTH_FEBRUARY, + LANG_MONTH_MARCH, + LANG_MONTH_APRIL, + LANG_MONTH_MAY, + LANG_MONTH_JUNE, + LANG_MONTH_JULY, + LANG_MONTH_AUGUST, + LANG_MONTH_SEPTEMBER, + LANG_MONTH_OCTOBER, + LANG_MONTH_NOVEMBER, + LANG_MONTH_DECEMBER + }; char cursor[][3] = {{ 0, 8, 12}, {18, 8, 12}, {36, 8, 12}, {24, 16, 24}, {54, 16, 18}, {78, 16, 12}}; char daysinmonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; diff --git a/apps/talk.c b/apps/talk.c index d90d23866e..83acbb09d5 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -486,7 +486,7 @@ int talk_number(int n, bool enqueue) int talk_value(int n, int unit, bool enqueue) { int unit_id; - const int unit_voiced[] = + static const int unit_voiced[] = { /* lookup table for the voice ID of the units */ -1, -1, -1, /* regular ID, int, signed */ VOICE_MILLISECONDS, /* here come the "real" units */ @@ -532,7 +532,7 @@ int talk_value(int n, int unit, bool enqueue) } /* spell a string */ -int talk_spell(const char* spell, bool enqueue) +int talk_spell(const char* spell, bool enqueue) { char c; /* currently processed char */ diff --git a/apps/wps-display.c b/apps/wps-display.c index 159f0abda6..238c8d3f19 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c @@ -1097,18 +1097,20 @@ static void draw_player_fullbar(char* buf, int buf_size, char player_progressbar[7]; char binline[36]; - char numbers[12][4][3]={{{1,1,1},{1,0,1},{1,0,1},{1,1,1}},/*0*/ - {{0,1,0},{1,1,0},{0,1,0},{0,1,0}},/*1*/ - {{1,1,1},{0,0,1},{0,1,0},{1,1,1}},/*2*/ - {{1,1,1},{0,0,1},{0,1,1},{1,1,1}},/*3*/ - {{1,0,0},{1,1,0},{1,1,1},{0,1,0}},/*4*/ - {{1,1,1},{1,1,0},{0,0,1},{1,1,0}},/*5*/ - {{1,1,1},{1,0,0},{1,1,1},{1,1,1}},/*6*/ - {{1,1,1},{0,0,1},{0,1,0},{1,0,0}},/*7*/ - {{1,1,1},{1,1,1},{1,0,1},{1,1,1}},/*8*/ - {{1,1,1},{1,1,1},{0,0,1},{1,1,1}},/*9*/ - {{0,0,0},{0,1,0},{0,0,0},{0,1,0}},/*:*/ - {{0,0,0},{0,0,0},{0,0,0},{0,0,0}}};/**/ + static const char numbers[12][4][3]={ + {{1,1,1},{1,0,1},{1,0,1},{1,1,1}},/*0*/ + {{0,1,0},{1,1,0},{0,1,0},{0,1,0}},/*1*/ + {{1,1,1},{0,0,1},{0,1,0},{1,1,1}},/*2*/ + {{1,1,1},{0,0,1},{0,1,1},{1,1,1}},/*3*/ + {{1,0,0},{1,1,0},{1,1,1},{0,1,0}},/*4*/ + {{1,1,1},{1,1,0},{0,0,1},{1,1,0}},/*5*/ + {{1,1,1},{1,0,0},{1,1,1},{1,1,1}},/*6*/ + {{1,1,1},{0,0,1},{0,1,0},{1,0,0}},/*7*/ + {{1,1,1},{1,1,1},{1,0,1},{1,1,1}},/*8*/ + {{1,1,1},{1,1,1},{0,0,1},{1,1,1}},/*9*/ + {{0,0,0},{0,1,0},{0,0,0},{0,1,0}},/*:*/ + {{0,0,0},{0,0,0},{0,0,0},{0,0,0}} /**/ + }; int songpos = 0; int digits[6]; -- cgit v1.2.3