summaryrefslogtreecommitdiff
path: root/src/category.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-07-20 19:40:03 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2019-07-20 20:13:46 -0700
commitb6f194a0fb6dbd1b19aa01f95a955f5b8b23b40e (patch)
tree009e3beff4781c98e733657d60003b3eee97e068 /src/category.c
parent5018b663c6c0d31f27fb44630a69d9e0bd73273d (diff)
downloademacs-b6f194a0fb6dbd1b19aa01f95a955f5b8b23b40e.tar.gz
Simplify hashfn/cmpfn calling convention
* src/fns.c (cmpfn_eql, cmpfn_equal, cmpfn_user_defined) (hashfn_eq, hashfn_equal, hashfn_eql, hashfn_user_defined): * src/profiler.c (cmpfn_profiler, hashfn_profiler): Use new calling convention where the return value is a fixnum instead of EMACS_UINT. While we’re at it, put the hash table at the end, since that’s a bit simpler and generates better code (at least on the x86-64). All callers changed. * src/fns.c (hash_lookup): Store fixnum rather than EMACS_UINT. All callers changed. (hash_put): Take a fixnum rather than an EMACS_UINT. All callers changed. Remove unnecessary eassert (XUFIXNUM does it). * src/lisp.h (struct hash_table_test): Adjust signatures of cmpfn and hashfn.
Diffstat (limited to 'src/category.c')
-rw-r--r--src/category.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/category.c b/src/category.c
index 132fae9d404..9e460cfc64e 100644
--- a/src/category.c
+++ b/src/category.c
@@ -48,18 +48,15 @@ bset_category_table (struct buffer *b, Lisp_Object val)
static Lisp_Object
hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
{
- struct Lisp_Hash_Table *h;
- ptrdiff_t i;
- EMACS_UINT hash;
-
if (NILP (XCHAR_TABLE (table)->extras[1]))
set_char_table_extras
(table, 1,
make_hash_table (hashtest_equal, DEFAULT_HASH_SIZE,
DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD,
Qnil, false));
- h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
- i = hash_lookup (h, category_set, &hash);
+ struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
+ Lisp_Object hash;
+ ptrdiff_t i = hash_lookup (h, category_set, &hash);
if (i >= 0)
return HASH_KEY (h, i);
hash_put (h, category_set, Qnil, hash);