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_cp1255.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_cp1255.c')
-rw-r--r-- | fs/nls/nls_cp1255.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/nls/nls_cp1255.c b/fs/nls/nls_cp1255.c index e57f2cbf5bc0..8120ae2e091a 100644 --- a/fs/nls/nls_cp1255.c +++ b/fs/nls/nls_cp1255.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 | 0x0000, 0x0000, 0x0000, 0x0000, | 94 | 0x0000, 0x0000, 0x0000, 0x0000, |
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, 0xba, /* 0xf0-0xf7 */ | 129 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, /* 0xf0-0xf7 */ |
130 | }; | 130 | }; |
131 | 131 | ||
132 | static unsigned char page01[256] = { | 132 | static const unsigned char page01[256] = { |
133 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 133 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 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 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 135 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -152,7 +152,7 @@ static unsigned char page01[256] = { | |||
152 | 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ | 152 | 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x90-0x97 */ |
153 | }; | 153 | }; |
154 | 154 | ||
155 | static unsigned char page02[256] = { | 155 | static const unsigned char page02[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 */ |
@@ -184,7 +184,7 @@ static unsigned char page02[256] = { | |||
184 | 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ | 184 | 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, /* 0xd8-0xdf */ |
185 | }; | 185 | }; |
186 | 186 | ||
187 | static unsigned char page05[256] = { | 187 | static const unsigned char page05[256] = { |
188 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 188 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
189 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 189 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
190 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 190 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -219,7 +219,7 @@ static unsigned char page05[256] = { | |||
219 | 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ | 219 | 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ |
220 | }; | 220 | }; |
221 | 221 | ||
222 | static unsigned char page20[256] = { | 222 | static const unsigned char page20[256] = { |
223 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 223 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
224 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xfe, /* 0x08-0x0f */ | 224 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfd, 0xfe, /* 0x08-0x0f */ |
225 | 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 225 | 0x00, 0x00, 0x00, 0x96, 0x97, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -245,7 +245,7 @@ static unsigned char page20[256] = { | |||
245 | 0x00, 0x00, 0xa4, 0x00, 0x80, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ | 245 | 0x00, 0x00, 0xa4, 0x00, 0x80, 0x00, 0x00, 0x00, /* 0xa8-0xaf */ |
246 | }; | 246 | }; |
247 | 247 | ||
248 | static unsigned char page21[256] = { | 248 | static const unsigned char page21[256] = { |
249 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 249 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
250 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 250 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
251 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x00, /* 0x10-0x17 */ | 251 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb9, 0x00, /* 0x10-0x17 */ |
@@ -253,7 +253,7 @@ static unsigned char page21[256] = { | |||
253 | 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ | 253 | 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ |
254 | }; | 254 | }; |
255 | 255 | ||
256 | static unsigned char *page_uni2charset[256] = { | 256 | static const unsigned char *const page_uni2charset[256] = { |
257 | page00, page01, page02, NULL, NULL, page05, NULL, NULL, | 257 | page00, page01, page02, NULL, NULL, page05, NULL, NULL, |
258 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 258 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
259 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 259 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
@@ -261,7 +261,7 @@ static unsigned char *page_uni2charset[256] = { | |||
261 | page20, page21, NULL, NULL, NULL, NULL, NULL, NULL, | 261 | page20, page21, NULL, NULL, NULL, NULL, NULL, NULL, |
262 | }; | 262 | }; |
263 | 263 | ||
264 | static unsigned char charset2lower[256] = { | 264 | static const unsigned char charset2lower[256] = { |
265 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 265 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
266 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 266 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
267 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 267 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -297,7 +297,7 @@ static unsigned char charset2lower[256] = { | |||
297 | 0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ | 297 | 0xf8, 0xf9, 0xfa, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ |
298 | }; | 298 | }; |
299 | 299 | ||
300 | static unsigned char charset2upper[256] = { | 300 | static const unsigned char charset2upper[256] = { |
301 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 301 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
302 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 302 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
303 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 303 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -335,7 +335,7 @@ static unsigned char charset2upper[256] = { | |||
335 | 335 | ||
336 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) | 336 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) |
337 | { | 337 | { |
338 | unsigned char *uni2charset; | 338 | const unsigned char *uni2charset; |
339 | unsigned char cl = uni & 0x00ff; | 339 | unsigned char cl = uni & 0x00ff; |
340 | unsigned char ch = (uni & 0xff00) >> 8; | 340 | unsigned char ch = (uni & 0xff00) >> 8; |
341 | 341 | ||