diff options
| author | Noah Friedman | 2000-08-05 03:01:49 +0000 |
|---|---|---|
| committer | Noah Friedman | 2000-08-05 03:01:49 +0000 |
| commit | 59f953a2850684d709f4ca989121d1c1f290f582 (patch) | |
| tree | 0d7b905a41871a3f15dd1a7a4e5d5615c418296d /src | |
| parent | 82d497fc5cc33264c5be033fcdb836ae59a0b21d (diff) | |
| download | emacs-59f953a2850684d709f4ca989121d1c1f290f582.tar.gz emacs-59f953a2850684d709f4ca989121d1c1f290f582.zip | |
(Fmake_hash_table): Add missing `\n\' to end of line in docstring.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fns.c | 136 |
2 files changed, 73 insertions, 68 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 152940dcac1..de197212f61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -3,6 +3,11 @@ | |||
| 3 | * syntax.c (skip_chars): Fix handling of multibyte<->unibyte | 3 | * syntax.c (skip_chars): Fix handling of multibyte<->unibyte |
| 4 | conversion. | 4 | conversion. |
| 5 | 5 | ||
| 6 | 2000-08-04 Noah Friedman <friedman@splode.com> | ||
| 7 | |||
| 8 | * fns.c (Fmake_hash_table): Add missing `\n\' to end of line in | ||
| 9 | docstring. | ||
| 10 | |||
| 6 | 2000-08-04 Gerd Moellmann <gerd@gnu.org> | 11 | 2000-08-04 Gerd Moellmann <gerd@gnu.org> |
| 7 | 12 | ||
| 8 | * syntax.c (skip_chars): Fix typo in error message. | 13 | * syntax.c (skip_chars): Fix typo in error message. |
| @@ -1351,7 +1351,7 @@ whose car is ELT.") | |||
| 1351 | { | 1351 | { |
| 1352 | if (!CONSP (list) || EQ (XCAR (list), elt)) | 1352 | if (!CONSP (list) || EQ (XCAR (list), elt)) |
| 1353 | break; | 1353 | break; |
| 1354 | 1354 | ||
| 1355 | list = XCDR (list); | 1355 | list = XCDR (list); |
| 1356 | if (!CONSP (list) || EQ (XCAR (list), elt)) | 1356 | if (!CONSP (list) || EQ (XCAR (list), elt)) |
| 1357 | break; | 1357 | break; |
| @@ -1385,19 +1385,19 @@ Elements of LIST that are not conses are ignored.") | |||
| 1385 | || (CONSP (XCAR (list)) | 1385 | || (CONSP (XCAR (list)) |
| 1386 | && EQ (XCAR (XCAR (list)), key))) | 1386 | && EQ (XCAR (XCAR (list)), key))) |
| 1387 | break; | 1387 | break; |
| 1388 | 1388 | ||
| 1389 | list = XCDR (list); | 1389 | list = XCDR (list); |
| 1390 | if (!CONSP (list) | 1390 | if (!CONSP (list) |
| 1391 | || (CONSP (XCAR (list)) | 1391 | || (CONSP (XCAR (list)) |
| 1392 | && EQ (XCAR (XCAR (list)), key))) | 1392 | && EQ (XCAR (XCAR (list)), key))) |
| 1393 | break; | 1393 | break; |
| 1394 | 1394 | ||
| 1395 | list = XCDR (list); | 1395 | list = XCDR (list); |
| 1396 | if (!CONSP (list) | 1396 | if (!CONSP (list) |
| 1397 | || (CONSP (XCAR (list)) | 1397 | || (CONSP (XCAR (list)) |
| 1398 | && EQ (XCAR (XCAR (list)), key))) | 1398 | && EQ (XCAR (XCAR (list)), key))) |
| 1399 | break; | 1399 | break; |
| 1400 | 1400 | ||
| 1401 | list = XCDR (list); | 1401 | list = XCDR (list); |
| 1402 | QUIT; | 1402 | QUIT; |
| 1403 | } | 1403 | } |
| @@ -1442,21 +1442,21 @@ The value is actually the element of LIST whose car equals KEY.") | |||
| 1442 | && (car = XCAR (XCAR (list)), | 1442 | && (car = XCAR (XCAR (list)), |
| 1443 | EQ (car, key) || !NILP (Fequal (car, key))))) | 1443 | EQ (car, key) || !NILP (Fequal (car, key))))) |
| 1444 | break; | 1444 | break; |
| 1445 | 1445 | ||
| 1446 | list = XCDR (list); | 1446 | list = XCDR (list); |
| 1447 | if (!CONSP (list) | 1447 | if (!CONSP (list) |
| 1448 | || (CONSP (XCAR (list)) | 1448 | || (CONSP (XCAR (list)) |
| 1449 | && (car = XCAR (XCAR (list)), | 1449 | && (car = XCAR (XCAR (list)), |
| 1450 | EQ (car, key) || !NILP (Fequal (car, key))))) | 1450 | EQ (car, key) || !NILP (Fequal (car, key))))) |
| 1451 | break; | 1451 | break; |
| 1452 | 1452 | ||
| 1453 | list = XCDR (list); | 1453 | list = XCDR (list); |
| 1454 | if (!CONSP (list) | 1454 | if (!CONSP (list) |
| 1455 | || (CONSP (XCAR (list)) | 1455 | || (CONSP (XCAR (list)) |
| 1456 | && (car = XCAR (XCAR (list)), | 1456 | && (car = XCAR (XCAR (list)), |
| 1457 | EQ (car, key) || !NILP (Fequal (car, key))))) | 1457 | EQ (car, key) || !NILP (Fequal (car, key))))) |
| 1458 | break; | 1458 | break; |
| 1459 | 1459 | ||
| 1460 | list = XCDR (list); | 1460 | list = XCDR (list); |
| 1461 | QUIT; | 1461 | QUIT; |
| 1462 | } | 1462 | } |
| @@ -1486,19 +1486,19 @@ The value is actually the element of LIST whose cdr is KEY.") | |||
| 1486 | || (CONSP (XCAR (list)) | 1486 | || (CONSP (XCAR (list)) |
| 1487 | && EQ (XCDR (XCAR (list)), key))) | 1487 | && EQ (XCDR (XCAR (list)), key))) |
| 1488 | break; | 1488 | break; |
| 1489 | 1489 | ||
| 1490 | list = XCDR (list); | 1490 | list = XCDR (list); |
| 1491 | if (!CONSP (list) | 1491 | if (!CONSP (list) |
| 1492 | || (CONSP (XCAR (list)) | 1492 | || (CONSP (XCAR (list)) |
| 1493 | && EQ (XCDR (XCAR (list)), key))) | 1493 | && EQ (XCDR (XCAR (list)), key))) |
| 1494 | break; | 1494 | break; |
| 1495 | 1495 | ||
| 1496 | list = XCDR (list); | 1496 | list = XCDR (list); |
| 1497 | if (!CONSP (list) | 1497 | if (!CONSP (list) |
| 1498 | || (CONSP (XCAR (list)) | 1498 | || (CONSP (XCAR (list)) |
| 1499 | && EQ (XCDR (XCAR (list)), key))) | 1499 | && EQ (XCDR (XCAR (list)), key))) |
| 1500 | break; | 1500 | break; |
| 1501 | 1501 | ||
| 1502 | list = XCDR (list); | 1502 | list = XCDR (list); |
| 1503 | QUIT; | 1503 | QUIT; |
| 1504 | } | 1504 | } |
| @@ -1528,21 +1528,21 @@ The value is actually the element of LIST whose cdr equals KEY.") | |||
| 1528 | && (cdr = XCDR (XCAR (list)), | 1528 | && (cdr = XCDR (XCAR (list)), |
| 1529 | EQ (cdr, key) || !NILP (Fequal (cdr, key))))) | 1529 | EQ (cdr, key) || !NILP (Fequal (cdr, key))))) |
| 1530 | break; | 1530 | break; |
| 1531 | 1531 | ||
| 1532 | list = XCDR (list); | 1532 | list = XCDR (list); |
| 1533 | if (!CONSP (list) | 1533 | if (!CONSP (list) |
| 1534 | || (CONSP (XCAR (list)) | 1534 | || (CONSP (XCAR (list)) |
| 1535 | && (cdr = XCDR (XCAR (list)), | 1535 | && (cdr = XCDR (XCAR (list)), |
| 1536 | EQ (cdr, key) || !NILP (Fequal (cdr, key))))) | 1536 | EQ (cdr, key) || !NILP (Fequal (cdr, key))))) |
| 1537 | break; | 1537 | break; |
| 1538 | 1538 | ||
| 1539 | list = XCDR (list); | 1539 | list = XCDR (list); |
| 1540 | if (!CONSP (list) | 1540 | if (!CONSP (list) |
| 1541 | || (CONSP (XCAR (list)) | 1541 | || (CONSP (XCAR (list)) |
| 1542 | && (cdr = XCDR (XCAR (list)), | 1542 | && (cdr = XCDR (XCAR (list)), |
| 1543 | EQ (cdr, key) || !NILP (Fequal (cdr, key))))) | 1543 | EQ (cdr, key) || !NILP (Fequal (cdr, key))))) |
| 1544 | break; | 1544 | break; |
| 1545 | 1545 | ||
| 1546 | list = XCDR (list); | 1546 | list = XCDR (list); |
| 1547 | QUIT; | 1547 | QUIT; |
| 1548 | } | 1548 | } |
| @@ -1614,7 +1614,7 @@ to be sure of changing the value of `foo'.") | |||
| 1614 | if (n != ASIZE (seq)) | 1614 | if (n != ASIZE (seq)) |
| 1615 | { | 1615 | { |
| 1616 | struct Lisp_Vector *p = allocate_vectorlike (n); | 1616 | struct Lisp_Vector *p = allocate_vectorlike (n); |
| 1617 | 1617 | ||
| 1618 | for (i = n = 0; i < ASIZE (seq); ++i) | 1618 | for (i = n = 0; i < ASIZE (seq); ++i) |
| 1619 | if (NILP (Fequal (AREF (seq, i), elt))) | 1619 | if (NILP (Fequal (AREF (seq, i), elt))) |
| 1620 | p->contents[n++] = AREF (seq, i); | 1620 | p->contents[n++] = AREF (seq, i); |
| @@ -1643,7 +1643,7 @@ to be sure of changing the value of `foo'.") | |||
| 1643 | c = XSTRING (seq)->data[i]; | 1643 | c = XSTRING (seq)->data[i]; |
| 1644 | cbytes = 1; | 1644 | cbytes = 1; |
| 1645 | } | 1645 | } |
| 1646 | 1646 | ||
| 1647 | if (!INTEGERP (elt) || c != XINT (elt)) | 1647 | if (!INTEGERP (elt) || c != XINT (elt)) |
| 1648 | { | 1648 | { |
| 1649 | ++nchars; | 1649 | ++nchars; |
| @@ -1658,7 +1658,7 @@ to be sure of changing the value of `foo'.") | |||
| 1658 | tem = make_uninit_multibyte_string (nchars, nbytes); | 1658 | tem = make_uninit_multibyte_string (nchars, nbytes); |
| 1659 | if (!STRING_MULTIBYTE (seq)) | 1659 | if (!STRING_MULTIBYTE (seq)) |
| 1660 | SET_STRING_BYTES (XSTRING (tem), -1); | 1660 | SET_STRING_BYTES (XSTRING (tem), -1); |
| 1661 | 1661 | ||
| 1662 | for (i = nchars = nbytes = ibyte = 0; | 1662 | for (i = nchars = nbytes = ibyte = 0; |
| 1663 | i < XSTRING (seq)->size; | 1663 | i < XSTRING (seq)->size; |
| 1664 | ++i, ibyte += cbytes) | 1664 | ++i, ibyte += cbytes) |
| @@ -1674,16 +1674,16 @@ to be sure of changing the value of `foo'.") | |||
| 1674 | c = XSTRING (seq)->data[i]; | 1674 | c = XSTRING (seq)->data[i]; |
| 1675 | cbytes = 1; | 1675 | cbytes = 1; |
| 1676 | } | 1676 | } |
| 1677 | 1677 | ||
| 1678 | if (!INTEGERP (elt) || c != XINT (elt)) | 1678 | if (!INTEGERP (elt) || c != XINT (elt)) |
| 1679 | { | 1679 | { |
| 1680 | unsigned char *from = &XSTRING (seq)->data[ibyte]; | 1680 | unsigned char *from = &XSTRING (seq)->data[ibyte]; |
| 1681 | unsigned char *to = &XSTRING (tem)->data[nbytes]; | 1681 | unsigned char *to = &XSTRING (tem)->data[nbytes]; |
| 1682 | EMACS_INT n; | 1682 | EMACS_INT n; |
| 1683 | 1683 | ||
| 1684 | ++nchars; | 1684 | ++nchars; |
| 1685 | nbytes += cbytes; | 1685 | nbytes += cbytes; |
| 1686 | 1686 | ||
| 1687 | for (n = cbytes; n--; ) | 1687 | for (n = cbytes; n--; ) |
| 1688 | *to++ = *from++; | 1688 | *to++ = *from++; |
| 1689 | } | 1689 | } |
| @@ -1700,7 +1700,7 @@ to be sure of changing the value of `foo'.") | |||
| 1700 | { | 1700 | { |
| 1701 | if (!CONSP (tail)) | 1701 | if (!CONSP (tail)) |
| 1702 | wrong_type_argument (Qlistp, seq); | 1702 | wrong_type_argument (Qlistp, seq); |
| 1703 | 1703 | ||
| 1704 | if (!NILP (Fequal (elt, XCAR (tail)))) | 1704 | if (!NILP (Fequal (elt, XCAR (tail)))) |
| 1705 | { | 1705 | { |
| 1706 | if (NILP (prev)) | 1706 | if (NILP (prev)) |
| @@ -1713,7 +1713,7 @@ to be sure of changing the value of `foo'.") | |||
| 1713 | QUIT; | 1713 | QUIT; |
| 1714 | } | 1714 | } |
| 1715 | } | 1715 | } |
| 1716 | 1716 | ||
| 1717 | return seq; | 1717 | return seq; |
| 1718 | } | 1718 | } |
| 1719 | 1719 | ||
| @@ -2802,7 +2802,7 @@ is nil.") | |||
| 2802 | if (display_busy_cursor_p) | 2802 | if (display_busy_cursor_p) |
| 2803 | cancel_busy_cursor (); | 2803 | cancel_busy_cursor (); |
| 2804 | #endif | 2804 | #endif |
| 2805 | 2805 | ||
| 2806 | while (1) | 2806 | while (1) |
| 2807 | { | 2807 | { |
| 2808 | 2808 | ||
| @@ -3491,7 +3491,7 @@ If the region can't be decoded, signal an error and don't modify the buffer.") | |||
| 3491 | 3491 | ||
| 3492 | /* Now we have decoded the region, so we insert the new contents | 3492 | /* Now we have decoded the region, so we insert the new contents |
| 3493 | and delete the old. (Insert first in order to preserve markers.) */ | 3493 | and delete the old. (Insert first in order to preserve markers.) */ |
| 3494 | TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg); | 3494 | TEMP_SET_PT_BOTH (XFASTINT (beg), ibeg); |
| 3495 | insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0); | 3495 | insert_1_both (decoded, inserted_chars, decoded_length, 0, 1, 0); |
| 3496 | if (length > MAX_ALLOCA) | 3496 | if (length > MAX_ALLOCA) |
| 3497 | xfree (decoded); | 3497 | xfree (decoded); |
| @@ -3577,13 +3577,13 @@ base64_decode_1 (from, to, length) | |||
| 3577 | *e++ = (unsigned char) (value >> 16); | 3577 | *e++ = (unsigned char) (value >> 16); |
| 3578 | 3578 | ||
| 3579 | /* Process third byte of a quadruplet. */ | 3579 | /* Process third byte of a quadruplet. */ |
| 3580 | 3580 | ||
| 3581 | READ_QUADRUPLET_BYTE (-1); | 3581 | READ_QUADRUPLET_BYTE (-1); |
| 3582 | 3582 | ||
| 3583 | if (c == '=') | 3583 | if (c == '=') |
| 3584 | { | 3584 | { |
| 3585 | READ_QUADRUPLET_BYTE (-1); | 3585 | READ_QUADRUPLET_BYTE (-1); |
| 3586 | 3586 | ||
| 3587 | if (c != '=') | 3587 | if (c != '=') |
| 3588 | return -1; | 3588 | return -1; |
| 3589 | continue; | 3589 | continue; |
| @@ -3740,11 +3740,11 @@ get_key_arg (key, nargs, args, used) | |||
| 3740 | char *used; | 3740 | char *used; |
| 3741 | { | 3741 | { |
| 3742 | int i; | 3742 | int i; |
| 3743 | 3743 | ||
| 3744 | for (i = 0; i < nargs - 1; ++i) | 3744 | for (i = 0; i < nargs - 1; ++i) |
| 3745 | if (!used[i] && EQ (args[i], key)) | 3745 | if (!used[i] && EQ (args[i], key)) |
| 3746 | break; | 3746 | break; |
| 3747 | 3747 | ||
| 3748 | if (i >= nargs - 1) | 3748 | if (i >= nargs - 1) |
| 3749 | i = -1; | 3749 | i = -1; |
| 3750 | else | 3750 | else |
| @@ -3752,7 +3752,7 @@ get_key_arg (key, nargs, args, used) | |||
| 3752 | used[i++] = 1; | 3752 | used[i++] = 1; |
| 3753 | used[i] = 1; | 3753 | used[i] = 1; |
| 3754 | } | 3754 | } |
| 3755 | 3755 | ||
| 3756 | return i; | 3756 | return i; |
| 3757 | } | 3757 | } |
| 3758 | 3758 | ||
| @@ -3818,7 +3818,7 @@ cmpfn_equal (h, key1, hash1, key2, hash2) | |||
| 3818 | return hash1 == hash2 && !NILP (Fequal (key1, key2)); | 3818 | return hash1 == hash2 && !NILP (Fequal (key1, key2)); |
| 3819 | } | 3819 | } |
| 3820 | 3820 | ||
| 3821 | 3821 | ||
| 3822 | /* Compare KEY1 which has hash code HASH1, and KEY2 with hash code | 3822 | /* Compare KEY1 which has hash code HASH1, and KEY2 with hash code |
| 3823 | HASH2 in hash table H using H->user_cmp_function. Value is non-zero | 3823 | HASH2 in hash table H using H->user_cmp_function. Value is non-zero |
| 3824 | if KEY1 and KEY2 are the same. */ | 3824 | if KEY1 and KEY2 are the same. */ |
| @@ -3832,7 +3832,7 @@ cmpfn_user_defined (h, key1, hash1, key2, hash2) | |||
| 3832 | if (hash1 == hash2) | 3832 | if (hash1 == hash2) |
| 3833 | { | 3833 | { |
| 3834 | Lisp_Object args[3]; | 3834 | Lisp_Object args[3]; |
| 3835 | 3835 | ||
| 3836 | args[0] = h->user_cmp_function; | 3836 | args[0] = h->user_cmp_function; |
| 3837 | args[1] = key1; | 3837 | args[1] = key1; |
| 3838 | args[2] = key2; | 3838 | args[2] = key2; |
| @@ -3904,7 +3904,7 @@ hashfn_user_defined (h, key) | |||
| 3904 | Lisp_Object key; | 3904 | Lisp_Object key; |
| 3905 | { | 3905 | { |
| 3906 | Lisp_Object args[2], hash; | 3906 | Lisp_Object args[2], hash; |
| 3907 | 3907 | ||
| 3908 | args[0] = h->user_hash_function; | 3908 | args[0] = h->user_hash_function; |
| 3909 | args[1] = key; | 3909 | args[1] = key; |
| 3910 | hash = Ffuncall (2, args); | 3910 | hash = Ffuncall (2, args); |
| @@ -3923,7 +3923,7 @@ user-supplied hash function"), | |||
| 3923 | It must be either one of the predefined tests `eq', `eql' or | 3923 | It must be either one of the predefined tests `eq', `eql' or |
| 3924 | `equal' or a symbol denoting a user-defined test named TEST with | 3924 | `equal' or a symbol denoting a user-defined test named TEST with |
| 3925 | test and hash functions USER_TEST and USER_HASH. | 3925 | test and hash functions USER_TEST and USER_HASH. |
| 3926 | 3926 | ||
| 3927 | Give the table initial capacity SIZE, SIZE > 0, an integer. | 3927 | Give the table initial capacity SIZE, SIZE > 0, an integer. |
| 3928 | 3928 | ||
| 3929 | If REHASH_SIZE is an integer, it must be > 0, and this hash table's | 3929 | If REHASH_SIZE is an integer, it must be > 0, and this hash table's |
| @@ -3969,7 +3969,7 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak, | |||
| 3969 | /* Initialize hash table slots. */ | 3969 | /* Initialize hash table slots. */ |
| 3970 | sz = XFASTINT (size); | 3970 | sz = XFASTINT (size); |
| 3971 | h = (struct Lisp_Hash_Table *) v; | 3971 | h = (struct Lisp_Hash_Table *) v; |
| 3972 | 3972 | ||
| 3973 | h->test = test; | 3973 | h->test = test; |
| 3974 | if (EQ (test, Qeql)) | 3974 | if (EQ (test, Qeql)) |
| 3975 | { | 3975 | { |
| @@ -3993,7 +3993,7 @@ make_hash_table (test, size, rehash_size, rehash_threshold, weak, | |||
| 3993 | h->cmpfn = cmpfn_user_defined; | 3993 | h->cmpfn = cmpfn_user_defined; |
| 3994 | h->hashfn = hashfn_user_defined; | 3994 | h->hashfn = hashfn_user_defined; |
| 3995 | } | 3995 | } |
| 3996 | 3996 | ||
| 3997 | h->weak = weak; | 3997 | h->weak = weak; |
| 3998 | h->rehash_threshold = rehash_threshold; | 3998 | h->rehash_threshold = rehash_threshold; |
| 3999 | h->rehash_size = rehash_size; | 3999 | h->rehash_size = rehash_size; |
| @@ -4038,7 +4038,7 @@ copy_hash_table (h1) | |||
| 4038 | struct Lisp_Hash_Table *h2; | 4038 | struct Lisp_Hash_Table *h2; |
| 4039 | struct Lisp_Vector *v, *next; | 4039 | struct Lisp_Vector *v, *next; |
| 4040 | int len; | 4040 | int len; |
| 4041 | 4041 | ||
| 4042 | len = VECSIZE (struct Lisp_Hash_Table); | 4042 | len = VECSIZE (struct Lisp_Hash_Table); |
| 4043 | v = allocate_vectorlike (len); | 4043 | v = allocate_vectorlike (len); |
| 4044 | h2 = (struct Lisp_Hash_Table *) v; | 4044 | h2 = (struct Lisp_Hash_Table *) v; |
| @@ -4073,7 +4073,7 @@ maybe_resize_hash_table (h) | |||
| 4073 | { | 4073 | { |
| 4074 | int old_size = HASH_TABLE_SIZE (h); | 4074 | int old_size = HASH_TABLE_SIZE (h); |
| 4075 | int i, new_size, index_size; | 4075 | int i, new_size, index_size; |
| 4076 | 4076 | ||
| 4077 | if (INTEGERP (h->rehash_size)) | 4077 | if (INTEGERP (h->rehash_size)) |
| 4078 | new_size = old_size + XFASTINT (h->rehash_size); | 4078 | new_size = old_size + XFASTINT (h->rehash_size); |
| 4079 | else | 4079 | else |
| @@ -4095,16 +4095,16 @@ maybe_resize_hash_table (h) | |||
| 4095 | maphash faster. */ | 4095 | maphash faster. */ |
| 4096 | for (i = old_size; i < new_size - 1; ++i) | 4096 | for (i = old_size; i < new_size - 1; ++i) |
| 4097 | HASH_NEXT (h, i) = make_number (i + 1); | 4097 | HASH_NEXT (h, i) = make_number (i + 1); |
| 4098 | 4098 | ||
| 4099 | if (!NILP (h->next_free)) | 4099 | if (!NILP (h->next_free)) |
| 4100 | { | 4100 | { |
| 4101 | Lisp_Object last, next; | 4101 | Lisp_Object last, next; |
| 4102 | 4102 | ||
| 4103 | last = h->next_free; | 4103 | last = h->next_free; |
| 4104 | while (next = HASH_NEXT (h, XFASTINT (last)), | 4104 | while (next = HASH_NEXT (h, XFASTINT (last)), |
| 4105 | !NILP (next)) | 4105 | !NILP (next)) |
| 4106 | last = next; | 4106 | last = next; |
| 4107 | 4107 | ||
| 4108 | HASH_NEXT (h, XFASTINT (last)) = make_number (old_size); | 4108 | HASH_NEXT (h, XFASTINT (last)) = make_number (old_size); |
| 4109 | } | 4109 | } |
| 4110 | else | 4110 | else |
| @@ -4119,7 +4119,7 @@ maybe_resize_hash_table (h) | |||
| 4119 | HASH_NEXT (h, i) = HASH_INDEX (h, start_of_bucket); | 4119 | HASH_NEXT (h, i) = HASH_INDEX (h, start_of_bucket); |
| 4120 | HASH_INDEX (h, start_of_bucket) = make_number (i); | 4120 | HASH_INDEX (h, start_of_bucket) = make_number (i); |
| 4121 | } | 4121 | } |
| 4122 | } | 4122 | } |
| 4123 | } | 4123 | } |
| 4124 | 4124 | ||
| 4125 | 4125 | ||
| @@ -4140,7 +4140,7 @@ hash_lookup (h, key, hash) | |||
| 4140 | hash_code = h->hashfn (h, key); | 4140 | hash_code = h->hashfn (h, key); |
| 4141 | if (hash) | 4141 | if (hash) |
| 4142 | *hash = hash_code; | 4142 | *hash = hash_code; |
| 4143 | 4143 | ||
| 4144 | start_of_bucket = hash_code % XVECTOR (h->index)->size; | 4144 | start_of_bucket = hash_code % XVECTOR (h->index)->size; |
| 4145 | idx = HASH_INDEX (h, start_of_bucket); | 4145 | idx = HASH_INDEX (h, start_of_bucket); |
| 4146 | 4146 | ||
| @@ -4177,7 +4177,7 @@ hash_put (h, key, value, hash) | |||
| 4177 | /* Increment count after resizing because resizing may fail. */ | 4177 | /* Increment count after resizing because resizing may fail. */ |
| 4178 | maybe_resize_hash_table (h); | 4178 | maybe_resize_hash_table (h); |
| 4179 | h->count = make_number (XFASTINT (h->count) + 1); | 4179 | h->count = make_number (XFASTINT (h->count) + 1); |
| 4180 | 4180 | ||
| 4181 | /* Store key/value in the key_and_value vector. */ | 4181 | /* Store key/value in the key_and_value vector. */ |
| 4182 | i = XFASTINT (h->next_free); | 4182 | i = XFASTINT (h->next_free); |
| 4183 | h->next_free = HASH_NEXT (h, i); | 4183 | h->next_free = HASH_NEXT (h, i); |
| @@ -4288,10 +4288,10 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4288 | int remove_entries_p; | 4288 | int remove_entries_p; |
| 4289 | { | 4289 | { |
| 4290 | int bucket, n, marked; | 4290 | int bucket, n, marked; |
| 4291 | 4291 | ||
| 4292 | n = XVECTOR (h->index)->size & ~ARRAY_MARK_FLAG; | 4292 | n = XVECTOR (h->index)->size & ~ARRAY_MARK_FLAG; |
| 4293 | marked = 0; | 4293 | marked = 0; |
| 4294 | 4294 | ||
| 4295 | for (bucket = 0; bucket < n; ++bucket) | 4295 | for (bucket = 0; bucket < n; ++bucket) |
| 4296 | { | 4296 | { |
| 4297 | Lisp_Object idx, prev; | 4297 | Lisp_Object idx, prev; |
| @@ -4309,7 +4309,7 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4309 | 4309 | ||
| 4310 | key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); | 4310 | key_known_to_survive_p = survives_gc_p (HASH_KEY (h, i)); |
| 4311 | value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); | 4311 | value_known_to_survive_p = survives_gc_p (HASH_VALUE (h, i)); |
| 4312 | 4312 | ||
| 4313 | if (EQ (h->weak, Qkey)) | 4313 | if (EQ (h->weak, Qkey)) |
| 4314 | remove_p = !key_known_to_survive_p; | 4314 | remove_p = !key_known_to_survive_p; |
| 4315 | else if (EQ (h->weak, Qvalue)) | 4315 | else if (EQ (h->weak, Qvalue)) |
| @@ -4320,7 +4320,7 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4320 | remove_p = !key_known_to_survive_p && !value_known_to_survive_p; | 4320 | remove_p = !key_known_to_survive_p && !value_known_to_survive_p; |
| 4321 | else | 4321 | else |
| 4322 | abort (); | 4322 | abort (); |
| 4323 | 4323 | ||
| 4324 | next = HASH_NEXT (h, i); | 4324 | next = HASH_NEXT (h, i); |
| 4325 | 4325 | ||
| 4326 | if (remove_entries_p) | 4326 | if (remove_entries_p) |
| @@ -4332,15 +4332,15 @@ sweep_weak_table (h, remove_entries_p) | |||
| 4332 | HASH_INDEX (h, i) = next; | 4332 | HASH_INDEX (h, i) = next; |
| 4333 | else | 4333 | else |
| 4334 | HASH_NEXT (h, XFASTINT (prev)) = next; | 4334 | HASH_NEXT (h, XFASTINT (prev)) = next; |
| 4335 | 4335 | ||
| 4336 | /* Add to free list. */ | 4336 | /* Add to free list. */ |
| 4337 | HASH_NEXT (h, i) = h->next_free; | 4337 | HASH_NEXT (h, i) = h->next_free; |
| 4338 | h->next_free = idx; | 4338 | h->next_free = idx; |
| 4339 | 4339 | ||
| 4340 | /* Clear key, value, and hash. */ | 4340 | /* Clear key, value, and hash. */ |
| 4341 | HASH_KEY (h, i) = HASH_VALUE (h, i) = Qnil; | 4341 | HASH_KEY (h, i) = HASH_VALUE (h, i) = Qnil; |
| 4342 | HASH_HASH (h, i) = Qnil; | 4342 | HASH_HASH (h, i) = Qnil; |
| 4343 | 4343 | ||
| 4344 | h->count = make_number (XFASTINT (h->count) - 1); | 4344 | h->count = make_number (XFASTINT (h->count) - 1); |
| 4345 | } | 4345 | } |
| 4346 | } | 4346 | } |
| @@ -4405,7 +4405,7 @@ sweep_weak_hash_tables () | |||
| 4405 | { | 4405 | { |
| 4406 | prev = h; | 4406 | prev = h; |
| 4407 | h = XHASH_TABLE (table); | 4407 | h = XHASH_TABLE (table); |
| 4408 | 4408 | ||
| 4409 | if (h->size & ARRAY_MARK_FLAG) | 4409 | if (h->size & ARRAY_MARK_FLAG) |
| 4410 | { | 4410 | { |
| 4411 | if (XFASTINT (h->count) > 0) | 4411 | if (XFASTINT (h->count) > 0) |
| @@ -4464,7 +4464,7 @@ sxhash_string (ptr, len) | |||
| 4464 | c -= 40; | 4464 | c -= 40; |
| 4465 | hash = ((hash << 3) + (hash >> 28) + c); | 4465 | hash = ((hash << 3) + (hash >> 28) + c); |
| 4466 | } | 4466 | } |
| 4467 | 4467 | ||
| 4468 | return hash & 07777777777; | 4468 | return hash & 07777777777; |
| 4469 | } | 4469 | } |
| 4470 | 4470 | ||
| @@ -4479,7 +4479,7 @@ sxhash_list (list, depth) | |||
| 4479 | { | 4479 | { |
| 4480 | unsigned hash = 0; | 4480 | unsigned hash = 0; |
| 4481 | int i; | 4481 | int i; |
| 4482 | 4482 | ||
| 4483 | if (depth < SXHASH_MAX_DEPTH) | 4483 | if (depth < SXHASH_MAX_DEPTH) |
| 4484 | for (i = 0; | 4484 | for (i = 0; |
| 4485 | CONSP (list) && i < SXHASH_MAX_LEN; | 4485 | CONSP (list) && i < SXHASH_MAX_LEN; |
| @@ -4544,7 +4544,7 @@ sxhash (obj, depth) | |||
| 4544 | 4544 | ||
| 4545 | if (depth > SXHASH_MAX_DEPTH) | 4545 | if (depth > SXHASH_MAX_DEPTH) |
| 4546 | return 0; | 4546 | return 0; |
| 4547 | 4547 | ||
| 4548 | switch (XTYPE (obj)) | 4548 | switch (XTYPE (obj)) |
| 4549 | { | 4549 | { |
| 4550 | case Lisp_Int: | 4550 | case Lisp_Int: |
| @@ -4643,7 +4643,7 @@ Default is 0.8.\n\ | |||
| 4643 | `key-or-value', or `key-and-value'. If WEAK is not nil, the table returned\n\ | 4643 | `key-or-value', or `key-and-value'. If WEAK is not nil, the table returned\n\ |
| 4644 | is a weak table. Key/value pairs are removed from a weak hash table when\n\ | 4644 | is a weak table. Key/value pairs are removed from a weak hash table when\n\ |
| 4645 | there are no non-weak references pointing to their key, value, one of key\n\ | 4645 | there are no non-weak references pointing to their key, value, one of key\n\ |
| 4646 | or value, or both key and value, depending on WEAK. WEAK t is equivalent | 4646 | or value, or both key and value, depending on WEAK. WEAK t is equivalent\n\ |
| 4647 | to `key-and-value'. Default value of WEAK is nil.") | 4647 | to `key-and-value'. Default value of WEAK is nil.") |
| 4648 | (nargs, args) | 4648 | (nargs, args) |
| 4649 | int nargs; | 4649 | int nargs; |
| @@ -4666,7 +4666,7 @@ to `key-and-value'. Default value of WEAK is nil.") | |||
| 4666 | { | 4666 | { |
| 4667 | /* See if it is a user-defined test. */ | 4667 | /* See if it is a user-defined test. */ |
| 4668 | Lisp_Object prop; | 4668 | Lisp_Object prop; |
| 4669 | 4669 | ||
| 4670 | prop = Fget (test, Qhash_table_test); | 4670 | prop = Fget (test, Qhash_table_test); |
| 4671 | if (!CONSP (prop) || XFASTINT (Flength (prop)) < 2) | 4671 | if (!CONSP (prop) || XFASTINT (Flength (prop)) < 2) |
| 4672 | Fsignal (Qerror, list2 (build_string ("Illegal hash table test"), | 4672 | Fsignal (Qerror, list2 (build_string ("Illegal hash table test"), |
| @@ -4694,7 +4694,7 @@ to `key-and-value'. Default value of WEAK is nil.") | |||
| 4694 | Fsignal (Qerror, | 4694 | Fsignal (Qerror, |
| 4695 | list2 (build_string ("Illegal hash table rehash size"), | 4695 | list2 (build_string ("Illegal hash table rehash size"), |
| 4696 | rehash_size)); | 4696 | rehash_size)); |
| 4697 | 4697 | ||
| 4698 | /* Look for `:rehash-threshold THRESHOLD'. */ | 4698 | /* Look for `:rehash-threshold THRESHOLD'. */ |
| 4699 | i = get_key_arg (QCrehash_threshold, nargs, args, used); | 4699 | i = get_key_arg (QCrehash_threshold, nargs, args, used); |
| 4700 | rehash_threshold = i < 0 ? make_float (DEFAULT_REHASH_THRESHOLD) : args[i]; | 4700 | rehash_threshold = i < 0 ? make_float (DEFAULT_REHASH_THRESHOLD) : args[i]; |
| @@ -4704,7 +4704,7 @@ to `key-and-value'. Default value of WEAK is nil.") | |||
| 4704 | Fsignal (Qerror, | 4704 | Fsignal (Qerror, |
| 4705 | list2 (build_string ("Illegal hash table rehash threshold"), | 4705 | list2 (build_string ("Illegal hash table rehash threshold"), |
| 4706 | rehash_threshold)); | 4706 | rehash_threshold)); |
| 4707 | 4707 | ||
| 4708 | /* Look for `:weakness WEAK'. */ | 4708 | /* Look for `:weakness WEAK'. */ |
| 4709 | i = get_key_arg (QCweakness, nargs, args, used); | 4709 | i = get_key_arg (QCweakness, nargs, args, used); |
| 4710 | weak = i < 0 ? Qnil : args[i]; | 4710 | weak = i < 0 ? Qnil : args[i]; |
| @@ -4715,9 +4715,9 @@ to `key-and-value'. Default value of WEAK is nil.") | |||
| 4715 | && !EQ (weak, Qvalue) | 4715 | && !EQ (weak, Qvalue) |
| 4716 | && !EQ (weak, Qkey_or_value) | 4716 | && !EQ (weak, Qkey_or_value) |
| 4717 | && !EQ (weak, Qkey_and_value)) | 4717 | && !EQ (weak, Qkey_and_value)) |
| 4718 | Fsignal (Qerror, list2 (build_string ("Illegal hash table weakness"), | 4718 | Fsignal (Qerror, list2 (build_string ("Illegal hash table weakness"), |
| 4719 | weak)); | 4719 | weak)); |
| 4720 | 4720 | ||
| 4721 | /* Now, all args should have been used up, or there's a problem. */ | 4721 | /* Now, all args should have been used up, or there's a problem. */ |
| 4722 | for (i = 0; i < nargs; ++i) | 4722 | for (i = 0; i < nargs; ++i) |
| 4723 | if (!used[i]) | 4723 | if (!used[i]) |
| @@ -4761,7 +4761,7 @@ DEFUN ("hash-table-count", Fhash_table_count, Shash_table_count, 1, 1, 0, | |||
| 4761 | return check_hash_table (table)->count; | 4761 | return check_hash_table (table)->count; |
| 4762 | } | 4762 | } |
| 4763 | 4763 | ||
| 4764 | 4764 | ||
| 4765 | DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size, | 4765 | DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size, |
| 4766 | Shash_table_rehash_size, 1, 1, 0, | 4766 | Shash_table_rehash_size, 1, 1, 0, |
| 4767 | "Return the current rehash size of TABLE.") | 4767 | "Return the current rehash size of TABLE.") |
| @@ -4770,7 +4770,7 @@ DEFUN ("hash-table-rehash-size", Fhash_table_rehash_size, | |||
| 4770 | { | 4770 | { |
| 4771 | return check_hash_table (table)->rehash_size; | 4771 | return check_hash_table (table)->rehash_size; |
| 4772 | } | 4772 | } |
| 4773 | 4773 | ||
| 4774 | 4774 | ||
| 4775 | DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold, | 4775 | DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold, |
| 4776 | Shash_table_rehash_threshold, 1, 1, 0, | 4776 | Shash_table_rehash_threshold, 1, 1, 0, |
| @@ -4780,7 +4780,7 @@ DEFUN ("hash-table-rehash-threshold", Fhash_table_rehash_threshold, | |||
| 4780 | { | 4780 | { |
| 4781 | return check_hash_table (table)->rehash_threshold; | 4781 | return check_hash_table (table)->rehash_threshold; |
| 4782 | } | 4782 | } |
| 4783 | 4783 | ||
| 4784 | 4784 | ||
| 4785 | DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0, | 4785 | DEFUN ("hash-table-size", Fhash_table_size, Shash_table_size, 1, 1, 0, |
| 4786 | "Return the size of TABLE.\n\ | 4786 | "Return the size of TABLE.\n\ |
| @@ -4793,7 +4793,7 @@ without need for resizing.") | |||
| 4793 | struct Lisp_Hash_Table *h = check_hash_table (table); | 4793 | struct Lisp_Hash_Table *h = check_hash_table (table); |
| 4794 | return make_number (HASH_TABLE_SIZE (h)); | 4794 | return make_number (HASH_TABLE_SIZE (h)); |
| 4795 | } | 4795 | } |
| 4796 | 4796 | ||
| 4797 | 4797 | ||
| 4798 | DEFUN ("hash-table-test", Fhash_table_test, Shash_table_test, 1, 1, 0, | 4798 | DEFUN ("hash-table-test", Fhash_table_test, Shash_table_test, 1, 1, 0, |
| 4799 | "Return the test TABLE uses.") | 4799 | "Return the test TABLE uses.") |
| @@ -4803,7 +4803,7 @@ DEFUN ("hash-table-test", Fhash_table_test, Shash_table_test, 1, 1, 0, | |||
| 4803 | return check_hash_table (table)->test; | 4803 | return check_hash_table (table)->test; |
| 4804 | } | 4804 | } |
| 4805 | 4805 | ||
| 4806 | 4806 | ||
| 4807 | DEFUN ("hash-table-weakness", Fhash_table_weakness, Shash_table_weakness, | 4807 | DEFUN ("hash-table-weakness", Fhash_table_weakness, Shash_table_weakness, |
| 4808 | 1, 1, 0, | 4808 | 1, 1, 0, |
| 4809 | "Return the weakness of TABLE.") | 4809 | "Return the weakness of TABLE.") |
| @@ -4813,7 +4813,7 @@ DEFUN ("hash-table-weakness", Fhash_table_weakness, Shash_table_weakness, | |||
| 4813 | return check_hash_table (table)->weak; | 4813 | return check_hash_table (table)->weak; |
| 4814 | } | 4814 | } |
| 4815 | 4815 | ||
| 4816 | 4816 | ||
| 4817 | DEFUN ("hash-table-p", Fhash_table_p, Shash_table_p, 1, 1, 0, | 4817 | DEFUN ("hash-table-p", Fhash_table_p, Shash_table_p, 1, 1, 0, |
| 4818 | "Return t if OBJ is a Lisp hash table object.") | 4818 | "Return t if OBJ is a Lisp hash table object.") |
| 4819 | (obj) | 4819 | (obj) |
| @@ -4861,7 +4861,7 @@ VALUE.") | |||
| 4861 | HASH_VALUE (h, i) = value; | 4861 | HASH_VALUE (h, i) = value; |
| 4862 | else | 4862 | else |
| 4863 | hash_put (h, key, value, hash); | 4863 | hash_put (h, key, value, hash); |
| 4864 | 4864 | ||
| 4865 | return value; | 4865 | return value; |
| 4866 | } | 4866 | } |
| 4867 | 4867 | ||
| @@ -4895,7 +4895,7 @@ FUNCTION is called with 2 arguments KEY and VALUE.") | |||
| 4895 | args[2] = HASH_VALUE (h, i); | 4895 | args[2] = HASH_VALUE (h, i); |
| 4896 | Ffuncall (3, args); | 4896 | Ffuncall (3, args); |
| 4897 | } | 4897 | } |
| 4898 | 4898 | ||
| 4899 | return Qnil; | 4899 | return Qnil; |
| 4900 | } | 4900 | } |
| 4901 | 4901 | ||
| @@ -4970,7 +4970,7 @@ syms_of_fns () | |||
| 4970 | defsubr (&Sremhash); | 4970 | defsubr (&Sremhash); |
| 4971 | defsubr (&Smaphash); | 4971 | defsubr (&Smaphash); |
| 4972 | defsubr (&Sdefine_hash_table_test); | 4972 | defsubr (&Sdefine_hash_table_test); |
| 4973 | 4973 | ||
| 4974 | Qstring_lessp = intern ("string-lessp"); | 4974 | Qstring_lessp = intern ("string-lessp"); |
| 4975 | staticpro (&Qstring_lessp); | 4975 | staticpro (&Qstring_lessp); |
| 4976 | Qprovide = intern ("provide"); | 4976 | Qprovide = intern ("provide"); |