Commit 79f5556a authored by Paul Eggert's avatar Paul Eggert
Browse files

Merge: Fixes for Bug#8600 and Bug#8601.

parents 48e400f0 2f9442b8
2011-05-02 Paul Eggert <eggert@cs.ucla.edu>
2011-05-03 Paul Eggert <eggert@cs.ucla.edu>
* coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
* 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 (Bug#8600).
* lread.c (read_integer): Be more consistent with string-to-number.
Use string_to_number to do the actual conversion; this avoids
......@@ -8,8 +15,6 @@
Return -1 if the digit is out of range for the base, -2 if it is
not a digit in any supported base. (Bug#8602)
2011-04-30 Paul Eggert <eggert@cs.ucla.edu>
* doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
* dispnew.c (scrolling_window): Return 1 if we scrolled,
......
......@@ -869,7 +869,7 @@ usage: (define-charset-internal ...) */)
ASET (attrs, charset_name, args[charset_arg_name]);
val = args[charset_arg_code_space];
for (i = 0, dimension = 0, nchars = 1; i < 4; i++)
for (i = 0, dimension = 0, nchars = 1; ; i++)
{
int min_byte, max_byte;
......@@ -880,10 +880,12 @@ usage: (define-charset-internal ...) */)
charset.code_space[i * 4] = min_byte;
charset.code_space[i * 4 + 1] = max_byte;
charset.code_space[i * 4 + 2] = max_byte - min_byte + 1;
nchars *= charset.code_space[i * 4 + 2];
charset.code_space[i * 4 + 3] = nchars;
if (max_byte > 0)
dimension = i + 1;
if (i == 3)
break;
nchars *= charset.code_space[i * 4 + 2];
charset.code_space[i * 4 + 3] = nchars;
}
val = args[charset_arg_dimension];
......
......@@ -155,10 +155,11 @@ struct charset
byte code of the (N+1)th dimension, <code_space>[4N+1] is a
maximum byte code of the (N+1)th dimension, <code_space>[4N+2] is
(<code_space>[4N+1] - <code_space>[4N] + 1), <code_space>[4N+3]
is a number of characters containd in the first to (N+1)th
dismesions. We get `char-index' of a `code-point' from this
is the number of characters contained in the first through (N+1)th
dimensions, except that there is no <code_space>[15].
We get `char-index' of a `code-point' from this
information. */
int code_space[16];
int code_space[15];
/* If B is a byte of Nth dimension of a code-point, the (N-1)th bit
of code_space_mask[B] is set. This array is used to quickly
......
......@@ -5368,8 +5368,8 @@ detect_coding_charset (struct coding_system *coding,
if (src == src_end)
goto too_short;
ONE_MORE_BYTE (c);
if (c < charset->code_space[(dim - 1 - idx) * 2]
|| c > charset->code_space[(dim - 1 - idx) * 2 + 1])
if (c < charset->code_space[(dim - 1 - idx) * 4]
|| c > charset->code_space[(dim - 1 - idx) * 4 + 1])
break;
}
if (idx < dim)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment