Mercurial > emacs
comparison src/fns.c @ 17291:b66473f0d0fe
(Fcopy_sequence): Delete unused variable.
(Fchar_table_extra_slot, Fset_char_table_extra_slot): Doc fix.
(map_char_table): When expanding indices, don't increase depth;
that's amount used, not amount allocated.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 03 Apr 1997 22:08:30 +0000 |
parents | 47bfc66eb7f1 |
children | 224e100b393c |
comparison
equal
deleted
inserted
replaced
17290:dd1ead861e95 | 17291:b66473f0d0fe |
---|---|
302 { | 302 { |
303 if (NILP (arg)) return arg; | 303 if (NILP (arg)) return arg; |
304 | 304 |
305 if (CHAR_TABLE_P (arg)) | 305 if (CHAR_TABLE_P (arg)) |
306 { | 306 { |
307 int i, size; | 307 int i; |
308 Lisp_Object copy; | 308 Lisp_Object copy; |
309 | 309 |
310 /* Calculate the number of extra slots. */ | |
311 size = CHAR_TABLE_EXTRA_SLOTS (XCHAR_TABLE (arg)); | |
312 copy = Fmake_char_table (XCHAR_TABLE (arg)->purpose, Qnil); | 310 copy = Fmake_char_table (XCHAR_TABLE (arg)->purpose, Qnil); |
313 /* Copy all the slots, including the extra ones. */ | 311 /* Copy all the slots, including the extra ones. */ |
314 bcopy (XCHAR_TABLE (arg)->contents, XCHAR_TABLE (copy)->contents, | 312 bcopy (XCHAR_TABLE (arg)->contents, XCHAR_TABLE (copy)->contents, |
315 (XCHAR_TABLE (arg)->size & PSEUDOVECTOR_SIZE_MASK) * sizeof (Lisp_Object)); | 313 ((XCHAR_TABLE (arg)->size & PSEUDOVECTOR_SIZE_MASK) |
314 * sizeof (Lisp_Object))); | |
316 | 315 |
317 /* Recursively copy any char-tables in the ordinary slots. */ | 316 /* Recursively copy any char-tables in the ordinary slots. */ |
318 for (i = 0; i < CHAR_TABLE_ORDINARY_SLOTS; i++) | 317 for (i = 0; i < CHAR_TABLE_ORDINARY_SLOTS; i++) |
319 if (CHAR_TABLE_P (XCHAR_TABLE (arg)->contents[i])) | 318 if (CHAR_TABLE_P (XCHAR_TABLE (arg)->contents[i])) |
320 XCHAR_TABLE (copy)->contents[i] | 319 XCHAR_TABLE (copy)->contents[i] |
1249 return parent; | 1248 return parent; |
1250 } | 1249 } |
1251 | 1250 |
1252 DEFUN ("char-table-extra-slot", Fchar_table_extra_slot, Schar_table_extra_slot, | 1251 DEFUN ("char-table-extra-slot", Fchar_table_extra_slot, Schar_table_extra_slot, |
1253 2, 2, 0, | 1252 2, 2, 0, |
1254 "Return the value in extra-slot number N of char-table CHAR-TABLE.") | 1253 "Return the value of CHAR-TABLE's extra-slot number N.") |
1255 (char_table, n) | 1254 (char_table, n) |
1256 Lisp_Object char_table, n; | 1255 Lisp_Object char_table, n; |
1257 { | 1256 { |
1258 CHECK_CHAR_TABLE (char_table, 1); | 1257 CHECK_CHAR_TABLE (char_table, 1); |
1259 CHECK_NUMBER (n, 2); | 1258 CHECK_NUMBER (n, 2); |
1265 } | 1264 } |
1266 | 1265 |
1267 DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot, | 1266 DEFUN ("set-char-table-extra-slot", Fset_char_table_extra_slot, |
1268 Sset_char_table_extra_slot, | 1267 Sset_char_table_extra_slot, |
1269 3, 3, 0, | 1268 3, 3, 0, |
1270 "Set extra-slot number N of CHAR-TABLE to VALUE.") | 1269 "Set CHAR-TABLE's extra-slot number N to VALUE.") |
1271 (char_table, n, value) | 1270 (char_table, n, value) |
1272 Lisp_Object char_table, n, value; | 1271 Lisp_Object char_table, n, value; |
1273 { | 1272 { |
1274 CHECK_CHAR_TABLE (char_table, 1); | 1273 CHECK_CHAR_TABLE (char_table, 1); |
1275 CHECK_NUMBER (n, 2); | 1274 CHECK_NUMBER (n, 2); |
1376 from = 32, to = 128; | 1375 from = 32, to = 128; |
1377 /* Make INDICES longer if we are about to fill it up. */ | 1376 /* Make INDICES longer if we are about to fill it up. */ |
1378 if ((depth % 10) == 9) | 1377 if ((depth % 10) == 9) |
1379 { | 1378 { |
1380 Lisp_Object *new_indices | 1379 Lisp_Object *new_indices |
1381 = (Lisp_Object *) alloca ((depth += 10) * sizeof (Lisp_Object)); | 1380 = (Lisp_Object *) alloca ((depth + 10) * sizeof (Lisp_Object)); |
1382 bcopy (indices, new_indices, depth * sizeof (Lisp_Object)); | 1381 bcopy (indices, new_indices, depth * sizeof (Lisp_Object)); |
1383 indices = new_indices; | 1382 indices = new_indices; |
1384 } | 1383 } |
1385 | 1384 |
1386 for (i = from; i < to; i++) | 1385 for (i = from; i < to; i++) |