1
0
Fork 0
forked from len0rd/rockbox

Made local constant arrays static, saving a few bytes

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5014 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2004-08-26 20:30:22 +00:00
parent d1851e3364
commit 033ba1669b
3 changed files with 41 additions and 34 deletions

View file

@ -815,7 +815,7 @@ void charging_splash(void)
/* little helper function for voice output */ /* little helper function for voice output */
static void say_time(int cursorpos, const struct tm *tm) 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; int value = 0;
if (!global_settings.talk_menu) 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 width, height;
unsigned int separator_width, weekday_width; unsigned int separator_width, weekday_width;
unsigned int line_height, prev_line_height; unsigned int line_height, prev_line_height;
const int dayname[] = {LANG_WEEKDAY_SUNDAY,
LANG_WEEKDAY_MONDAY, static const int dayname[] = {
LANG_WEEKDAY_TUESDAY, LANG_WEEKDAY_SUNDAY,
LANG_WEEKDAY_WEDNESDAY, LANG_WEEKDAY_MONDAY,
LANG_WEEKDAY_THURSDAY, LANG_WEEKDAY_TUESDAY,
LANG_WEEKDAY_FRIDAY, LANG_WEEKDAY_WEDNESDAY,
LANG_WEEKDAY_SATURDAY}; LANG_WEEKDAY_THURSDAY,
const int monthname[] = {LANG_MONTH_JANUARY, LANG_WEEKDAY_FRIDAY,
LANG_MONTH_FEBRUARY, LANG_WEEKDAY_SATURDAY
LANG_MONTH_MARCH, };
LANG_MONTH_APRIL, static const int monthname[] = {
LANG_MONTH_MAY, LANG_MONTH_JANUARY,
LANG_MONTH_JUNE, LANG_MONTH_FEBRUARY,
LANG_MONTH_JULY, LANG_MONTH_MARCH,
LANG_MONTH_AUGUST, LANG_MONTH_APRIL,
LANG_MONTH_SEPTEMBER, LANG_MONTH_MAY,
LANG_MONTH_OCTOBER, LANG_MONTH_JUNE,
LANG_MONTH_NOVEMBER, LANG_MONTH_JULY,
LANG_MONTH_DECEMBER}; 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}, char cursor[][3] = {{ 0, 8, 12}, {18, 8, 12}, {36, 8, 12},
{24, 16, 24}, {54, 16, 18}, {78, 16, 12}}; {24, 16, 24}, {54, 16, 18}, {78, 16, 12}};
char daysinmonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; char daysinmonth[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

View file

@ -486,7 +486,7 @@ int talk_number(int n, bool enqueue)
int talk_value(int n, int unit, bool enqueue) int talk_value(int n, int unit, bool enqueue)
{ {
int unit_id; int unit_id;
const int unit_voiced[] = static const int unit_voiced[] =
{ /* lookup table for the voice ID of the units */ { /* lookup table for the voice ID of the units */
-1, -1, -1, /* regular ID, int, signed */ -1, -1, -1, /* regular ID, int, signed */
VOICE_MILLISECONDS, /* here come the "real" units */ VOICE_MILLISECONDS, /* here come the "real" units */
@ -532,7 +532,7 @@ int talk_value(int n, int unit, bool enqueue)
} }
/* spell a string */ /* spell a string */
int talk_spell(const char* spell, bool enqueue) int talk_spell(const char* spell, bool enqueue)
{ {
char c; /* currently processed char */ char c; /* currently processed char */

View file

@ -1097,18 +1097,20 @@ static void draw_player_fullbar(char* buf, int buf_size,
char player_progressbar[7]; char player_progressbar[7];
char binline[36]; char binline[36];
char numbers[12][4][3]={{{1,1,1},{1,0,1},{1,0,1},{1,1,1}},/*0*/ static const char numbers[12][4][3]={
{{0,1,0},{1,1,0},{0,1,0},{0,1,0}},/*1*/ {{1,1,1},{1,0,1},{1,0,1},{1,1,1}},/*0*/
{{1,1,1},{0,0,1},{0,1,0},{1,1,1}},/*2*/ {{0,1,0},{1,1,0},{0,1,0},{0,1,0}},/*1*/
{{1,1,1},{0,0,1},{0,1,1},{1,1,1}},/*3*/ {{1,1,1},{0,0,1},{0,1,0},{1,1,1}},/*2*/
{{1,0,0},{1,1,0},{1,1,1},{0,1,0}},/*4*/ {{1,1,1},{0,0,1},{0,1,1},{1,1,1}},/*3*/
{{1,1,1},{1,1,0},{0,0,1},{1,1,0}},/*5*/ {{1,0,0},{1,1,0},{1,1,1},{0,1,0}},/*4*/
{{1,1,1},{1,0,0},{1,1,1},{1,1,1}},/*6*/ {{1,1,1},{1,1,0},{0,0,1},{1,1,0}},/*5*/
{{1,1,1},{0,0,1},{0,1,0},{1,0,0}},/*7*/ {{1,1,1},{1,0,0},{1,1,1},{1,1,1}},/*6*/
{{1,1,1},{1,1,1},{1,0,1},{1,1,1}},/*8*/ {{1,1,1},{0,0,1},{0,1,0},{1,0,0}},/*7*/
{{1,1,1},{1,1,1},{0,0,1},{1,1,1}},/*9*/ {{1,1,1},{1,1,1},{1,0,1},{1,1,1}},/*8*/
{{0,0,0},{0,1,0},{0,0,0},{0,1,0}},/*:*/ {{1,1,1},{1,1,1},{0,0,1},{1,1,1}},/*9*/
{{0,0,0},{0,0,0},{0,0,0},{0,0,0}}};/*<blank>*/ {{0,0,0},{0,1,0},{0,0,0},{0,1,0}},/*:*/
{{0,0,0},{0,0,0},{0,0,0},{0,0,0}} /*<blank>*/
};
int songpos = 0; int songpos = 0;
int digits[6]; int digits[6];