diff options
| author | Richard M. Stallman | 1997-05-15 03:22:38 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-15 03:22:38 +0000 |
| commit | 4edca269ccde1781aa4750d0b82f2c252b3fa5b7 (patch) | |
| tree | 0574637390ccf3db5d19b0043a46b128f1710255 /src | |
| parent | 55c4d99f912fc990cfb3bbff985aaa388f8fcd05 (diff) | |
| download | emacs-4edca269ccde1781aa4750d0b82f2c252b3fa5b7.tar.gz emacs-4edca269ccde1781aa4750d0b82f2c252b3fa5b7.zip | |
(compute_trt_identity): Use make_sub_char_table.
(compute_trt_identity, compute_trt_shuffle):
Set up bytes[0] with the charset code.
Check for a sub-char-table when deciding to recurse.
Terminate the loop properly for a sub-char-table.
Diffstat (limited to 'src')
| -rw-r--r-- | src/casetab.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/casetab.c b/src/casetab.c index 4e901cc1cb4..adf871764f6 100644 --- a/src/casetab.c +++ b/src/casetab.c | |||
| @@ -177,21 +177,21 @@ compute_trt_identity (bytes, depth, trt, inverse) | |||
| 177 | struct Lisp_Char_Table *trt, *inverse; | 177 | struct Lisp_Char_Table *trt, *inverse; |
| 178 | { | 178 | { |
| 179 | register int i; | 179 | register int i; |
| 180 | int lim = (depth == 0 ? CHAR_TABLE_ORDINARY_SLOTS : SUB_CHAR_TABLE_ORDINARY_SLOTS); | ||
| 180 | 181 | ||
| 181 | for (i = 0; i < CHAR_TABLE_ORDINARY_SLOTS; i++) | 182 | for (i = 0; i < lim; i++) |
| 182 | { | 183 | { |
| 183 | if (NATNUMP (trt->contents[i])) | 184 | if (NATNUMP (trt->contents[i])) |
| 184 | { | 185 | { |
| 185 | bytes[depth] = i; | 186 | bytes[depth] = i; |
| 186 | XSETFASTINT (inverse->contents[i], | 187 | XSETFASTINT (inverse->contents[i], |
| 187 | (depth == 0 && i < CHAR_TABLE_SINGLE_BYTE_SLOTS ? i | 188 | (depth == 0 && i < CHAR_TABLE_SINGLE_BYTE_SLOTS ? i |
| 188 | : MAKE_NON_ASCII_CHAR (bytes[0]-128, | 189 | : MAKE_NON_ASCII_CHAR (bytes[0], bytes[1], bytes[2]))); |
| 189 | bytes[1], bytes[2]))); | ||
| 190 | } | 190 | } |
| 191 | else if (CHAR_TABLE_P (trt->contents[i])) | 191 | else if (SUB_CHAR_TABLE_P (trt->contents[i])) |
| 192 | { | 192 | { |
| 193 | bytes[depth] = i; | 193 | bytes[depth] = i - 128; |
| 194 | inverse->contents[i] = Fmake_char_table (Qnil, Qnil); | 194 | inverse->contents[i] = make_sub_char_table (Qnil); |
| 195 | compute_trt_identity (bytes, depth + 1, | 195 | compute_trt_identity (bytes, depth + 1, |
| 196 | XCHAR_TABLE (trt->contents[i]), | 196 | XCHAR_TABLE (trt->contents[i]), |
| 197 | XCHAR_TABLE (inverse->contents[i])); | 197 | XCHAR_TABLE (inverse->contents[i])); |
| @@ -210,14 +210,14 @@ compute_trt_shuffle (bytes, depth, ibase, trt, inverse) | |||
| 210 | { | 210 | { |
| 211 | register int i; | 211 | register int i; |
| 212 | Lisp_Object j, tem, q; | 212 | Lisp_Object j, tem, q; |
| 213 | int lim = (depth == 0 ? CHAR_TABLE_ORDINARY_SLOTS : SUB_CHAR_TABLE_ORDINARY_SLOTS); | ||
| 213 | 214 | ||
| 214 | for (i = 0; i < CHAR_TABLE_SINGLE_BYTE_SLOTS; i++) | 215 | for (i = 0; i < lim; i++) |
| 215 | { | 216 | { |
| 216 | bytes[depth] = i; | 217 | bytes[depth] = i; |
| 217 | XSETFASTINT (j, | 218 | XSETFASTINT (j, |
| 218 | (depth == 0 && i < CHAR_TABLE_SINGLE_BYTE_SLOTS ? i | 219 | (depth == 0 && i < CHAR_TABLE_SINGLE_BYTE_SLOTS ? i |
| 219 | : MAKE_NON_ASCII_CHAR (bytes[0]-128, | 220 | : MAKE_NON_ASCII_CHAR (bytes[0], bytes[1], bytes[2]))); |
| 220 | bytes[1], bytes[2]))); | ||
| 221 | q = trt->contents[i]; | 221 | q = trt->contents[i]; |
| 222 | if (NATNUMP (q) && XFASTINT (q) != XFASTINT (j)) | 222 | if (NATNUMP (q) && XFASTINT (q) != XFASTINT (j)) |
| 223 | { | 223 | { |
| @@ -225,9 +225,9 @@ compute_trt_shuffle (bytes, depth, ibase, trt, inverse) | |||
| 225 | Faset (ibase, q, j); | 225 | Faset (ibase, q, j); |
| 226 | Faset (ibase, j, tem); | 226 | Faset (ibase, j, tem); |
| 227 | } | 227 | } |
| 228 | else if (CHAR_TABLE_P (q)) | 228 | else if (SUB_CHAR_TABLE_P (q)) |
| 229 | { | 229 | { |
| 230 | bytes[depth] = i; | 230 | bytes[depth] = i - 128; |
| 231 | compute_trt_shuffle (bytes, depth + 1, ibase, | 231 | compute_trt_shuffle (bytes, depth + 1, ibase, |
| 232 | XCHAR_TABLE (trt->contents[i]), | 232 | XCHAR_TABLE (trt->contents[i]), |
| 233 | XCHAR_TABLE (inverse->contents[i])); | 233 | XCHAR_TABLE (inverse->contents[i])); |