summaryrefslogtreecommitdiff
path: root/firmware
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 /firmware
parent2b0694c6944f2ea155291b62a00c11b89cd63914 (diff)
downloadrockbox-9478cc6f8a1f5155131bb001ed76e5309bfc4951.zip
rockbox-9478cc6f8a1f5155131bb001ed76e5309bfc4951.tar.gz
rockbox-9478cc6f8a1f5155131bb001ed76e5309bfc4951.tar.bz2
rockbox-9478cc6f8a1f5155131bb001ed76e5309bfc4951.tar.xz
More const policeing step 4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4983 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-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
8 files changed, 20 insertions, 19 deletions
diff --git a/firmware/drivers/lcd-player-charset.c b/firmware/drivers/lcd-player-charset.c
index ff35e4e..479d19e 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[] =
};
/* second table -- substitute */
-unsigned char lcd_player_extended_lcd_to_rocklatin1[NO_EXTENDED_LCD_CHARS] =
+const unsigned char
+ lcd_player_extended_lcd_to_rocklatin1[NO_EXTENDED_LCD_CHARS] =
{
/* 00 */ NOCHAR_NEW, /* 0-16 user defined */
/* 01 */ NOCHAR_NEW, /* 0-16 user defined */
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c
index 88aa53a..c948f49 100644
--- a/firmware/drivers/lcd-player.c
+++ b/firmware/drivers/lcd-player.c
@@ -55,7 +55,7 @@
extern unsigned short new_lcd_rocklatin1_to_xlcd[];
extern unsigned short old_lcd_rocklatin1_to_xlcd[];
-extern unsigned char lcd_player_extended_lcd_to_rocklatin1[];
+extern const unsigned char lcd_player_extended_lcd_to_rocklatin1[];
extern unsigned char extended_font_player[NO_EXTENDED_LCD_CHARS][8];
/*** generic code ***/
diff --git a/firmware/id3.c b/firmware/id3.c
index 03c37c0..0a08fa0 100644
--- a/firmware/id3.c
+++ b/firmware/id3.c
@@ -269,7 +269,7 @@ static int parsegenre( struct mp3entry* entry, char* tag, int bufferpos )
}
}
-static struct tag_resolver taglist[] = {
+static const struct tag_resolver taglist[] = {
{ "TPE1", 4, offsetof(struct mp3entry, artist), NULL },
{ "TP1", 3, offsetof(struct mp3entry, artist), NULL },
{ "TIT2", 4, offsetof(struct mp3entry, title), NULL },
@@ -383,7 +383,7 @@ static int unicode_munge(char** string, int *len) {
static bool setid3v1title(int fd, struct mp3entry *entry)
{
unsigned char buffer[128];
- static char offsets[] = {3, 33, 63, 93, 125, 127};
+ static const char offsets[] = {3, 33, 63, 93, 125, 127};
int i, j;
if (-1 == lseek(fd, -128, SEEK_END))
@@ -649,7 +649,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
processing function will be called via a pointer to function. */
for (i=0; i<TAGLIST_SIZE; i++) {
- struct tag_resolver* tr = &taglist[i];
+ const struct tag_resolver* tr = &taglist[i];
char** ptag = (char**) (((char*)entry) + tr->offset);
char* tag;
@@ -682,7 +682,7 @@ static void setid3v2title(int fd, struct mp3entry *entry)
}
if( i == TAGLIST_SIZE ) {
- /* no tag in tagList was found, or it was a repeat.
+ /* no tag in tagList was found, or it was a repeat.
skip it using the total size */
if(global_unsynch && version <= ID3_VER_2_3) {
diff --git a/firmware/mp3_playback.c b/firmware/mp3_playback.c
index 1e6b3b6..87db1a2 100644
--- a/firmware/mp3_playback.c
+++ b/firmware/mp3_playback.c
@@ -240,7 +240,7 @@ unsigned long mas_version_code;
#ifdef HAVE_MAS3507D
-static unsigned int bass_table[] =
+static const unsigned int bass_table[] =
{
0x9e400, /* -15dB */
0xa2800, /* -14dB */
@@ -275,7 +275,7 @@ static unsigned int bass_table[] =
0x61800 /* 15dB */
};
-static unsigned int treble_table[] =
+static const unsigned int treble_table[] =
{
0xb2c00, /* -15dB */
0xbb400, /* -14dB */
@@ -310,7 +310,7 @@ static unsigned int treble_table[] =
0x5f800 /* 15dB */
};
-static unsigned int prescale_table[] =
+static const unsigned int prescale_table[] =
{
0x80000, /* 0db */
0x8e000, /* 1dB */
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 3774272..45b6f05 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -349,7 +349,7 @@ extern unsigned long mas_version_code;
static struct event_queue mpeg_queue;
static char mpeg_stack[DEFAULT_STACK_SIZE + 0x1000];
-static char mpeg_thread_name[] = "mpeg";
+static const char mpeg_thread_name[] = "mpeg";
static int mp3buflen;
static int mp3buf_write;
@@ -2637,7 +2637,7 @@ void mpeg_error_clear(void)
#ifdef SIMULATOR
static char mpeg_stack[DEFAULT_STACK_SIZE];
-static char mpeg_thread_name[] = "mpeg";
+static const char mpeg_thread_name[] = "mpeg";
static void mpeg_thread(void)
{
struct mp3entry* id3;
diff --git a/firmware/powermgmt.c b/firmware/powermgmt.c
index a093fe2..6a72a2c 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
per minute */
static bool car_adapter_mode_enabled = false;
-static int poweroff_idle_timeout_value[15] =
+static const int poweroff_idle_timeout_value[15] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 30, 45, 60
};
-static int percent_to_volt_decharge[11] =
+static const int percent_to_volt_decharge[11] =
/* voltages (centivolt) of 0%, 10%, ... 100% when charging disabled */
{
#ifdef HAVE_LIION
@@ -133,8 +133,8 @@ int trickle_sec = 0; /* how many seconds should the
charger be enabled per
minute for trickle
charging? */
-static int percent_to_volt_charge[11] = /* voltages (centivolt) of 0%, 10%,
- ... 100% when charging enabled */
+static const int percent_to_volt_charge[11] =
+/* voltages (centivolt) of 0%, 10%, ... 100% when charging enabled */
{
/* values guessed, see
http://www.seattlerobotics.org/encoder/200210/LiIon2.pdf until someone
@@ -149,7 +149,7 @@ void enable_trickle_charge(bool on)
#endif /* HAVE_CHARGE_CTRL */
static char power_stack[DEFAULT_STACK_SIZE];
-static char power_thread_name[] = "power";
+static const char power_thread_name[] = "power";
static int poweroff_timeout = 0;
static long last_charge_time = 0;
@@ -167,7 +167,7 @@ int battery_time(void)
/* look into the percent_to_volt_* table and get a realistic battery level
percentage */
-int voltage_to_percent(int voltage, int* table)
+int voltage_to_percent(int voltage, const int* table)
{
if (voltage <= table[0])
return 0;
diff --git a/firmware/thread.c b/firmware/thread.c
index 36cb493..7490833 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -39,7 +39,7 @@ static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata")
const char *thread_name[MAXTHREADS];
void *thread_stack[MAXTHREADS];
int thread_stack_size[MAXTHREADS];
-static char main_thread_name[] = "main";
+static const char main_thread_name[] = "main";
extern int stackbegin[];
extern int stackend[];
diff --git a/firmware/usb.c b/firmware/usb.c
index 5350a85..3be6d75 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -65,7 +65,7 @@ static int usb_state;
/* FIXME: The extra 0x400 is consumed by fat_mount() when the fsinfo
needs updating */
static char usb_stack[DEFAULT_STACK_SIZE + 0x400];
-static char usb_thread_name[] = "usb";
+static const char usb_thread_name[] = "usb";
static struct event_queue usb_queue;
static bool last_usb_status;
static bool usb_monitor_enabled;