diff options
author | Boris Gjenero <dreamlayers@rockbox.org> | 2011-12-17 18:31:55 +0000 |
---|---|---|
committer | Boris Gjenero <dreamlayers@rockbox.org> | 2011-12-17 18:31:55 +0000 |
commit | 17ed3253fc98bcca59d70531a4d81b3be75dc7ea (patch) | |
tree | 9d1eee2029f442b207dcbb8ea1f75059e96b7d96 | |
parent | f372212adf279d12c88d6bde948d11cf3ad002b3 (diff) | |
download | rockbox-17ed3253fc98bcca59d70531a4d81b3be75dc7ea.tar.gz rockbox-17ed3253fc98bcca59d70531a4d81b3be75dc7ea.zip |
Add const to global pointers to strings.
When a global pointer is not declared as constant, gcc will put it in
memory. Getting the address of the string it points to requires loading
the address of the pointer and then loading the pointer. When the pointer
is declared constant, the address of the string is loaded directly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31345 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/metadata/wave.c | 5 | ||||
-rw-r--r-- | apps/recorder/keyboard.c | 2 | ||||
-rw-r--r-- | apps/tagcache.c | 8 | ||||
-rw-r--r-- | firmware/target/arm/imx31/mc13783-imx31.c | 2 |
4 files changed, 9 insertions, 8 deletions
diff --git a/apps/metadata/wave.c b/apps/metadata/wave.c index 93c4d8309c..45acea1fa1 100644 --- a/apps/metadata/wave.c +++ b/apps/metadata/wave.c | |||
@@ -62,7 +62,8 @@ enum { | |||
62 | #define WAVE_CHUNKNAME_LENGTH 4 | 62 | #define WAVE_CHUNKNAME_LENGTH 4 |
63 | #define WAVE_CHUNKSIZE_LENGTH 4 | 63 | #define WAVE_CHUNKSIZE_LENGTH 4 |
64 | 64 | ||
65 | static const unsigned char *wave_chunklist = "RIFF" | 65 | static const unsigned char * const wave_chunklist |
66 | = "RIFF" | ||
66 | "WAVE" | 67 | "WAVE" |
67 | "fmt " | 68 | "fmt " |
68 | "fact" | 69 | "fact" |
@@ -73,7 +74,7 @@ static const unsigned char *wave_chunklist = "RIFF" | |||
73 | #define WAVE64_CHUNKNAME_LENGTH 16 | 74 | #define WAVE64_CHUNKNAME_LENGTH 16 |
74 | #define WAVE64_CHUNKSIZE_LENGTH 8 | 75 | #define WAVE64_CHUNKSIZE_LENGTH 8 |
75 | 76 | ||
76 | static const unsigned char *wave64_chunklist | 77 | static const unsigned char * const wave64_chunklist |
77 | = "riff\x2e\x91\xcf\x11\xa5\xd6\x28\xdb\x04\xc1\x00\x00" | 78 | = "riff\x2e\x91\xcf\x11\xa5\xd6\x28\xdb\x04\xc1\x00\x00" |
78 | "wave\xf3\xac\xd3\x11\x8c\xd1\x00\xc0\x4f\x8e\xdb\x8a" | 79 | "wave\xf3\xac\xd3\x11\x8c\xd1\x00\xc0\x4f\x8e\xdb\x8a" |
79 | "fmt \xf3\xac\xd3\x11\x8c\xd1\x00\xc0\x4f\x8e\xdb\x8a" | 80 | "fmt \xf3\xac\xd3\x11\x8c\xd1\x00\xc0\x4f\x8e\xdb\x8a" |
diff --git a/apps/recorder/keyboard.c b/apps/recorder/keyboard.c index d6fd847f08..a6c015aebf 100644 --- a/apps/recorder/keyboard.c +++ b/apps/recorder/keyboard.c | |||
@@ -130,7 +130,7 @@ static bool kbd_loaded = false; | |||
130 | 130 | ||
131 | #ifdef HAVE_MORSE_INPUT | 131 | #ifdef HAVE_MORSE_INPUT |
132 | /* FIXME: We should put this to a configuration file. */ | 132 | /* FIXME: We should put this to a configuration file. */ |
133 | static const char *morse_alphabets = | 133 | static const char * const morse_alphabets = |
134 | "abcdefghijklmnopqrstuvwxyz1234567890,.?-@ "; | 134 | "abcdefghijklmnopqrstuvwxyz1234567890,.?-@ "; |
135 | static const unsigned char morse_codes[] = { | 135 | static const unsigned char morse_codes[] = { |
136 | 0x05,0x18,0x1a,0x0c,0x02,0x12,0x0e,0x10,0x04,0x17,0x0d,0x14,0x07, | 136 | 0x05,0x18,0x1a,0x0c,0x02,0x12,0x0e,0x10,0x04,0x17,0x0d,0x14,0x07, |
diff --git a/apps/tagcache.c b/apps/tagcache.c index 99ef3f5587..ef642b1e3c 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c | |||
@@ -192,14 +192,14 @@ struct master_header { | |||
192 | }; | 192 | }; |
193 | 193 | ||
194 | /* For the endianess correction */ | 194 | /* For the endianess correction */ |
195 | static const char *tagfile_entry_ec = "ll"; | 195 | static const char * const tagfile_entry_ec = "ll"; |
196 | /** | 196 | /** |
197 | Note: This should be (1 + TAG_COUNT) amount of l's. | 197 | Note: This should be (1 + TAG_COUNT) amount of l's. |
198 | */ | 198 | */ |
199 | static const char *index_entry_ec = "llllllllllllllllllllll"; | 199 | static const char * const index_entry_ec = "llllllllllllllllllllll"; |
200 | 200 | ||
201 | static const char *tagcache_header_ec = "lll"; | 201 | static const char * const tagcache_header_ec = "lll"; |
202 | static const char *master_header_ec = "llllll"; | 202 | static const char * const master_header_ec = "llllll"; |
203 | 203 | ||
204 | static struct master_header current_tcmh; | 204 | static struct master_header current_tcmh; |
205 | 205 | ||
diff --git a/firmware/target/arm/imx31/mc13783-imx31.c b/firmware/target/arm/imx31/mc13783-imx31.c index 006b065ea5..094fbaa58b 100644 --- a/firmware/target/arm/imx31/mc13783-imx31.c +++ b/firmware/target/arm/imx31/mc13783-imx31.c | |||
@@ -31,7 +31,7 @@ extern struct spi_node mc13783_spi; | |||
31 | 31 | ||
32 | /* PMIC event service data */ | 32 | /* PMIC event service data */ |
33 | static int mc13783_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)]; | 33 | static int mc13783_thread_stack[DEFAULT_STACK_SIZE/sizeof(int)]; |
34 | static const char *mc13783_thread_name = "pmic"; | 34 | static const char * const mc13783_thread_name = "pmic"; |
35 | static struct semaphore mc13783_svc_wake; | 35 | static struct semaphore mc13783_svc_wake; |
36 | 36 | ||
37 | /* Synchronous thread communication objects */ | 37 | /* Synchronous thread communication objects */ |