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-r.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-r.c')
-rw-r--r-- | fs/nls/nls_koi8-r.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/nls/nls_koi8-r.c b/fs/nls/nls_koi8-r.c index fefbe0807265..43875310540d 100644 --- a/fs/nls/nls_koi8-r.c +++ b/fs/nls/nls_koi8-r.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/nls.h> | 13 | #include <linux/nls.h> |
14 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
15 | 15 | ||
16 | static wchar_t charset2uni[256] = { | 16 | static const wchar_t charset2uni[256] = { |
17 | /* 0x00*/ | 17 | /* 0x00*/ |
18 | 0x0000, 0x0001, 0x0002, 0x0003, | 18 | 0x0000, 0x0001, 0x0002, 0x0003, |
19 | 0x0004, 0x0005, 0x0006, 0x0007, | 19 | 0x0004, 0x0005, 0x0006, 0x0007, |
@@ -96,7 +96,7 @@ static wchar_t charset2uni[256] = { | |||
96 | 0x042d, 0x0429, 0x0427, 0x042a, | 96 | 0x042d, 0x0429, 0x0427, 0x042a, |
97 | }; | 97 | }; |
98 | 98 | ||
99 | static unsigned char page00[256] = { | 99 | static const unsigned char page00[256] = { |
100 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 100 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
101 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 101 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
102 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 102 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -131,7 +131,7 @@ static unsigned char page00[256] = { | |||
131 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */ | 131 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, /* 0xf0-0xf7 */ |
132 | }; | 132 | }; |
133 | 133 | ||
134 | static unsigned char page04[256] = { | 134 | static const unsigned char page04[256] = { |
135 | 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 135 | 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
136 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 136 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
137 | 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */ | 137 | 0xe1, 0xe2, 0xf7, 0xe7, 0xe4, 0xe5, 0xf6, 0xfa, /* 0x10-0x17 */ |
@@ -145,7 +145,7 @@ static unsigned char page04[256] = { | |||
145 | 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ | 145 | 0x00, 0xa3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x50-0x57 */ |
146 | }; | 146 | }; |
147 | 147 | ||
148 | static unsigned char page22[256] = { | 148 | static const unsigned char page22[256] = { |
149 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 149 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
150 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 150 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
151 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 151 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -161,7 +161,7 @@ static unsigned char page22[256] = { | |||
161 | 0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */ | 161 | 0x00, 0x00, 0x00, 0x00, 0x98, 0x99, 0x00, 0x00, /* 0x60-0x67 */ |
162 | }; | 162 | }; |
163 | 163 | ||
164 | static unsigned char page23[256] = { | 164 | static const unsigned char page23[256] = { |
165 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 165 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
166 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 166 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
167 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 167 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -169,7 +169,7 @@ static unsigned char page23[256] = { | |||
169 | 0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ | 169 | 0x93, 0x9b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ |
170 | }; | 170 | }; |
171 | 171 | ||
172 | static unsigned char page25[256] = { | 172 | static const unsigned char page25[256] = { |
173 | 0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 173 | 0x80, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
174 | 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 174 | 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
175 | 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 175 | 0x83, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -194,7 +194,7 @@ static unsigned char page25[256] = { | |||
194 | 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ | 194 | 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ |
195 | }; | 195 | }; |
196 | 196 | ||
197 | static unsigned char *page_uni2charset[256] = { | 197 | static const unsigned char *const page_uni2charset[256] = { |
198 | page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, | 198 | page00, NULL, NULL, NULL, page04, NULL, NULL, NULL, |
199 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 199 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
200 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 200 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
@@ -202,7 +202,7 @@ static unsigned char *page_uni2charset[256] = { | |||
202 | NULL, NULL, page22, page23, NULL, page25, NULL, NULL, | 202 | NULL, NULL, page22, page23, NULL, page25, NULL, NULL, |
203 | }; | 203 | }; |
204 | 204 | ||
205 | static unsigned char charset2lower[256] = { | 205 | static const unsigned char charset2lower[256] = { |
206 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 206 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
207 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 207 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
208 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 208 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -238,7 +238,7 @@ static unsigned char charset2lower[256] = { | |||
238 | 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xf8-0xff */ | 238 | 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf, /* 0xf8-0xff */ |
239 | }; | 239 | }; |
240 | 240 | ||
241 | static unsigned char charset2upper[256] = { | 241 | static const unsigned char charset2upper[256] = { |
242 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 242 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
243 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 243 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
244 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 244 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -276,7 +276,7 @@ static unsigned char charset2upper[256] = { | |||
276 | 276 | ||
277 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) | 277 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) |
278 | { | 278 | { |
279 | unsigned char *uni2charset; | 279 | const unsigned char *uni2charset; |
280 | unsigned char cl = uni & 0x00ff; | 280 | unsigned char cl = uni & 0x00ff; |
281 | unsigned char ch = (uni & 0xff00) >> 8; | 281 | unsigned char ch = (uni & 0xff00) >> 8; |
282 | 282 | ||