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_cp775.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_cp775.c')
-rw-r--r-- | fs/nls/nls_cp775.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/nls/nls_cp775.c b/fs/nls/nls_cp775.c index c97714c38a90..4905635d1c00 100644 --- a/fs/nls/nls_cp775.c +++ b/fs/nls/nls_cp775.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 | 0x00b3, 0x00b2, 0x25a0, 0x00a0, | 96 | 0x00b3, 0x00b2, 0x25a0, 0x00a0, |
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 */ |
@@ -132,7 +132,7 @@ static unsigned char page00[256] = { | |||
132 | 0x9b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */ | 132 | 0x9b, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, /* 0xf8-0xff */ |
133 | }; | 133 | }; |
134 | 134 | ||
135 | static unsigned char page01[256] = { | 135 | static const unsigned char page01[256] = { |
136 | 0xa0, 0x83, 0x00, 0x00, 0xb5, 0xd0, 0x80, 0x87, /* 0x00-0x07 */ | 136 | 0xa0, 0x83, 0x00, 0x00, 0xb5, 0xd0, 0x80, 0x87, /* 0x00-0x07 */ |
137 | 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd1, 0x00, 0x00, /* 0x08-0x0f */ | 137 | 0x00, 0x00, 0x00, 0x00, 0xb6, 0xd1, 0x00, 0x00, /* 0x08-0x0f */ |
138 | 0x00, 0x00, 0xed, 0x89, 0x00, 0x00, 0xb8, 0xd3, /* 0x10-0x17 */ | 138 | 0x00, 0x00, 0xed, 0x89, 0x00, 0x00, 0xb8, 0xd3, /* 0x10-0x17 */ |
@@ -151,21 +151,21 @@ static unsigned char page01[256] = { | |||
151 | 0x00, 0x8d, 0xa5, 0xa3, 0xa4, 0xcf, 0xd8, 0x00, /* 0x78-0x7f */ | 151 | 0x00, 0x8d, 0xa5, 0xa3, 0xa4, 0xcf, 0xd8, 0x00, /* 0x78-0x7f */ |
152 | }; | 152 | }; |
153 | 153 | ||
154 | static unsigned char page20[256] = { | 154 | static const unsigned char page20[256] = { |
155 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 155 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
156 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 156 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
157 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 157 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
158 | 0x00, 0xef, 0x00, 0x00, 0xf2, 0xa6, 0xf7, 0x00, /* 0x18-0x1f */ | 158 | 0x00, 0xef, 0x00, 0x00, 0xf2, 0xa6, 0xf7, 0x00, /* 0x18-0x1f */ |
159 | }; | 159 | }; |
160 | 160 | ||
161 | static unsigned char page22[256] = { | 161 | static const unsigned char page22[256] = { |
162 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 162 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
163 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 163 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
164 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 164 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
165 | 0x00, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ | 165 | 0x00, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ |
166 | }; | 166 | }; |
167 | 167 | ||
168 | static unsigned char page25[256] = { | 168 | static const unsigned char page25[256] = { |
169 | 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 169 | 0xc4, 0x00, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
170 | 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 170 | 0x00, 0x00, 0x00, 0x00, 0xda, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
171 | 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 171 | 0xbf, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -190,7 +190,7 @@ static unsigned char page25[256] = { | |||
190 | 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ | 190 | 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa0-0xa7 */ |
191 | }; | 191 | }; |
192 | 192 | ||
193 | static unsigned char *page_uni2charset[256] = { | 193 | static const unsigned char *const page_uni2charset[256] = { |
194 | page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, | 194 | page00, page01, NULL, NULL, NULL, NULL, NULL, NULL, |
195 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 195 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
196 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | 196 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
@@ -198,7 +198,7 @@ static unsigned char *page_uni2charset[256] = { | |||
198 | page20, NULL, page22, NULL, NULL, page25, NULL, NULL, | 198 | page20, NULL, page22, NULL, NULL, page25, NULL, NULL, |
199 | }; | 199 | }; |
200 | 200 | ||
201 | static unsigned char charset2lower[256] = { | 201 | static const unsigned char charset2lower[256] = { |
202 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 202 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
203 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 203 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
204 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 204 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -234,7 +234,7 @@ static unsigned char charset2lower[256] = { | |||
234 | 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ | 234 | 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, /* 0xf8-0xff */ |
235 | }; | 235 | }; |
236 | 236 | ||
237 | static unsigned char charset2upper[256] = { | 237 | static const unsigned char charset2upper[256] = { |
238 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 238 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
239 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 239 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
240 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 240 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -272,7 +272,7 @@ static unsigned char charset2upper[256] = { | |||
272 | 272 | ||
273 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) | 273 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) |
274 | { | 274 | { |
275 | unsigned char *uni2charset; | 275 | const unsigned char *uni2charset; |
276 | unsigned char cl = uni & 0x00ff; | 276 | unsigned char cl = uni & 0x00ff; |
277 | unsigned char ch = (uni & 0xff00) >> 8; | 277 | unsigned char ch = (uni & 0xff00) >> 8; |
278 | 278 | ||