From 839067b7b306e2da5142c3f31747205df8f9e4f5 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Sun, 1 Aug 2004 23:34:44 +0000 Subject: More const policeing step 2 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4980 a1c6a512-1295-4272-9138-f99709370657 --- apps/filetypes.c | 2 +- apps/recorder/peakmeter.c | 4 ++-- apps/recorder/recording.c | 6 +++--- apps/sound_menu.c | 2 +- apps/talk.c | 2 +- apps/talk.h | 2 +- apps/tree.c | 4 ++-- apps/tree.h | 2 +- apps/wps.c | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apps/filetypes.c b/apps/filetypes.c index cab9618f36..d7151ca661 100644 --- a/apps/filetypes.c +++ b/apps/filetypes.c @@ -84,7 +84,7 @@ static void scan_plugins(void); void filetype_init(void) { int cnt,i,ix; - struct filetype* ftypes; + const struct filetype* ftypes; memset(exttypes,0,sizeof(exttypes)); memset(filetypes,0,sizeof(filetypes)); diff --git a/apps/recorder/peakmeter.c b/apps/recorder/peakmeter.c index 33d1e25ee7..b069c1566b 100644 --- a/apps/recorder/peakmeter.c +++ b/apps/recorder/peakmeter.c @@ -103,14 +103,14 @@ static unsigned int ticks_per_redraw[TICKS_PER_DRAW_SIZE]; #endif /* time out values for max */ -static long max_time_out[] = { +static const long max_time_out[] = { 0 * HZ, HZ / 5, 30, HZ / 2, HZ, 2 * HZ, 3 * HZ, 4 * HZ, 5 * HZ, 6 * HZ, 7 * HZ, 8 * HZ, 9 * HZ, 10 * HZ, 15 * HZ, 20 * HZ, 30 * HZ, 60 * HZ }; /* time out values for clip */ -static long clip_time_out[] = { +static const long clip_time_out[] = { 0 * HZ, 1 * HZ, 2 * HZ, 3 * HZ, 4 * HZ, 5 * HZ, 6 * HZ, 7 * HZ, 8 * HZ, 9 * HZ, 10 * HZ, 15 * HZ, 20 * HZ, 25 * HZ, 30 * HZ, 45 * HZ, 60 * HZ, 90 * HZ, diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index 242351a0d6..20b5fa016f 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c @@ -56,7 +56,7 @@ bool f3_rec_screen(void); #define SOURCE_LINE 1 #define SOURCE_SPDIF 2 -char *freq_str[6] = +const char* const freq_str[6] = { "44.1kHz", "48kHz", @@ -79,7 +79,7 @@ static void set_gain(void) } } -static char *fmtstr[] = +static const char* const fmtstr[] = { "", /* no decimals */ "%d.%d %s ", /* 1 decimal */ @@ -632,7 +632,7 @@ bool f2_rec_screen(void) lcd_getstringsize("A",&w,&h); while (!exit) { - char* ptr=NULL; + const char* ptr=NULL; lcd_clear_display(); diff --git a/apps/sound_menu.c b/apps/sound_menu.c index 6f62ce2417..bbf1c6c473 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c @@ -35,7 +35,7 @@ #include "talk.h" #include "misc.h" -static char *fmt[] = +static const char* const fmt[] = { "", /* no decimals */ "%d.%d %s ", /* 1 decimal */ diff --git a/apps/talk.c b/apps/talk.c index 51e8ae7f01..1b3dda39ed 100644 --- a/apps/talk.c +++ b/apps/talk.c @@ -38,7 +38,7 @@ extern void bitswap(unsigned char *data, int length); /* no header for this */ #define QUEUE_SIZE 64 /* must be a power of two */ #define QUEUE_MASK (QUEUE_SIZE-1) -const char* dir_thumbnail_name = "_dirname.talk"; +const char* const dir_thumbnail_name = "_dirname.talk"; /***************** Functional Macros *****************/ diff --git a/apps/talk.h b/apps/talk.h index 2476c8ec02..de93b1678c 100644 --- a/apps/talk.h +++ b/apps/talk.h @@ -55,7 +55,7 @@ enum { #define STR(id) ID2P(id), id /* publish this string, so it's stored only once (better than #define) */ -extern const char* dir_thumbnail_name; +extern const char* const dir_thumbnail_name; void talk_init(void); diff --git a/apps/tree.c b/apps/tree.c index 9ce5a9c5f0..017e9877f1 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -70,7 +70,7 @@ extern bool language_changed; /* a table for the know file types */ -struct filetype filetypes[] = { +const struct filetype filetypes[] = { { ".mp3", TREE_ATTR_MPA, File, VOICE_EXT_MPA }, { ".mp2", TREE_ATTR_MPA, File, VOICE_EXT_MPA }, { ".mpa", TREE_ATTR_MPA, File, VOICE_EXT_MPA }, @@ -132,7 +132,7 @@ void browse_root(void) #endif } -void tree_get_filetypes(struct filetype** types, int* count) +void tree_get_filetypes(const struct filetype** types, int* count) { *types = filetypes; *count = sizeof(filetypes) / sizeof(*filetypes); diff --git a/apps/tree.h b/apps/tree.h index 01f3669477..0889b7211e 100644 --- a/apps/tree.h +++ b/apps/tree.h @@ -48,7 +48,7 @@ struct filetype { #define TREE_ATTR_MOD 0x0900 /* firmware file */ #define TREE_ATTR_MASK 0xFFC0 /* which bits tree.c uses (above) */ -void tree_get_filetypes(struct filetype**, int*); +void tree_get_filetypes(const struct filetype**, int*); void tree_init(void); void browse_root(void); void set_current_file(char *path); diff --git a/apps/wps.c b/apps/wps.c index 86ce4b09c1..45aa8235a5 100644 --- a/apps/wps.c +++ b/apps/wps.c @@ -309,7 +309,7 @@ bool browse_id3(void) static bool ffwd_rew(int button) { - static int ff_rew_steps[] = { + static const int ff_rew_steps[] = { 1000, 2000, 3000, 4000, 5000, 6000, 8000, 10000, 15000, 20000, 25000, 30000, -- cgit v1.2.3