aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-05-01 09:27:34 -0700
committerPaul Eggert2011-05-01 09:27:34 -0700
commitc032b5f8c03c4cd94239074dc9fd682bc3e2f3a1 (patch)
tree6d1b248dd9e9d8845d84f9647a5aeb508c3b29c9 /src
parentdcb79f208ab9e2e1e8e0d4e9810ca25c1a660eaf (diff)
downloademacs-c032b5f8c03c4cd94239074dc9fd682bc3e2f3a1.tar.gz
emacs-c032b5f8c03c4cd94239074dc9fd682bc3e2f3a1.zip
* charset.h (struct charset.code_space): Now has 15 elements, not 16.
* charset.c (Fdefine_charset_internal): Don't initialize charset.code_space[15]. The value was garbage, on hosts with 32-bit int.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/charset.c8
-rw-r--r--src/charset.h7
3 files changed, 16 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7b54b1e521c..93af816947c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
12011-05-01 Paul Eggert <eggert@cs.ucla.edu>
2
3 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
4 * charset.c (Fdefine_charset_internal): Don't initialize
5 charset.code_space[15]. The value was garbage, on hosts with
6 32-bit int.
7
12011-04-30 Eli Zaretskii <eliz@gnu.org> 82011-04-30 Eli Zaretskii <eliz@gnu.org>
2 9
3 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)' 10 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
diff --git a/src/charset.c b/src/charset.c
index 52c2ebdcc4e..55fd57031ac 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -869,7 +869,7 @@ usage: (define-charset-internal ...) */)
869 ASET (attrs, charset_name, args[charset_arg_name]); 869 ASET (attrs, charset_name, args[charset_arg_name]);
870 870
871 val = args[charset_arg_code_space]; 871 val = args[charset_arg_code_space];
872 for (i = 0, dimension = 0, nchars = 1; i < 4; i++) 872 for (i = 0, dimension = 0, nchars = 1; ; i++)
873 { 873 {
874 int min_byte, max_byte; 874 int min_byte, max_byte;
875 875
@@ -880,10 +880,12 @@ usage: (define-charset-internal ...) */)
880 charset.code_space[i * 4] = min_byte; 880 charset.code_space[i * 4] = min_byte;
881 charset.code_space[i * 4 + 1] = max_byte; 881 charset.code_space[i * 4 + 1] = max_byte;
882 charset.code_space[i * 4 + 2] = max_byte - min_byte + 1; 882 charset.code_space[i * 4 + 2] = max_byte - min_byte + 1;
883 nchars *= charset.code_space[i * 4 + 2];
884 charset.code_space[i * 4 + 3] = nchars;
885 if (max_byte > 0) 883 if (max_byte > 0)
886 dimension = i + 1; 884 dimension = i + 1;
885 if (i == 3)
886 break;
887 nchars *= charset.code_space[i * 4 + 2];
888 charset.code_space[i * 4 + 3] = nchars;
887 } 889 }
888 890
889 val = args[charset_arg_dimension]; 891 val = args[charset_arg_dimension];
diff --git a/src/charset.h b/src/charset.h
index 74d55a31b43..53784bf8455 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -155,10 +155,11 @@ struct charset
155 byte code of the (N+1)th dimension, <code_space>[4N+1] is a 155 byte code of the (N+1)th dimension, <code_space>[4N+1] is a
156 maximum byte code of the (N+1)th dimension, <code_space>[4N+2] is 156 maximum byte code of the (N+1)th dimension, <code_space>[4N+2] is
157 (<code_space>[4N+1] - <code_space>[4N] + 1), <code_space>[4N+3] 157 (<code_space>[4N+1] - <code_space>[4N] + 1), <code_space>[4N+3]
158 is a number of characters containd in the first to (N+1)th 158 is the number of characters contained in the first through (N+1)th
159 dismesions. We get `char-index' of a `code-point' from this 159 dimensions, except that there is no <code_space>[15].
160 We get `char-index' of a `code-point' from this
160 information. */ 161 information. */
161 int code_space[16]; 162 int code_space[15];
162 163
163 /* If B is a byte of Nth dimension of a code-point, the (N-1)th bit 164 /* If B is a byte of Nth dimension of a code-point, the (N-1)th bit
164 of code_space_mask[B] is set. This array is used to quickly 165 of code_space_mask[B] is set. This array is used to quickly