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_iso8859-6.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_iso8859-6.c')
-rw-r--r-- | fs/nls/nls_iso8859-6.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/nls/nls_iso8859-6.c b/fs/nls/nls_iso8859-6.c index 8cec03d66088..01a517d6d306 100644 --- a/fs/nls/nls_iso8859-6.c +++ b/fs/nls/nls_iso8859-6.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 | 0x0000, 0x0000, 0x0000, 0x0000, | 96 | 0x0000, 0x0000, 0x0000, 0x0000, |
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 */ |
@@ -122,7 +122,7 @@ static unsigned char page00[256] = { | |||
122 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ | 122 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x00, 0x00, /* 0xa8-0xaf */ |
123 | }; | 123 | }; |
124 | 124 | ||
125 | static unsigned char page06[256] = { | 125 | static const unsigned char page06[256] = { |
126 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ | 126 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ |
127 | 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */ | 127 | 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, /* 0x08-0x0f */ |
128 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ | 128 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ |
@@ -139,11 +139,11 @@ static unsigned char page06[256] = { | |||
139 | 0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ | 139 | 0x38, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ |
140 | }; | 140 | }; |
141 | 141 | ||
142 | static unsigned char *page_uni2charset[256] = { | 142 | static const unsigned char *const page_uni2charset[256] = { |
143 | page00, NULL, NULL, NULL, NULL, NULL, page06, NULL, | 143 | page00, NULL, NULL, NULL, NULL, NULL, page06, NULL, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | static unsigned char charset2lower[256] = { | 146 | static const unsigned char charset2lower[256] = { |
147 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 147 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
148 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 148 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
149 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 149 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -179,7 +179,7 @@ static unsigned char charset2lower[256] = { | |||
179 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ | 179 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xf8-0xff */ |
180 | }; | 180 | }; |
181 | 181 | ||
182 | static unsigned char charset2upper[256] = { | 182 | static const unsigned char charset2upper[256] = { |
183 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ | 183 | 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, /* 0x00-0x07 */ |
184 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ | 184 | 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, /* 0x08-0x0f */ |
185 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ | 185 | 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, /* 0x10-0x17 */ |
@@ -216,7 +216,7 @@ static unsigned char charset2upper[256] = { | |||
216 | 216 | ||
217 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) | 217 | static int uni2char(wchar_t uni, unsigned char *out, int boundlen) |
218 | { | 218 | { |
219 | unsigned char *uni2charset; | 219 | const unsigned char *uni2charset; |
220 | unsigned char cl = uni & 0x00ff; | 220 | unsigned char cl = uni & 0x00ff; |
221 | unsigned char ch = (uni & 0xff00) >> 8; | 221 | unsigned char ch = (uni & 0xff00) >> 8; |
222 | 222 | ||