diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2007-10-17 02:29:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 11:42:58 -0400 |
commit | b9ec0339d8e22cadf2d9d1b010b51dc53837dfb0 (patch) | |
tree | e7d05e78a68eecc00e656e7e4fdf518967826381 /fs/nls/nls_koi8-u.c | |
parent | 37c42524d6090644206ae6d310d7e830bd3ccb47 (diff) |
add consts where appropriate in fs/nls/*
Add const modifiers to a few struct nls_table's member pointers in
include/linux/nls.h and adds a lot of const's in fs/nls/*.c files.
Resulting changes as visible by size:
text data bss dec hex filename
113612 481216 2368 597196 91ccc nls.org/built-in.o
593548 3296 288 597132 91c8c nls/built-in.o
Apparently compiler managed to optimize code a bit better
because of const-ness.
No other changes are made.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nls/nls_koi8-u.c')
-rw-r--r-- | fs/nls/nls_koi8-u.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/nls/nls_koi8-u.c b/fs/nls/nls_koi8-u.c index 015070211f22..8c9f0292b5ae 100644 --- a/fs/nls/nls_koi8-u.c +++ b/fs/nls/nls_koi8-u.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/nls.h> | 11 | #include <linux/nls.h> |
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | 13 | ||
14 | static wchar_t charset2uni[256] = { | 14 | static const wchar_t charset2uni[256] = { |
15 | /* 0x00*/ | 15 | /* 0x00*/ |
16 | 0x0000, 0x0001, 0x0002, 0x0003, | 16 | 0x0000, 0x0001, 0x0002, 0x0003, |
17 | 0x0004, 0x0005, 0x0006, 0x0007, | 17 | 0x0004, 0x0005, 0x0006, 0x0007, |
@@ -94,7 +94,7 @@ static wchar_t charset2uni[256] = { | |||
94 | 0x042d, 0x0429, 0x0427, 0x042a, | 94 | 0x042d, 0x0429, 0x0427, 0x042a, |
95 | }; | 95 | }; |
96 | 96 | ||
97 | static unsigned char page00[256] = { | 97 | static const unsigned char page00[256] = { |
98 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 98 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
99 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 99 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
100 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 100 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -129,7 +129,7 @@ static unsigned char page00[256] = { | |||
129 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */ | 129 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */ |
130 | }; | 130 | }; |
131 | 131 | ||
132 | static unsigned char page04[256] = { | 132 | static const unsigned char page04[256] = { |
133 | 0x00, 0xb3, 0x00, 0x00, 0xb4, 0x00, 0xb6, 0xb7, /* 0x00-0x07 */ | 133 | 0x00, 0xb3, 0x00, 0x00, 0xb4, 0x00, 0xb6, 0xb7, /* 0x00-0x07 */ |
134 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 134 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
135 | 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */ | 135 | 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */ |
@@ -152,7 +152,7 @@ static unsigned char page04[256] = { | |||
152 | 0xbd, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ | 152 | 0xbd, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static unsigned char page22[256] = { | 155 | static const unsigned char page22[256] = { |
156 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 156 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
157 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 157 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
158 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 158 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -168,7 +168,7 @@ static unsigned char page22[256] = { | |||
168 | 0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */ | 168 | 0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */ |
169 | }; | 169 | }; |
170 | 170 | ||
171 | static unsigned char page23[256] = { | 171 | static const unsigned char page23[256] = { |
172 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 172 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
173 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 173 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
174 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 174 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -176,7 +176,7 @@ static unsigned char page23[256] = { | |||
176 | 0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ | 176 | 0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ |
177 | }; | 177 | }; |
178 | 178 | ||
179 | static unsigned char page25[256] = { | 179 | static const unsigned char page25[256] = { |
180 | 0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 180 | 0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
181 | 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 181 | 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
182 | 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 182 | 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -201,7 +201,7 @@ static unsigned char page25[256] = { | |||
201 | 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ | 201 | 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ |
202 | }; | 202 | }; |
203 | 203 | ||
204 | static unsigned char *page_uni2charset[256] = { | 204 | static const unsigned char *const page_uni2charset[256] = { |
205 | page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, | 205 | page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, |
206 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 206 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
207 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 207 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
@@ -209,7 +209,7 @@ static unsigned char *page_uni2charset[256] = { | |||
209 | NULL, NULL, page22, page23, NULL, page25, NULL, NULL, | 209 | NULL, NULL, page22, page23, NULL, page25, NULL, NULL, |
210 | }; | 210 | }; |
211 | 211 | ||
212 | static unsigned char charset2lower[256] = { | 212 | static const unsigned char charset2lower[256] = { |
213 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 213 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
214 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 214 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
215 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 215 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -245,7 +245,7 @@ static unsigned char charset2lower[256] = { | |||
245 | 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xf8-0xff */ | 245 | 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xf8-0xff */ |
246 | }; | 246 | }; |
247 | 247 | ||
248 | static unsigned char charset2upper[256] = { | 248 | static const unsigned char charset2upper[256] = { |
249 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 249 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
250 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 250 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
251 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 251 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -283,7 +283,7 @@ static unsigned char charset2upper[256] = { | |||
283 | 283 | ||
284 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) | 284 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) |
285 | { | 285 | { |
286 | unsigned char *uni2charset; | 286 | const unsigned char *uni2charset; |
287 | unsigned char cl = uni & 0x00ff; | 287 | unsigned char cl = uni & 0x00ff; |
288 | unsigned char ch = (uni & 0xff00) >> 8; | 288 | unsigned char ch = (uni & 0xff00) >> 8; |
289 | 289 | ||