From 2b0694c6944f2ea155291b62a00c11b89cd63914 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Tue, 3 Aug 2004 05:58:46 +0000 Subject: More const policeing step 3 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4982 a1c6a512-1295-4272-9138-f99709370657 --- firmware/backlight.c | 2 +- firmware/drivers/adc.c | 2 +- firmware/drivers/ata.c | 2 +- firmware/drivers/lcd-player.c | 6 +++--- firmware/drivers/lcd-recorder.c | 8 ++++---- firmware/export/thread.h | 3 ++- firmware/font.c | 2 +- firmware/thread.c | 5 +++-- 8 files changed, 16 insertions(+), 14 deletions(-) (limited to 'firmware') 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 @@ static void backlight_thread(void); static char backlight_stack[DEFAULT_STACK_SIZE]; -static char backlight_thread_name[] = "backlight"; +static const char backlight_thread_name[] = "backlight"; static struct event_queue backlight_queue; static 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 @@ static int current_channel; static unsigned short adcdata[NUM_ADC_CHANNELS]; -static unsigned int adcreg[NUM_ADC_CHANNELS] = +static const unsigned int adcreg[NUM_ADC_CHANNELS] = { ADDRAH_ADDR, ADDRBH_ADDR, ADDRCH_ADDR, ADDRDH_ADDR, 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; static int poweroff_timeout = 2*HZ; #endif static char ata_stack[DEFAULT_STACK_SIZE]; -static char ata_thread_name[] = "ata"; +static const char ata_thread_name[] = "ata"; static struct event_queue ata_queue; static bool initialized = false; static 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 { static void scroll_thread(void); static char scroll_stack[DEFAULT_STACK_SIZE]; -static char scroll_name[] = "scroll"; +static const char scroll_name[] = "scroll"; static char scroll_speed = 8; /* updates per second */ static int scroll_delay = HZ/2; /* delay before starting scroll */ static int jump_scroll_delay = HZ/4; /* delay between jump scroll jumps */ @@ -422,7 +422,7 @@ void lcd_double_height(bool on) lcd_write_command(on?9:8); } -static char icon_pos[] = +static const char icon_pos[] = { 0, 0, 0, 0, /* Battery */ 2, /* USB */ @@ -441,7 +441,7 @@ static char icon_pos[] = 10, /* Param */ }; -static char icon_mask[] = +static const char icon_mask[] = { 0x02, 0x08, 0x04, 0x10, /* Battery */ 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 static void scroll_thread(void); static char scroll_stack[DEFAULT_STACK_SIZE]; -static char scroll_name[] = "scroll"; +static const char scroll_name[] = "scroll"; static char scroll_speed = 8; /* updates per second */ static int scroll_delay = HZ/2; /* ticks delay before start */ static char scroll_step = 6; /* pixels per scroll step */ @@ -109,9 +109,9 @@ static int xoffset = 0; /* needed for flip */ unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; /* All zeros and ones bitmaps for area filling */ -static unsigned char zeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; -static unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff}; +static const unsigned char zeros[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; +static const unsigned char ones[8] = { 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff}; int lcd_default_contrast(void) { 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 @@ #define MAXTHREADS 10 #define DEFAULT_STACK_SIZE 0x400 /* Bytes */ -int create_thread(void* function, void* stack, int stack_size, char *name); +int create_thread(void* function, void* stack, int stack_size, + const char *name); void remove_thread(int threadnum); void switch_thread(void); void 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; static struct font font_ui; /* system font table, in order of FONT_xxx definition */ -static struct font* sysfonts[MAXFONTS] = { &sysfont, &font_ui }; +static struct font* const sysfonts[MAXFONTS] = { &sysfont, &font_ui }; /* static buffer allocation structures */ static 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; static volatile int num_sleepers; static int current_thread; static struct regs thread_contexts[MAXTHREADS] __attribute__ ((section(".idata"))); -char *thread_name[MAXTHREADS]; +const char *thread_name[MAXTHREADS]; void *thread_stack[MAXTHREADS]; int thread_stack_size[MAXTHREADS]; static char main_thread_name[] = "main"; @@ -142,7 +142,8 @@ void wake_up_thread(void) * Return ID if context area could be allocated, else -1. *--------------------------------------------------------------------------- */ -int create_thread(void* function, void* stack, int stack_size, char *name) +int create_thread(void* function, void* stack, int stack_size, + const char *name) { unsigned int i; unsigned int stacklen; -- cgit v1.2.3