forked from len0rd/rockbox
More const policeing step 4
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4983 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2b0694c694
commit
9478cc6f8a
10 changed files with 24 additions and 23 deletions
|
|
@ -36,13 +36,13 @@ extern int button_add(unsigned int button);
|
|||
|
||||
#define KEYBOARD_MAX_LENGTH 255
|
||||
|
||||
static unsigned char* kbd_screens[3] = {
|
||||
static const unsigned char* const kbd_screens[3] = {
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
"abcdefghijklmnopqrstuvwxyz",
|
||||
" !\"#$%&'()*+,-./0123456789;<=>?@[]^_`{|}"
|
||||
};
|
||||
|
||||
static unsigned char* kbd_screens_names[3] = {
|
||||
static const unsigned char* const kbd_screens_names[3] = {
|
||||
"Capitals",
|
||||
"Small",
|
||||
"Others"
|
||||
|
|
@ -77,7 +77,7 @@ int kbd_input(char* text, int buflen)
|
|||
int key;
|
||||
int screen = 0;
|
||||
int screenidx = -1;
|
||||
unsigned char * pcurscreen = kbd_screens[0];
|
||||
const unsigned char * pcurscreen = kbd_screens[0];
|
||||
bool ctl;
|
||||
|
||||
bufferlen = strlen(text);
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ static int pll_cnt;
|
|||
static bool presets_loaded = false;
|
||||
static struct fmstation presets[MAX_PRESETS];
|
||||
|
||||
static char default_filename[] = "/.rockbox/fm-presets-default.fmr";
|
||||
static const char default_filename[] = "/.rockbox/fm-presets-default.fmr";
|
||||
|
||||
int debug_fm_detection;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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 ***/
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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[];
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue