aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-05-02 22:46:00 -0700
committerPaul Eggert2011-05-02 22:46:00 -0700
commit79f5556a7a75ed21c4fafa04f02adb81822a57f9 (patch)
treea614d9543bb0509274564217a633aac3cb273421 /src
parent48e400f07d5a37b8ab7a75f758b61fb6440cedd8 (diff)
parent2f9442b848594799dd155d455930215df2d2a222 (diff)
downloademacs-79f5556a7a75ed21c4fafa04f02adb81822a57f9.tar.gz
emacs-79f5556a7a75ed21c4fafa04f02adb81822a57f9.zip
Merge: Fixes for Bug#8600 and Bug#8601.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/charset.c8
-rw-r--r--src/charset.h7
-rw-r--r--src/coding.c4
4 files changed, 19 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 3013418afec..75917224ca9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,4 +1,11 @@
12011-05-02 Paul Eggert <eggert@cs.ucla.edu> 12011-05-03 Paul Eggert <eggert@cs.ucla.edu>
2
3 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
4
5 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
6 * charset.c (Fdefine_charset_internal): Don't initialize
7 charset.code_space[15]. The value was garbage, on hosts with
8 32-bit int (Bug#8600).
2 9
3 * lread.c (read_integer): Be more consistent with string-to-number. 10 * lread.c (read_integer): Be more consistent with string-to-number.
4 Use string_to_number to do the actual conversion; this avoids 11 Use string_to_number to do the actual conversion; this avoids
@@ -8,8 +15,6 @@
8 Return -1 if the digit is out of range for the base, -2 if it is 15 Return -1 if the digit is out of range for the base, -2 if it is
9 not a digit in any supported base. (Bug#8602) 16 not a digit in any supported base. (Bug#8602)
10 17
112011-04-30 Paul Eggert <eggert@cs.ucla.edu>
12
13 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64". 18 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
14 19
15 * dispnew.c (scrolling_window): Return 1 if we scrolled, 20 * dispnew.c (scrolling_window): Return 1 if we scrolled,
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
diff --git a/src/coding.c b/src/coding.c
index d17346efdcb..71253df6469 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -5368,8 +5368,8 @@ detect_coding_charset (struct coding_system *coding,
5368 if (src == src_end) 5368 if (src == src_end)
5369 goto too_short; 5369 goto too_short;
5370 ONE_MORE_BYTE (c); 5370 ONE_MORE_BYTE (c);
5371 if (c < charset->code_space[(dim - 1 - idx) * 2] 5371 if (c < charset->code_space[(dim - 1 - idx) * 4]
5372 || c > charset->code_space[(dim - 1 - idx) * 2 + 1]) 5372 || c > charset->code_space[(dim - 1 - idx) * 4 + 1])
5373 break; 5373 break;
5374 } 5374 }
5375 if (idx < dim) 5375 if (idx < dim)