Mercurial > emacs
comparison src/data.c @ 17184:caab9110ee07
(Faref, Faset): Adjusted for the change of CHAR_TABLE_ORDINARY_SLOTS.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Tue, 18 Mar 1997 23:31:34 +0000 |
| parents | f03002ec3404 |
| children | a58d6ceeb370 |
comparison
equal
deleted
inserted
replaced
| 17183:00252a78ce4f | 17184:caab9110ee07 |
|---|---|
| 1545 { | 1545 { |
| 1546 Lisp_Object val; | 1546 Lisp_Object val; |
| 1547 | 1547 |
| 1548 if (idxval < 0) | 1548 if (idxval < 0) |
| 1549 args_out_of_range (array, idx); | 1549 args_out_of_range (array, idx); |
| 1550 if (idxval < CHAR_TABLE_ORDINARY_SLOTS) | 1550 if (idxval < CHAR_TABLE_SINGLE_BYTE_SLOTS) |
| 1551 { | 1551 { |
| 1552 /* The element is stored in the top table. We may return a | 1552 /* For ASCII or 8-bit European characters, the element is |
| 1553 deeper char-table. */ | 1553 stored in the top table. */ |
| 1554 val = XCHAR_TABLE (array)->contents[idxval]; | 1554 val = XCHAR_TABLE (array)->contents[idxval]; |
| 1555 if (NILP (val)) | 1555 if (NILP (val)) |
| 1556 val = XCHAR_TABLE (array)->defalt; | 1556 val = XCHAR_TABLE (array)->defalt; |
| 1557 while (NILP (val)) /* Follow parents until we find some value. */ | 1557 while (NILP (val)) /* Follow parents until we find some value. */ |
| 1558 { | 1558 { |
| 1569 { | 1569 { |
| 1570 int idx[3]; /* For charset, code1, and code2. */ | 1570 int idx[3]; /* For charset, code1, and code2. */ |
| 1571 int i, len; | 1571 int i, len; |
| 1572 Lisp_Object sub_array; | 1572 Lisp_Object sub_array; |
| 1573 | 1573 |
| 1574 /* There's no reason to treat a composite character | |
| 1575 specially here. */ | |
| 1576 #if 0 | |
| 1577 if (COMPOSITE_CHAR_P (idxval)) | |
| 1578 /* For a composite characters, we use the first element as | |
| 1579 the index. */ | |
| 1580 idxval = cmpchar_component (idxval, 0); | |
| 1581 #endif | |
| 1582 SPLIT_NON_ASCII_CHAR (idxval, idx[0], idx[1], idx[2]); | 1574 SPLIT_NON_ASCII_CHAR (idxval, idx[0], idx[1], idx[2]); |
| 1583 len = (COMPOSITE_CHAR_P (idxval) || idx[2]) ? 3 : (idx[1] ? 2 : 1); | 1575 len = (COMPOSITE_CHAR_P (idxval) || idx[2]) ? 3 : (idx[1] ? 2 : 1); |
| 1576 /* The top level char-table should be indexed from 256 for | |
| 1577 each non-ASCII charsets. */ | |
| 1578 idx[0] += 128; | |
| 1584 | 1579 |
| 1585 try_parent_char_table: | 1580 try_parent_char_table: |
| 1586 sub_array = array; | 1581 sub_array = array; |
| 1587 for (i = 0; i < len; i++) | 1582 for (i = 0; i < len; i++) |
| 1588 { | 1583 { |
| 1671 { | 1666 { |
| 1672 Lisp_Object val; | 1667 Lisp_Object val; |
| 1673 | 1668 |
| 1674 if (idxval < 0) | 1669 if (idxval < 0) |
| 1675 args_out_of_range (array, idx); | 1670 args_out_of_range (array, idx); |
| 1676 if (idxval < CHAR_TABLE_ORDINARY_SLOTS) | 1671 if (idxval < CHAR_TABLE_SINGLE_BYTE_SLOTS) |
| 1677 XCHAR_TABLE (array)->contents[idxval] = newelt; | 1672 XCHAR_TABLE (array)->contents[idxval] = newelt; |
| 1678 else | 1673 else |
| 1679 { | 1674 { |
| 1680 int idx[3]; /* For charset, code1, and code2. */ | 1675 int idx[3]; /* For charset, code1, and code2. */ |
| 1681 int i, len; | 1676 int i, len; |
| 1682 Lisp_Object val; | 1677 Lisp_Object val; |
| 1683 | 1678 |
| 1684 SPLIT_NON_ASCII_CHAR (idxval, idx[0], idx[1], idx[2]); | 1679 SPLIT_NON_ASCII_CHAR (idxval, idx[0], idx[1], idx[2]); |
| 1685 len = (COMPOSITE_CHAR_P (idxval) || idx[2]) ? 2 : (idx[1] ? 1 : 0); | 1680 len = (COMPOSITE_CHAR_P (idxval) || idx[2]) ? 2 : (idx[1] ? 1 : 0); |
| 1681 /* The top level char-table should be indexed from 256 for | |
| 1682 each non-ASCII charsets. */ | |
| 1683 idx[0] += 128; | |
| 1686 | 1684 |
| 1687 for (i = 0; i < len; i++) | 1685 for (i = 0; i < len; i++) |
| 1688 { | 1686 { |
| 1689 val = XCHAR_TABLE (array)->contents[idx[i]]; | 1687 val = XCHAR_TABLE (array)->contents[idx[i]]; |
| 1690 if (CHAR_TABLE_P (val)) | 1688 if (CHAR_TABLE_P (val)) |
