aboutsummaryrefslogtreecommitdiffstats
path: root/src/composite.c
diff options
context:
space:
mode:
authorPaul Eggert2019-07-20 19:40:03 -0700
committerPaul Eggert2019-07-20 20:13:46 -0700
commitb6f194a0fb6dbd1b19aa01f95a955f5b8b23b40e (patch)
tree009e3beff4781c98e733657d60003b3eee97e068 /src/composite.c
parent5018b663c6c0d31f27fb44630a69d9e0bd73273d (diff)
downloademacs-b6f194a0fb6dbd1b19aa01f95a955f5b8b23b40e.tar.gz
emacs-b6f194a0fb6dbd1b19aa01f95a955f5b8b23b40e.zip
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/composite.c')
-rw-r--r--src/composite.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/composite.c b/src/composite.c
index 183062de460..c36663f8e97 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -164,11 +164,10 @@ ptrdiff_t
164get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars, 164get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
165 Lisp_Object prop, Lisp_Object string) 165 Lisp_Object prop, Lisp_Object string)
166{ 166{
167 Lisp_Object id, length, components, key, *key_contents; 167 Lisp_Object id, length, components, key, *key_contents, hash_code;
168 ptrdiff_t glyph_len; 168 ptrdiff_t glyph_len;
169 struct Lisp_Hash_Table *hash_table = XHASH_TABLE (composition_hash_table); 169 struct Lisp_Hash_Table *hash_table = XHASH_TABLE (composition_hash_table);
170 ptrdiff_t hash_index; 170 ptrdiff_t hash_index;
171 EMACS_UINT hash_code;
172 enum composition_method method; 171 enum composition_method method;
173 struct composition *cmp; 172 struct composition *cmp;
174 ptrdiff_t i; 173 ptrdiff_t i;
@@ -656,7 +655,7 @@ composition_gstring_put_cache (Lisp_Object gstring, ptrdiff_t len)
656 struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table); 655 struct Lisp_Hash_Table *h = XHASH_TABLE (gstring_hash_table);
657 hash_rehash_if_needed (h); 656 hash_rehash_if_needed (h);
658 Lisp_Object header = LGSTRING_HEADER (gstring); 657 Lisp_Object header = LGSTRING_HEADER (gstring);
659 EMACS_UINT hash = h->test.hashfn (&h->test, header); 658 Lisp_Object hash = h->test.hashfn (header, &h->test);
660 if (len < 0) 659 if (len < 0)
661 { 660 {
662 ptrdiff_t glyph_len = LGSTRING_GLYPH_LEN (gstring); 661 ptrdiff_t glyph_len = LGSTRING_GLYPH_LEN (gstring);