summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2007-08-13 12:21:27 +0000
committerNils Wallménius <nils@rockbox.org>2007-08-13 12:21:27 +0000
commit45ffc87030f1fa3d49b10cc61c1d2d748ffd3e3f (patch)
treebc92c80316169756128e65cbcc7f452c8f9e4144
parent58537b43e61b23053371d92e9521e104d0908bca (diff)
downloadrockbox-45ffc87030f1fa3d49b10cc61c1d2d748ffd3e3f.tar.gz
rockbox-45ffc87030f1fa3d49b10cc61c1d2d748ffd3e3f.zip
Const-police, use less bytes where possible, get rid of duplicated backlight timeout array
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14310 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/settings_list.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 1b8b33363d..7d3f76cac3 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -207,8 +207,6 @@ static void rectime_formatter(char *buffer, int buffer_size,
207#ifdef HAVE_BACKLIGHT 207#ifdef HAVE_BACKLIGHT
208static const char backlight_times_conf [] = 208static const char backlight_times_conf [] =
209 "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90"; 209 "off,on,1,2,3,4,5,6,7,8,9,10,15,20,25,30,45,60,90";
210static const int backlight_times[] =
211 {-1, -1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 45, 60, 90};
212static void backlight_formatter(char *buffer, int buffer_size, 210static void backlight_formatter(char *buffer, int buffer_size,
213 int val, const char *unit) 211 int val, const char *unit)
214{ 212{
@@ -217,8 +215,8 @@ static void backlight_formatter(char *buffer, int buffer_size,
217 strcpy(buffer, str(LANG_OFF)); 215 strcpy(buffer, str(LANG_OFF));
218 else if (val == 1) 216 else if (val == 1)
219 strcpy(buffer, str(LANG_ON)); 217 strcpy(buffer, str(LANG_ON));
220 else 218 else
221 snprintf(buffer, buffer_size, "%d s", backlight_times[val]); 219 snprintf(buffer, buffer_size, "%d s", backlight_timeout_value[val]);
222} 220}
223static long backlight_getlang(int value) 221static long backlight_getlang(int value)
224{ 222{
@@ -226,11 +224,11 @@ static long backlight_getlang(int value)
226 return LANG_OFF; 224 return LANG_OFF;
227 else if (value == 1) 225 else if (value == 1)
228 return LANG_ON; 226 return LANG_ON;
229 return TALK_ID(backlight_times[value], UNIT_SEC); 227 return TALK_ID(backlight_timeout_value[value], UNIT_SEC);
230} 228}
231#endif 229#endif
232/* ffwd/rewind and scan acceleration stuff */ 230/* ffwd/rewind and scan acceleration stuff */
233static int ff_rewind_min_stepvals[] = {1,2,3,4,5,6,8,10,15,20,25,30,45,60}; 231static const unsigned char ff_rewind_min_stepvals[] = {1,2,3,4,5,6,8,10,15,20,25,30,45,60};
234static long ff_rewind_min_step_getlang(int value) 232static long ff_rewind_min_step_getlang(int value)
235{ 233{
236 return TALK_ID(ff_rewind_min_stepvals[value], UNIT_SEC); 234 return TALK_ID(ff_rewind_min_stepvals[value], UNIT_SEC);
@@ -257,7 +255,7 @@ static void scanaccel_formatter(char *buffer, int buffer_size,
257 snprintf(buffer, buffer_size, "2x/%ds", val); 255 snprintf(buffer, buffer_size, "2x/%ds", val);
258} 256}
259 257
260static int poweroff_idle_timer_times[] = {0,1,2,3,4,5,6,7,8,9,10,15,30,45,60}; 258static const unsigned char poweroff_idle_timer_times[] = {0,1,2,3,4,5,6,7,8,9,10,15,30,45,60};
261static long poweroff_idle_timer_getlang(int value) 259static long poweroff_idle_timer_getlang(int value)
262{ 260{
263 if (value == 0) 261 if (value == 0)