summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2004-08-03 05:58:46 +0000
committerJens Arnold <amiconn@rockbox.org>2004-08-03 05:58:46 +0000
commit2b0694c6944f2ea155291b62a00c11b89cd63914 (patch)
tree7b69164f0a3d5c19c3a6db67b8f7e42a24266821
parent586ec8274dbe487f3c5567d067965b17e5e228cd (diff)
downloadrockbox-2b0694c6944f2ea155291b62a00c11b89cd63914.tar.gz
rockbox-2b0694c6944f2ea155291b62a00c11b89cd63914.zip
More const policeing step 3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4982 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.h2
-rw-r--r--firmware/backlight.c2
-rw-r--r--firmware/drivers/adc.c2
-rw-r--r--firmware/drivers/ata.c2
-rw-r--r--firmware/drivers/lcd-player.c6
-rw-r--r--firmware/drivers/lcd-recorder.c8
-rw-r--r--firmware/export/thread.h3
-rw-r--r--firmware/font.c2
-rw-r--r--firmware/thread.c5
9 files changed, 17 insertions, 15 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index 4656b05be5..8ee2534372 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -189,7 +189,7 @@ struct plugin_api {
189 void (*usb_screen)(void); 189 void (*usb_screen)(void);
190 long* current_tick; 190 long* current_tick;
191 int (*default_event_handler)(int event); 191 int (*default_event_handler)(int event);
192 int (*create_thread)(void* function, void* stack, int stack_size, char *name); 192 int (*create_thread)(void* function, void* stack, int stack_size, const char *name);
193 void (*remove_thread)(int threadnum); 193 void (*remove_thread)(int threadnum);
194 void (*reset_poweroff_timer)(void); 194 void (*reset_poweroff_timer)(void);
195 195
diff --git a/firmware/backlight.c b/firmware/backlight.c
index f43c8a06fc..0b3ac5856d 100644
--- a/firmware/backlight.c
+++ b/firmware/backlight.c
@@ -33,7 +33,7 @@
33 33
34static void backlight_thread(void); 34static void backlight_thread(void);
35static char backlight_stack[DEFAULT_STACK_SIZE]; 35static char backlight_stack[DEFAULT_STACK_SIZE];
36static char backlight_thread_name[] = "backlight"; 36static const char backlight_thread_name[] = "backlight";
37static struct event_queue backlight_queue; 37static struct event_queue backlight_queue;
38 38
39static bool charger_was_inserted = 0; 39static bool charger_was_inserted = 0;
diff --git a/firmware/drivers/adc.c b/firmware/drivers/adc.c
index 7be9baf5d5..c81d571b04 100644
--- a/firmware/drivers/adc.c
+++ b/firmware/drivers/adc.c
@@ -24,7 +24,7 @@
24 24
25static int current_channel; 25static int current_channel;
26static unsigned short adcdata[NUM_ADC_CHANNELS]; 26static unsigned short adcdata[NUM_ADC_CHANNELS];
27static unsigned int adcreg[NUM_ADC_CHANNELS] = 27static const unsigned int adcreg[NUM_ADC_CHANNELS] =
28{ 28{
29 ADDRAH_ADDR, ADDRBH_ADDR, ADDRCH_ADDR, ADDRDH_ADDR, 29 ADDRAH_ADDR, ADDRBH_ADDR, ADDRCH_ADDR, ADDRDH_ADDR,
30 ADDRAH_ADDR, ADDRBH_ADDR, ADDRCH_ADDR, ADDRDH_ADDR 30 ADDRAH_ADDR, ADDRBH_ADDR, ADDRCH_ADDR, ADDRDH_ADDR
diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c
index 1394ceaf29..663df600ca 100644
--- a/firmware/drivers/ata.c
+++ b/firmware/drivers/ata.c
@@ -98,7 +98,7 @@ static bool poweroff = false;
98static int poweroff_timeout = 2*HZ; 98static int poweroff_timeout = 2*HZ;
99#endif 99#endif
100static char ata_stack[DEFAULT_STACK_SIZE]; 100static char ata_stack[DEFAULT_STACK_SIZE];
101static char ata_thread_name[] = "ata"; 101static const char ata_thread_name[] = "ata";
102static struct event_queue ata_queue; 102static struct event_queue ata_queue;
103static bool initialized = false; 103static bool initialized = false;
104static bool delayed_write = false; 104static bool delayed_write = false;
diff --git a/firmware/drivers/lcd-player.c b/firmware/drivers/lcd-player.c
index 3ae2f5dbb9..88aa53a6d3 100644
--- a/firmware/drivers/lcd-player.c
+++ b/firmware/drivers/lcd-player.c
@@ -87,7 +87,7 @@ struct cursorinfo {
87 87
88static void scroll_thread(void); 88static void scroll_thread(void);
89static char scroll_stack[DEFAULT_STACK_SIZE]; 89static char scroll_stack[DEFAULT_STACK_SIZE];
90static char scroll_name[] = "scroll"; 90static const char scroll_name[] = "scroll";
91static char scroll_speed = 8; /* updates per second */ 91static char scroll_speed = 8; /* updates per second */
92static int scroll_delay = HZ/2; /* delay before starting scroll */ 92static int scroll_delay = HZ/2; /* delay before starting scroll */
93static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */ 93static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */
@@ -422,7 +422,7 @@ void lcd_double_height(bool on)
422 lcd_write_command(on?9:8); 422 lcd_write_command(on?9:8);
423} 423}
424 424
425static char icon_pos[] = 425static const char icon_pos[] =
426{ 426{
427 0, 0, 0, 0, /* Battery */ 427 0, 0, 0, 0, /* Battery */
428 2, /* USB */ 428 2, /* USB */
@@ -441,7 +441,7 @@ static char icon_pos[] =
441 10, /* Param */ 441 10, /* Param */
442}; 442};
443 443
444static char icon_mask[] = 444static const char icon_mask[] =
445{ 445{
446 0x02, 0x08, 0x04, 0x10, /* Battery */ 446 0x02, 0x08, 0x04, 0x10, /* Battery */
447 0x04, /* USB */ 447 0x04, /* USB */
diff --git a/firmware/drivers/lcd-recorder.c b/firmware/drivers/lcd-recorder.c
index d2949c8758..42cf016f97 100644
--- a/firmware/drivers/lcd-recorder.c
+++ b/firmware/drivers/lcd-recorder.c
@@ -93,7 +93,7 @@ static volatile int scrolling_lines=0; /* Bitpattern of which lines are scrollin
93 93
94static void scroll_thread(void); 94static void scroll_thread(void);
95static char scroll_stack[DEFAULT_STACK_SIZE]; 95static char scroll_stack[DEFAULT_STACK_SIZE];
96static char scroll_name[] = "scroll"; 96static const char scroll_name[] = "scroll";
97static char scroll_speed = 8; /* updates per second */ 97static char scroll_speed = 8; /* updates per second */
98static int scroll_delay = HZ/2; /* ticks delay before start */ 98static int scroll_delay = HZ/2; /* ticks delay before start */
99static char scroll_step = 6; /* pixels per scroll step */ 99static char scroll_step = 6; /* pixels per scroll step */
@@ -109,9 +109,9 @@ static int xoffset = 0; /* needed for flip */
109unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; 109unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
110 110
111/* All zeros and ones bitmaps for area filling */ 111/* All zeros and ones bitmaps for area filling */
112static unsigned char zeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; 112static const unsigned char zeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
113static unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, 113static const unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff,
114 0xff, 0xff, 0xff, 0xff}; 114 0xff, 0xff, 0xff, 0xff};
115 115
116int lcd_default_contrast(void) 116int lcd_default_contrast(void)
117{ 117{
diff --git a/firmware/export/thread.h b/firmware/export/thread.h
index 77209726f7..a7b5709deb 100644
--- a/firmware/export/thread.h
+++ b/firmware/export/thread.h
@@ -24,7 +24,8 @@
24#define MAXTHREADS 10 24#define MAXTHREADS 10
25#define DEFAULT_STACK_SIZE 0x400 /* Bytes */ 25#define DEFAULT_STACK_SIZE 0x400 /* Bytes */
26 26
27int create_thread(void* function, void* stack, int stack_size, char *name); 27int create_thread(void* function, void* stack, int stack_size,
28 const char *name);
28void remove_thread(int threadnum); 29void remove_thread(int threadnum);
29void switch_thread(void); 30void switch_thread(void);
30void sleep_thread(void); 31void sleep_thread(void);
diff --git a/firmware/font.c b/firmware/font.c
index f9453d5bac..f33490869a 100644
--- a/firmware/font.c
+++ b/firmware/font.c
@@ -45,7 +45,7 @@ extern struct font sysfont;
45static struct font font_ui; 45static struct font font_ui;
46 46
47/* system font table, in order of FONT_xxx definition */ 47/* system font table, in order of FONT_xxx definition */
48static struct font* sysfonts[MAXFONTS] = { &sysfont, &font_ui }; 48static struct font* const sysfonts[MAXFONTS] = { &sysfont, &font_ui };
49 49
50/* static buffer allocation structures */ 50/* static buffer allocation structures */
51static unsigned char mbuf[MAX_FONT_SIZE]; 51static unsigned char mbuf[MAX_FONT_SIZE];
diff --git a/firmware/thread.c b/firmware/thread.c
index 294359b762..36cb49337c 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -36,7 +36,7 @@ int num_threads;
36static volatile int num_sleepers; 36static volatile int num_sleepers;
37static int current_thread; 37static int current_thread;
38static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata"))); 38static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata")));
39char *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 char main_thread_name[] = "main";
@@ -142,7 +142,8 @@ void wake_up_thread(void)
142 * Return ID if context area could be allocated, else -1. 142 * Return ID if context area could be allocated, else -1.
143 *--------------------------------------------------------------------------- 143 *---------------------------------------------------------------------------
144 */ 144 */
145int create_thread(void* function, void* stack, int stack_size, char *name) 145int create_thread(void* function, void* stack, int stack_size,
146 const char *name)
146{ 147{
147 unsigned int i; 148 unsigned int i;
148 unsigned int stacklen; 149 unsigned int stacklen;