summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-08-03 19:22:56 +0000
committerJens Arnold <amiconn@rockbox.org>2004-08-03 19:22:56 +0000
commit9478cc6f8a1f5155131bb001ed76e5309bfc4951 (patch)
tree8453ecfa3ac88269986000eb432441df318cd04c
parent2b0694c6944f2ea155291b62a00c11b89cd63914 (diff)
downloadrockbox-9478cc6f8a1f5155131bb001ed76e5309bfc4951.tar.gz
rockbox-9478cc6f8a1f5155131bb001ed76e5309bfc4951.zip
More const policeing step 4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4983 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/neo/keyboard.c6
-rw-r--r--apps/recorder/radio.c2
-rw-r--r--firmware/drivers/lcd-player-charset.c3
-rw-r--r--firmware/drivers/lcd-player.c2
-rw-r--r--firmware/id3.c8
-rw-r--r--firmware/mp3_playback.c6
-rw-r--r--firmware/mpeg.c4
-rw-r--r--firmware/powermgmt.c12
-rw-r--r--firmware/thread.c2
-rw-r--r--firmware/usb.c2
10 files changed, 24 insertions, 23 deletions
diff --git a/apps/neo/keyboard.c b/apps/neo/keyboard.c
index d81d7629b3..6dd315e16e 100644
--- a/apps/neo/keyboard.c
+++ b/apps/neo/keyboard.c
@@ -36,13 +36,13 @@ extern int button_add(unsigned int button);
36 36
37#define KEYBOARD_MAX_LENGTH 255 37#define KEYBOARD_MAX_LENGTH 255
38 38
39static unsigned char* kbd_screens[3] = { 39static const unsigned char* const kbd_screens[3] = {
40 "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 40 "ABCDEFGHIJKLMNOPQRSTUVWXYZ",
41 "abcdefghijklmnopqrstuvwxyz", 41 "abcdefghijklmnopqrstuvwxyz",
42 " !\"#$%&'()*+,-./0123456789;<=>?@[]^_`{|}" 42 " !\"#$%&'()*+,-./0123456789;<=>?@[]^_`{|}"
43}; 43};
44 44
45static unsigned char* kbd_screens_names[3] = { 45static const unsigned char* const kbd_screens_names[3] = {
46 "Capitals", 46 "Capitals",
47 "Small", 47 "Small",
48 "Others" 48 "Others"
@@ -77,7 +77,7 @@ int kbd_input(char* text, int buflen)
77 int key; 77 int key;
78 int screen = 0; 78 int screen = 0;
79 int screenidx = -1; 79 int screenidx = -1;
80 unsigned char * pcurscreen = kbd_screens[0]; 80 const unsigned char * pcurscreen = kbd_screens[0];
81 bool ctl; 81 bool ctl;
82 82
83 bufferlen = strlen(text); 83 bufferlen = strlen(text);
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index e26ac5bdc8..3bd50183c6 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -75,7 +75,7 @@ static int pll_cnt;
75static bool presets_loaded = false; 75static bool presets_loaded = false;
76static struct fmstation presets[MAX_PRESETS]; 76static struct fmstation presets[MAX_PRESETS];
77 77
78static char default_filename[] = "/.rockbox/fm-presets-default.fmr"; 78static const char default_filename[] = "/.rockbox/fm-presets-default.fmr";
79 79
80int debug_fm_detection; 80int debug_fm_detection;
81 81
diff --git a/firmware/drivers/lcd-player-charset.c b/firmware/drivers/lcd-player-charset.c
index ff35e4efa1..479d19e737 100644
--- a/firmware/drivers/lcd-player-charset.c
+++ b/firmware/drivers/lcd-player-charset.c
@@ -545,7 +545,8 @@ unsigned short old_lcd_rocklatin1_to_xlcd[] =
545}; 545};
546 546
547/* second table -- substitute */ 547/* second table -- substitute */
548unsigned char lcd_player_extended_lcd_to_rocklatin1[NO_EXTENDED_LCD_CHARS] = 548const unsigned char
549 lcd_player_extended_lcd_to_rocklatin1[NO_EXTENDED_LCD_CHARS] =
549{ 550{
550/* 00 */ NOCHAR_NEW, /* 0-16 user defined */ 551/* 00 */ NOCHAR_NEW, /* 0-16 user defined */
551/* 01 */ NOCHAR_NEW, /* 0-16 user defined */ 552/* 01 */ NOCHAR_NEW, /* 0-16 user defined */
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c
index 88aa53a6d3..c948f49828 100644
--- a/firmware/drivers/lcd-player.c
+++ b/firmware/drivers/lcd-player.c
@@ -55,7 +55,7 @@
55 55
56extern unsigned short new_lcd_rocklatin1_to_xlcd[]; 56extern unsigned short new_lcd_rocklatin1_to_xlcd[];
57extern unsigned short old_lcd_rocklatin1_to_xlcd[]; 57extern unsigned short old_lcd_rocklatin1_to_xlcd[];
58extern unsigned char lcd_player_extended_lcd_to_rocklatin1[]; 58extern const unsigned char lcd_player_extended_lcd_to_rocklatin1[];
59extern unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8]; 59extern unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8];
60 60
61/*** generic code ***/ 61/*** generic code ***/
diff --git a/firmware/id3.c b/firmware/id3.c
index 03c37c027e..0a08fa0de8 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -269,7 +269,7 @@ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
269 } 269 }
270} 270}
271 271
272static struct tag_resolver taglist[] = { 272static const struct tag_resolver taglist[] = {
273 { "TPE1", 4, offsetof(struct mp3entry, artist), NULL }, 273 { "TPE1", 4, offsetof(struct mp3entry, artist), NULL },
274 { "TP1", 3, offsetof(struct mp3entry, artist), NULL }, 274 { "TP1", 3, offsetof(struct mp3entry, artist), NULL },
275 { "TIT2", 4, offsetof(struct mp3entry, title), NULL }, 275 { "TIT2", 4, offsetof(struct mp3entry, title), NULL },
@@ -383,7 +383,7 @@ static int unicode_munge(char** string, int *len) {
383static bool setid3v1title(int fd, struct mp3entry *entry) 383static bool setid3v1title(int fd, struct mp3entry *entry)
384{ 384{
385 unsigned char buffer[128]; 385 unsigned char buffer[128];
386 static char offsets[] = {3, 33, 63, 93, 125, 127}; 386 static const char offsets[] = {3, 33, 63, 93, 125, 127};
387 int i, j; 387 int i, j;
388 388
389 if (-1 == lseek(fd, -128, SEEK_END)) 389 if (-1 == lseek(fd, -128, SEEK_END))
@@ -649,7 +649,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
649 processing function will be called via a pointer to function. */ 649 processing function will be called via a pointer to function. */
650 650
651 for (i=0; i<TAGLIST_SIZE; i++) { 651 for (i=0; i<TAGLIST_SIZE; i++) {
652 struct tag_resolver* tr = &taglist[i]; 652 const struct tag_resolver* tr = &taglist[i];
653 char** ptag = (char**) (((char*)entry) + tr->offset); 653 char** ptag = (char**) (((char*)entry) + tr->offset);
654 char* tag; 654 char* tag;
655 655
@@ -682,7 +682,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
682 } 682 }
683 683
684 if( i == TAGLIST_SIZE ) { 684 if( i == TAGLIST_SIZE ) {
685 /* no tag in tagList was found, or it was a repeat. 685 /* no tag in tagList was found, or it was a repeat.
686 skip it using the total size */ 686 skip it using the total size */
687 687
688 if(global_unsynch && version <= ID3_VER_2_3) { 688 if(global_unsynch && version <= ID3_VER_2_3) {
diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c
index 1e6b3b6d3c..87db1a2ff8 100644
--- a/firmware/mp3_playback.c
+++ b/firmware/mp3_playback.c
@@ -240,7 +240,7 @@ unsigned long mas_version_code;
240 240
241#ifdef HAVE_MAS3507D 241#ifdef HAVE_MAS3507D
242 242
243static unsigned int bass_table[] = 243static const unsigned int bass_table[] =
244{ 244{
245 0x9e400, /* -15dB */ 245 0x9e400, /* -15dB */
246 0xa2800, /* -14dB */ 246 0xa2800, /* -14dB */
@@ -275,7 +275,7 @@ static unsigned int bass_table[] =
275 0x61800 /* 15dB */ 275 0x61800 /* 15dB */
276}; 276};
277 277
278static unsigned int treble_table[] = 278static const unsigned int treble_table[] =
279{ 279{
280 0xb2c00, /* -15dB */ 280 0xb2c00, /* -15dB */
281 0xbb400, /* -14dB */ 281 0xbb400, /* -14dB */
@@ -310,7 +310,7 @@ static unsigned int treble_table[] =
310 0x5f800 /* 15dB */ 310 0x5f800 /* 15dB */
311}; 311};
312 312
313static unsigned int prescale_table[] = 313static const unsigned int prescale_table[] =
314{ 314{
315 0x80000, /* 0db */ 315 0x80000, /* 0db */
316 0x8e000, /* 1dB */ 316 0x8e000, /* 1dB */
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 377427260a..45b6f05646 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -349,7 +349,7 @@ extern unsigned long mas_version_code;
349 349
350static struct event_queue mpeg_queue; 350static struct event_queue mpeg_queue;
351static char mpeg_stack[DEFAULT_STACK_SIZE + 0x1000]; 351static char mpeg_stack[DEFAULT_STACK_SIZE + 0x1000];
352static char mpeg_thread_name[] = "mpeg"; 352static const char mpeg_thread_name[] = "mpeg";
353 353
354static int mp3buflen; 354static int mp3buflen;
355static int mp3buf_write; 355static int mp3buf_write;
@@ -2637,7 +2637,7 @@ void mpeg_error_clear(void)
2637 2637
2638#ifdef SIMULATOR 2638#ifdef SIMULATOR
2639static char mpeg_stack[DEFAULT_STACK_SIZE]; 2639static char mpeg_stack[DEFAULT_STACK_SIZE];
2640static char mpeg_thread_name[] = "mpeg"; 2640static const char mpeg_thread_name[] = "mpeg";
2641static void mpeg_thread(void) 2641static void mpeg_thread(void)
2642{ 2642{
2643 struct mp3entry* id3; 2643 struct mp3entry* id3;
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index a093fe2ac8..6a72a2c613 100644
--- a/firmware/powermgmt.c
+++ b/firmware/powermgmt.c
@@ -84,12 +84,12 @@ int battery_level_cached = -1; /* battery level of this minute, updated once
84 per minute */ 84 per minute */
85static bool car_adapter_mode_enabled = false; 85static bool car_adapter_mode_enabled = false;
86 86
87static int poweroff_idle_timeout_value[15] = 87static const int poweroff_idle_timeout_value[15] =
88{ 88{
89 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 30, 45, 60 89 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 30, 45, 60
90}; 90};
91 91
92static int percent_to_volt_decharge[11] = 92static const int percent_to_volt_decharge[11] =
93/* voltages (centivolt) of 0%, 10%, ... 100% when charging disabled */ 93/* voltages (centivolt) of 0%, 10%, ... 100% when charging disabled */
94{ 94{
95#ifdef HAVE_LIION 95#ifdef HAVE_LIION
@@ -133,8 +133,8 @@ int trickle_sec = 0; /* how many seconds should the
133 charger be enabled per 133 charger be enabled per
134 minute for trickle 134 minute for trickle
135 charging? */ 135 charging? */
136static int percent_to_volt_charge[11] = /* voltages (centivolt) of 0%, 10%, 136static const int percent_to_volt_charge[11] =
137 ... 100% when charging enabled */ 137/* voltages (centivolt) of 0%, 10%, ... 100% when charging enabled */
138{ 138{
139 /* values guessed, see 139 /* values guessed, see
140 http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf until someone 140 http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf until someone
@@ -149,7 +149,7 @@ void enable_trickle_charge(bool on)
149#endif /* HAVE_CHARGE_CTRL */ 149#endif /* HAVE_CHARGE_CTRL */
150 150
151static char power_stack[DEFAULT_STACK_SIZE]; 151static char power_stack[DEFAULT_STACK_SIZE];
152static char power_thread_name[] = "power"; 152static const char power_thread_name[] = "power";
153 153
154static int poweroff_timeout = 0; 154static int poweroff_timeout = 0;
155static long last_charge_time = 0; 155static long last_charge_time = 0;
@@ -167,7 +167,7 @@ int battery_time(void)
167 167
168/* look into the percent_to_volt_* table and get a realistic battery level 168/* look into the percent_to_volt_* table and get a realistic battery level
169 percentage */ 169 percentage */
170int voltage_to_percent(int voltage, int* table) 170int voltage_to_percent(int voltage, const int* table)
171{ 171{
172 if (voltage <= table[0]) 172 if (voltage <= table[0])
173 return 0; 173 return 0;
diff --git a/firmware/thread.c b/firmware/thread.c
index 36cb49337c..7490833863 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -39,7 +39,7 @@ static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata")
39const char *thread_name[MAXTHREADS]; 39const char *thread_name[MAXTHREADS];
40void *thread_stack[MAXTHREADS]; 40void *thread_stack[MAXTHREADS];
41int thread_stack_size[MAXTHREADS]; 41int thread_stack_size[MAXTHREADS];
42static char main_thread_name[] = "main"; 42static const char main_thread_name[] = "main";
43 43
44extern int stackbegin[]; 44extern int stackbegin[];
45extern int stackend[]; 45extern int stackend[];
diff --git a/firmware/usb.c b/firmware/usb.c
index 5350a8575e..3be6d7529c 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -65,7 +65,7 @@ static int usb_state;
65/* FIXME: The extra 0x400 is consumed by fat_mount() when the fsinfo 65/* FIXME: The extra 0x400 is consumed by fat_mount() when the fsinfo
66 needs updating */ 66 needs updating */
67static char usb_stack[DEFAULT_STACK_SIZE + 0x400]; 67static char usb_stack[DEFAULT_STACK_SIZE + 0x400];
68static char usb_thread_name[] = "usb"; 68static const char usb_thread_name[] = "usb";
69static struct event_queue usb_queue; 69static struct event_queue usb_queue;
70static bool last_usb_status; 70static bool last_usb_status;
71static bool usb_monitor_enabled; 71static bool usb_monitor_enabled;