diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/fns.c | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5196eb230d8..a205ea72b7f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-10-09 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * fns.c (hashfn_user_defined): Allow hash functions to return any | ||
| 4 | Lisp_Object. | ||
| 5 | |||
| 1 | 2013-10-08 Paul Eggert <eggert@cs.ucla.edu> | 6 | 2013-10-08 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 7 | ||
| 3 | Fix minor problems found by static checking. | 8 | Fix minor problems found by static checking. |
| @@ -3571,9 +3571,7 @@ hashfn_user_defined (struct hash_table_test *ht, Lisp_Object key) | |||
| 3571 | args[0] = ht->user_hash_function; | 3571 | args[0] = ht->user_hash_function; |
| 3572 | args[1] = key; | 3572 | args[1] = key; |
| 3573 | hash = Ffuncall (2, args); | 3573 | hash = Ffuncall (2, args); |
| 3574 | if (!INTEGERP (hash)) | 3574 | return hashfn_eq (ht, hash); |
| 3575 | signal_error ("Invalid hash code returned from user-supplied hash function", hash); | ||
| 3576 | return XUINT (hash); | ||
| 3577 | } | 3575 | } |
| 3578 | 3576 | ||
| 3579 | /* An upper bound on the size of a hash table index. It must fit in | 3577 | /* An upper bound on the size of a hash table index. It must fit in |
| @@ -4542,9 +4540,9 @@ compare keys, and HASH for computing hash codes of keys. | |||
| 4542 | 4540 | ||
| 4543 | TEST must be a function taking two arguments and returning non-nil if | 4541 | TEST must be a function taking two arguments and returning non-nil if |
| 4544 | both arguments are the same. HASH must be a function taking one | 4542 | both arguments are the same. HASH must be a function taking one |
| 4545 | argument and return an integer that is the hash code of the argument. | 4543 | argument and returning an object that is the hash code of the argument. |
| 4546 | Hash code computation should use the whole value range of integers, | 4544 | It should be the case that if (eq (funcall HASH x1) (funcall HASH x2)) |
| 4547 | including negative integers. */) | 4545 | returns nil, then (funcall TEST x1 x2) also returns nil. */) |
| 4548 | (Lisp_Object name, Lisp_Object test, Lisp_Object hash) | 4546 | (Lisp_Object name, Lisp_Object test, Lisp_Object hash) |
| 4549 | { | 4547 | { |
| 4550 | return Fput (name, Qhash_table_test, list2 (test, hash)); | 4548 | return Fput (name, Qhash_table_test, list2 (test, hash)); |