aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2025-04-19 18:44:52 -0700
committerPaul Eggert2025-04-19 19:31:26 -0700
commitc8eed90eb4d0583dc3463edfad176b9d3f98d11f (patch)
tree2fb288a90f4dd07d3d08c43bbb63feced72189de /src
parent71ee484cac3e0e5b68f006b4cca81c13ca6ce11e (diff)
downloademacs-c8eed90eb4d0583dc3463edfad176b9d3f98d11f.tar.gz
emacs-c8eed90eb4d0583dc3463edfad176b9d3f98d11f.zip
Avoid name clashes with static GnuTLS
Work around a bug in GnuTLS 3.7.11 and earlier: when built statically, its mistakenly exports symbols hash_lookup and hash_string, which collide with Emacs symbols of the same name, preventing temacs from linking statically. Problem reported by Greg A. Woods (Bug#77476). Because GnuTLS never uses hash_lookup or hash_string this issue ordinarily doesn’t seem to prevent temacs from linking to GnuTLS on GNU/Linux, as it’s linked dynamically and the dynamic linker never needs to resolve references to either symbol. However, I suppose a clash or bug could occur even with dynamic linking if Emacs later loads a module that uses either symbol. Although GnuTLS should be fixed, Emacs should link statically to current and older GnuTLS versions in the meantime, and it should avoid potential problems with dynamic linking. Renaming the two clashing names is an easy way to do this. For consistency with the new name for hash_lookup, also rename hash_lookup_with_hash and hash_lookup_get_hash. * src/fns.c (hash_find_with_hash): Rename from hash_lookup_with_hash. (hash_find): Rename from hash_lookup. (hash_find_get_hash): Rename from hash_lookup_get_hash. (hash_char_array): Rename from hash_string. All uses changed.
Diffstat (limited to 'src')
-rw-r--r--src/bytecode.c2
-rw-r--r--src/category.c2
-rw-r--r--src/ccl.c4
-rw-r--r--src/charset.c3
-rw-r--r--src/charset.h2
-rw-r--r--src/coding.h2
-rw-r--r--src/composite.c2
-rw-r--r--src/emacs-module.c6
-rw-r--r--src/fns.c28
-rw-r--r--src/image.c6
-rw-r--r--src/json.c2
-rw-r--r--src/lisp.h8
-rw-r--r--src/lread.c16
-rw-r--r--src/macfont.m4
-rw-r--r--src/minibuf.c2
15 files changed, 44 insertions, 45 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index ecea0c6df36..4475d4a0b30 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -1763,7 +1763,7 @@ exec_byte_code (Lisp_Object fun, ptrdiff_t args_template,
1763 } 1763 }
1764 else 1764 else
1765 { 1765 {
1766 ptrdiff_t i = hash_lookup (h, v1); 1766 ptrdiff_t i = hash_find (h, v1);
1767 if (i >= 0) 1767 if (i >= 0)
1768 { 1768 {
1769 op = XFIXNUM (HASH_VALUE (h, i)); 1769 op = XFIXNUM (HASH_VALUE (h, i));
diff --git a/src/category.c b/src/category.c
index 297ba94c73d..f65c7d94331 100644
--- a/src/category.c
+++ b/src/category.c
@@ -54,7 +54,7 @@ hash_get_category_set (Lisp_Object table, Lisp_Object category_set)
54 make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None)); 54 make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None));
55 struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]); 55 struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
56 hash_hash_t hash; 56 hash_hash_t hash;
57 ptrdiff_t i = hash_lookup_get_hash (h, category_set, &hash); 57 ptrdiff_t i = hash_find_get_hash (h, category_set, &hash);
58 if (i >= 0) 58 if (i >= 0)
59 return HASH_KEY (h, i); 59 return HASH_KEY (h, i);
60 hash_put (h, category_set, Qnil, hash); 60 hash_put (h, category_set, Qnil, hash);
diff --git a/src/ccl.c b/src/ccl.c
index a45fe0439c4..36094ca627e 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -1375,7 +1375,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1375 1375
1376 eop = (FIXNUM_OVERFLOW_P (reg[RRR]) 1376 eop = (FIXNUM_OVERFLOW_P (reg[RRR])
1377 ? -1 1377 ? -1
1378 : hash_lookup (h, make_fixnum (reg[RRR]))); 1378 : hash_find (h, make_fixnum (reg[RRR])));
1379 if (eop >= 0) 1379 if (eop >= 0)
1380 { 1380 {
1381 Lisp_Object opl; 1381 Lisp_Object opl;
@@ -1404,7 +1404,7 @@ ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size
1404 1404
1405 eop = (FIXNUM_OVERFLOW_P (i) 1405 eop = (FIXNUM_OVERFLOW_P (i)
1406 ? -1 1406 ? -1
1407 : hash_lookup (h, make_fixnum (i))); 1407 : hash_find (h, make_fixnum (i)));
1408 if (eop >= 0) 1408 if (eop >= 0)
1409 { 1409 {
1410 Lisp_Object opl; 1410 Lisp_Object opl;
diff --git a/src/charset.c b/src/charset.c
index 797dfde276f..3264d75f92e 100644
--- a/src/charset.c
+++ b/src/charset.c
@@ -1112,8 +1112,7 @@ usage: (define-charset-internal ...) */)
1112 1112
1113 hash_hash_t hash_code; 1113 hash_hash_t hash_code;
1114 ptrdiff_t hash_index 1114 ptrdiff_t hash_index
1115 = hash_lookup_get_hash (hash_table, args[charset_arg_name], 1115 = hash_find_get_hash (hash_table, args[charset_arg_name], &hash_code);
1116 &hash_code);
1117 if (hash_index >= 0) 1116 if (hash_index >= 0)
1118 { 1117 {
1119 new_definition_p = false; 1118 new_definition_p = false;
diff --git a/src/charset.h b/src/charset.h
index 0217ec321ff..f76e9100892 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -285,7 +285,7 @@ extern int emacs_mule_charset[256];
285/* Return an index to Vcharset_hash_table of the charset whose symbol 285/* Return an index to Vcharset_hash_table of the charset whose symbol
286 is SYMBOL. */ 286 is SYMBOL. */
287#define CHARSET_SYMBOL_HASH_INDEX(symbol) \ 287#define CHARSET_SYMBOL_HASH_INDEX(symbol) \
288 hash_lookup (XHASH_TABLE (Vcharset_hash_table), symbol) 288 hash_find (XHASH_TABLE (Vcharset_hash_table), symbol)
289 289
290/* Return the attribute vector of CHARSET. */ 290/* Return the attribute vector of CHARSET. */
291#define CHARSET_ATTRIBUTES(charset) (charset)->attributes 291#define CHARSET_ATTRIBUTES(charset) (charset)->attributes
diff --git a/src/coding.h b/src/coding.h
index b72ffde3c55..2d538ba69d3 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -193,7 +193,7 @@ enum coding_attr_index
193/* Return the ID of CODING_SYSTEM_SYMBOL. */ 193/* Return the ID of CODING_SYSTEM_SYMBOL. */
194 194
195#define CODING_SYSTEM_ID(coding_system_symbol) \ 195#define CODING_SYSTEM_ID(coding_system_symbol) \
196 hash_lookup (XHASH_TABLE (Vcoding_system_hash_table), \ 196 hash_find (XHASH_TABLE (Vcoding_system_hash_table), \
197 coding_system_symbol) 197 coding_system_symbol)
198 198
199/* Return true if CODING_SYSTEM_SYMBOL is a coding system. */ 199/* Return true if CODING_SYSTEM_SYMBOL is a coding system. */
diff --git a/src/composite.c b/src/composite.c
index 2ef72a33d2e..b6c5b61a6a9 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -241,7 +241,7 @@ get_composition_id (ptrdiff_t charpos, ptrdiff_t bytepos, ptrdiff_t nchars,
241 goto invalid_composition; 241 goto invalid_composition;
242 242
243 hash_hash_t hash_code; 243 hash_hash_t hash_code;
244 hash_index = hash_lookup_get_hash (hash_table, key, &hash_code); 244 hash_index = hash_find_get_hash (hash_table, key, &hash_code);
245 if (hash_index >= 0) 245 if (hash_index >= 0)
246 { 246 {
247 /* We have already registered the same composition. Change PROP 247 /* We have already registered the same composition. Change PROP
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 7797b04e026..2feca41e7ae 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -413,7 +413,7 @@ static bool
413module_global_reference_p (emacs_value v, ptrdiff_t *n) 413module_global_reference_p (emacs_value v, ptrdiff_t *n)
414{ 414{
415 struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash); 415 struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
416 /* Note that we can't use `hash_lookup' because V might be a local 416 /* Note that we can't use `hash_find' because V might be a local
417 reference that's identical to some global reference. */ 417 reference that's identical to some global reference. */
418 DOHASH (h, k, val) 418 DOHASH (h, k, val)
419 if (&XMODULE_GLOBAL_REFERENCE (val)->value == v) 419 if (&XMODULE_GLOBAL_REFERENCE (val)->value == v)
@@ -431,7 +431,7 @@ module_make_global_ref (emacs_env *env, emacs_value value)
431 struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash); 431 struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
432 Lisp_Object new_obj = value_to_lisp (value); 432 Lisp_Object new_obj = value_to_lisp (value);
433 hash_hash_t hashcode; 433 hash_hash_t hashcode;
434 ptrdiff_t i = hash_lookup_get_hash (h, new_obj, &hashcode); 434 ptrdiff_t i = hash_find_get_hash (h, new_obj, &hashcode);
435 435
436 /* Note: This approach requires the garbage collector to never move 436 /* Note: This approach requires the garbage collector to never move
437 objects. */ 437 objects. */
@@ -470,7 +470,7 @@ module_free_global_ref (emacs_env *env, emacs_value global_value)
470 MODULE_FUNCTION_BEGIN (); 470 MODULE_FUNCTION_BEGIN ();
471 struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash); 471 struct Lisp_Hash_Table *h = XHASH_TABLE (Vmodule_refs_hash);
472 Lisp_Object obj = value_to_lisp (global_value); 472 Lisp_Object obj = value_to_lisp (global_value);
473 ptrdiff_t i = hash_lookup (h, obj); 473 ptrdiff_t i = hash_find (h, obj);
474 474
475 if (module_assertions) 475 if (module_assertions)
476 { 476 {
diff --git a/src/fns.c b/src/fns.c
index e9643627bfa..52f667a72a5 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2815,8 +2815,8 @@ equal_no_quit (Lisp_Object o1, Lisp_Object o2)
2815 return internal_equal (o1, o2, EQUAL_NO_QUIT, 0, Qnil); 2815 return internal_equal (o1, o2, EQUAL_NO_QUIT, 0, Qnil);
2816} 2816}
2817 2817
2818static ptrdiff_t hash_lookup_with_hash (struct Lisp_Hash_Table *h, 2818static ptrdiff_t hash_find_with_hash (struct Lisp_Hash_Table *h,
2819 Lisp_Object key, hash_hash_t hash); 2819 Lisp_Object key, hash_hash_t hash);
2820 2820
2821 2821
2822/* Return true if O1 and O2 are equal. EQUAL_KIND specifies what kind 2822/* Return true if O1 and O2 are equal. EQUAL_KIND specifies what kind
@@ -2848,7 +2848,7 @@ internal_equal_1 (Lisp_Object o1, Lisp_Object o2, enum equal_kind equal_kind,
2848 { 2848 {
2849 struct Lisp_Hash_Table *h = XHASH_TABLE (*ht); 2849 struct Lisp_Hash_Table *h = XHASH_TABLE (*ht);
2850 hash_hash_t hash = hash_from_key (h, o1); 2850 hash_hash_t hash = hash_from_key (h, o1);
2851 ptrdiff_t i = hash_lookup_with_hash (h, o1, hash); 2851 ptrdiff_t i = hash_find_with_hash (h, o1, hash);
2852 if (i >= 0) 2852 if (i >= 0)
2853 { /* `o1' was seen already. */ 2853 { /* `o1' was seen already. */
2854 Lisp_Object o2s = HASH_VALUE (h, i); 2854 Lisp_Object o2s = HASH_VALUE (h, i);
@@ -5031,8 +5031,8 @@ hash_table_thaw (Lisp_Object hash_table)
5031/* Look up KEY with hash HASH in table H. 5031/* Look up KEY with hash HASH in table H.
5032 Return entry index or -1 if none. */ 5032 Return entry index or -1 if none. */
5033static ptrdiff_t 5033static ptrdiff_t
5034hash_lookup_with_hash (struct Lisp_Hash_Table *h, 5034hash_find_with_hash (struct Lisp_Hash_Table *h,
5035 Lisp_Object key, hash_hash_t hash) 5035 Lisp_Object key, hash_hash_t hash)
5036{ 5036{
5037 ptrdiff_t start_of_bucket = hash_index_index (h, hash); 5037 ptrdiff_t start_of_bucket = hash_index_index (h, hash);
5038 for (ptrdiff_t i = HASH_INDEX (h, start_of_bucket); 5038 for (ptrdiff_t i = HASH_INDEX (h, start_of_bucket);
@@ -5048,20 +5048,20 @@ hash_lookup_with_hash (struct Lisp_Hash_Table *h,
5048 5048
5049/* Look up KEY in table H. Return entry index or -1 if none. */ 5049/* Look up KEY in table H. Return entry index or -1 if none. */
5050ptrdiff_t 5050ptrdiff_t
5051hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key) 5051hash_find (struct Lisp_Hash_Table *h, Lisp_Object key)
5052{ 5052{
5053 return hash_lookup_with_hash (h, key, hash_from_key (h, key)); 5053 return hash_find_with_hash (h, key, hash_from_key (h, key));
5054} 5054}
5055 5055
5056/* Look up KEY in hash table H. Return its hash value in *PHASH. 5056/* Look up KEY in hash table H. Return its hash value in *PHASH.
5057 Value is the index of the entry in H matching KEY, or -1 if not found. */ 5057 Value is the index of the entry in H matching KEY, or -1 if not found. */
5058ptrdiff_t 5058ptrdiff_t
5059hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key, 5059hash_find_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
5060 hash_hash_t *phash) 5060 hash_hash_t *phash)
5061{ 5061{
5062 EMACS_UINT hash = hash_from_key (h, key); 5062 EMACS_UINT hash = hash_from_key (h, key);
5063 *phash = hash; 5063 *phash = hash;
5064 return hash_lookup_with_hash (h, key, hash); 5064 return hash_find_with_hash (h, key, hash);
5065} 5065}
5066 5066
5067static void 5067static void
@@ -5286,7 +5286,7 @@ sweep_weak_table (struct Lisp_Hash_Table *h, bool remove_entries_p)
5286 can be any EMACS_UINT value. */ 5286 can be any EMACS_UINT value. */
5287 5287
5288EMACS_UINT 5288EMACS_UINT
5289hash_string (char const *ptr, ptrdiff_t len) 5289hash_char_array (char const *ptr, ptrdiff_t len)
5290{ 5290{
5291 char const *p = ptr; 5291 char const *p = ptr;
5292 char const *end = ptr + len; 5292 char const *end = ptr + len;
@@ -5459,7 +5459,7 @@ sxhash_obj (Lisp_Object obj, int depth)
5459 return XHASH (obj); 5459 return XHASH (obj);
5460 5460
5461 case Lisp_String: 5461 case Lisp_String:
5462 return hash_string (SSDATA (obj), SBYTES (obj)); 5462 return hash_char_array (SSDATA (obj), SBYTES (obj));
5463 5463
5464 case Lisp_Vectorlike: 5464 case Lisp_Vectorlike:
5465 { 5465 {
@@ -5861,7 +5861,7 @@ usage: (gethash KEY TABLE &optional DEFAULT) */)
5861 (Lisp_Object key, Lisp_Object table, Lisp_Object dflt) 5861 (Lisp_Object key, Lisp_Object table, Lisp_Object dflt)
5862{ 5862{
5863 struct Lisp_Hash_Table *h = check_hash_table (table); 5863 struct Lisp_Hash_Table *h = check_hash_table (table);
5864 ptrdiff_t i = hash_lookup (h, key); 5864 ptrdiff_t i = hash_find (h, key);
5865 return i >= 0 ? HASH_VALUE (h, i) : dflt; 5865 return i >= 0 ? HASH_VALUE (h, i) : dflt;
5866} 5866}
5867 5867
@@ -5876,7 +5876,7 @@ VALUE. In any case, return VALUE. */)
5876 check_mutable_hash_table (table, h); 5876 check_mutable_hash_table (table, h);
5877 5877
5878 EMACS_UINT hash = hash_from_key (h, key); 5878 EMACS_UINT hash = hash_from_key (h, key);
5879 ptrdiff_t i = hash_lookup_with_hash (h, key, hash); 5879 ptrdiff_t i = hash_find_with_hash (h, key, hash);
5880 if (i >= 0) 5880 if (i >= 0)
5881 set_hash_value_slot (h, i, value); 5881 set_hash_value_slot (h, i, value);
5882 else 5882 else
diff --git a/src/image.c b/src/image.c
index 65d8db24adc..1d3faecf507 100644
--- a/src/image.c
+++ b/src/image.c
@@ -5552,7 +5552,7 @@ xpm_free_color_cache (void)
5552static int 5552static int
5553xpm_color_bucket (char *color_name) 5553xpm_color_bucket (char *color_name)
5554{ 5554{
5555 EMACS_UINT hash = hash_string (color_name, strlen (color_name)); 5555 EMACS_UINT hash = hash_char_array (color_name, strlen (color_name));
5556 return hash % XPM_COLOR_CACHE_BUCKETS; 5556 return hash % XPM_COLOR_CACHE_BUCKETS;
5557} 5557}
5558 5558
@@ -6238,7 +6238,7 @@ xpm_put_color_table_h (Lisp_Object color_table,
6238 Lisp_Object chars = make_unibyte_string (chars_start, chars_len); 6238 Lisp_Object chars = make_unibyte_string (chars_start, chars_len);
6239 6239
6240 hash_hash_t hash_code; 6240 hash_hash_t hash_code;
6241 hash_lookup_get_hash (table, chars, &hash_code); 6241 hash_find_get_hash (table, chars, &hash_code);
6242 hash_put (table, chars, color, hash_code); 6242 hash_put (table, chars, color, hash_code);
6243} 6243}
6244 6244
@@ -6249,7 +6249,7 @@ xpm_get_color_table_h (Lisp_Object color_table,
6249{ 6249{
6250 struct Lisp_Hash_Table *table = XHASH_TABLE (color_table); 6250 struct Lisp_Hash_Table *table = XHASH_TABLE (color_table);
6251 ptrdiff_t i = 6251 ptrdiff_t i =
6252 hash_lookup (table, make_unibyte_string (chars_start, chars_len)); 6252 hash_find (table, make_unibyte_string (chars_start, chars_len));
6253 6253
6254 return i >= 0 ? HASH_VALUE (table, i) : Qnil; 6254 return i >= 0 ? HASH_VALUE (table, i) : Qnil;
6255} 6255}
diff --git a/src/json.c b/src/json.c
index 5795c582ce0..beac242b709 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1571,7 +1571,7 @@ json_parse_object (struct json_parser *parser)
1571 hash_hash_t hash; 1571 hash_hash_t hash;
1572 Lisp_Object key = parser->object_workspace[i]; 1572 Lisp_Object key = parser->object_workspace[i];
1573 Lisp_Object value = parser->object_workspace[i + 1]; 1573 Lisp_Object value = parser->object_workspace[i + 1];
1574 ptrdiff_t i = hash_lookup_get_hash (h, key, &hash); 1574 ptrdiff_t i = hash_find_get_hash (h, key, &hash);
1575 if (i < 0) 1575 if (i < 0)
1576 hash_put (h, key, value, hash); 1576 hash_put (h, key, value, hash);
1577 else 1577 else
diff --git a/src/lisp.h b/src/lisp.h
index bca58b9c12d..c2450440ab9 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -4261,14 +4261,14 @@ extern Lisp_Object larger_vector (Lisp_Object, ptrdiff_t, ptrdiff_t);
4261extern bool sweep_weak_table (struct Lisp_Hash_Table *, bool); 4261extern bool sweep_weak_table (struct Lisp_Hash_Table *, bool);
4262extern void hexbuf_digest (char *, void const *, int); 4262extern void hexbuf_digest (char *, void const *, int);
4263extern char *extract_data_from_object (Lisp_Object, ptrdiff_t *, ptrdiff_t *); 4263extern char *extract_data_from_object (Lisp_Object, ptrdiff_t *, ptrdiff_t *);
4264EMACS_UINT hash_string (char const *, ptrdiff_t); 4264EMACS_UINT hash_char_array (char const *, ptrdiff_t);
4265EMACS_UINT sxhash (Lisp_Object); 4265EMACS_UINT sxhash (Lisp_Object);
4266Lisp_Object make_hash_table (const struct hash_table_test *, EMACS_INT, 4266Lisp_Object make_hash_table (const struct hash_table_test *, EMACS_INT,
4267 hash_table_weakness_t); 4267 hash_table_weakness_t);
4268Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak); 4268Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak);
4269ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object); 4269ptrdiff_t hash_find (struct Lisp_Hash_Table *, Lisp_Object);
4270ptrdiff_t hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key, 4270ptrdiff_t hash_find_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
4271 hash_hash_t *phash); 4271 hash_hash_t *phash);
4272ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object, 4272ptrdiff_t hash_put (struct Lisp_Hash_Table *, Lisp_Object, Lisp_Object,
4273 hash_hash_t); 4273 hash_hash_t);
4274void hash_remove_from_table (struct Lisp_Hash_Table *, Lisp_Object); 4274void hash_remove_from_table (struct Lisp_Hash_Table *, Lisp_Object);
diff --git a/src/lread.c b/src/lread.c
index d39330bd0eb..5c8bbe7da9f 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -4266,7 +4266,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
4266 = XHASH_TABLE (read_objects_map); 4266 = XHASH_TABLE (read_objects_map);
4267 Lisp_Object number = make_fixnum (n); 4267 Lisp_Object number = make_fixnum (n);
4268 hash_hash_t hash; 4268 hash_hash_t hash;
4269 ptrdiff_t i = hash_lookup_get_hash (h, number, &hash); 4269 ptrdiff_t i = hash_find_get_hash (h, number, &hash);
4270 if (i >= 0) 4270 if (i >= 0)
4271 /* Not normal, but input could be malformed. */ 4271 /* Not normal, but input could be malformed. */
4272 set_hash_value_slot (h, i, placeholder); 4272 set_hash_value_slot (h, i, placeholder);
@@ -4284,7 +4284,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
4284 /* #N# -- reference to numbered object */ 4284 /* #N# -- reference to numbered object */
4285 struct Lisp_Hash_Table *h 4285 struct Lisp_Hash_Table *h
4286 = XHASH_TABLE (read_objects_map); 4286 = XHASH_TABLE (read_objects_map);
4287 ptrdiff_t i = hash_lookup (h, make_fixnum (n)); 4287 ptrdiff_t i = hash_find (h, make_fixnum (n));
4288 if (i < 0) 4288 if (i < 0)
4289 INVALID_SYNTAX_WITH_BUFFER (); 4289 INVALID_SYNTAX_WITH_BUFFER ();
4290 obj = HASH_VALUE (h, i); 4290 obj = HASH_VALUE (h, i);
@@ -4579,7 +4579,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
4579 struct Lisp_Hash_Table *h2 4579 struct Lisp_Hash_Table *h2
4580 = XHASH_TABLE (read_objects_completed); 4580 = XHASH_TABLE (read_objects_completed);
4581 hash_hash_t hash; 4581 hash_hash_t hash;
4582 ptrdiff_t i = hash_lookup_get_hash (h2, placeholder, &hash); 4582 ptrdiff_t i = hash_find_get_hash (h2, placeholder, &hash);
4583 eassert (i < 0); 4583 eassert (i < 0);
4584 hash_put (h2, placeholder, Qnil, hash); 4584 hash_put (h2, placeholder, Qnil, hash);
4585 obj = placeholder; 4585 obj = placeholder;
@@ -4594,7 +4594,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
4594 struct Lisp_Hash_Table *h2 4594 struct Lisp_Hash_Table *h2
4595 = XHASH_TABLE (read_objects_completed); 4595 = XHASH_TABLE (read_objects_completed);
4596 hash_hash_t hash; 4596 hash_hash_t hash;
4597 ptrdiff_t i = hash_lookup_get_hash (h2, obj, &hash); 4597 ptrdiff_t i = hash_find_get_hash (h2, obj, &hash);
4598 eassert (i < 0); 4598 eassert (i < 0);
4599 hash_put (h2, obj, Qnil, hash); 4599 hash_put (h2, obj, Qnil, hash);
4600 } 4600 }
@@ -4606,8 +4606,8 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
4606 /* ...and #n# will use the real value from now on. */ 4606 /* ...and #n# will use the real value from now on. */
4607 struct Lisp_Hash_Table *h = XHASH_TABLE (read_objects_map); 4607 struct Lisp_Hash_Table *h = XHASH_TABLE (read_objects_map);
4608 hash_hash_t hash; 4608 hash_hash_t hash;
4609 ptrdiff_t i = hash_lookup_get_hash (h, e->u.numbered.number, 4609 ptrdiff_t i = hash_find_get_hash (h, e->u.numbered.number,
4610 &hash); 4610 &hash);
4611 eassert (i >= 0); 4611 eassert (i >= 0);
4612 set_hash_value_slot (h, i, obj); 4612 set_hash_value_slot (h, i, obj);
4613 } 4613 }
@@ -4661,7 +4661,7 @@ substitute_object_recurse (struct subst *subst, Lisp_Object subtree)
4661 by #n=, which means that we can find it as a value in 4661 by #n=, which means that we can find it as a value in
4662 COMPLETED. */ 4662 COMPLETED. */
4663 if (EQ (subst->completed, Qt) 4663 if (EQ (subst->completed, Qt)
4664 || hash_lookup (XHASH_TABLE (subst->completed), subtree) >= 0) 4664 || hash_find (XHASH_TABLE (subst->completed), subtree) >= 0)
4665 subst->seen = Fcons (subtree, subst->seen); 4665 subst->seen = Fcons (subtree, subst->seen);
4666 4666
4667 /* Recurse according to subtree's type. 4667 /* Recurse according to subtree's type.
@@ -5173,7 +5173,7 @@ OBARRAY, if nil, defaults to the value of the variable `obarray'. */)
5173static ptrdiff_t 5173static ptrdiff_t
5174obarray_index (struct Lisp_Obarray *oa, const char *str, ptrdiff_t size_byte) 5174obarray_index (struct Lisp_Obarray *oa, const char *str, ptrdiff_t size_byte)
5175{ 5175{
5176 EMACS_UINT hash = hash_string (str, size_byte); 5176 EMACS_UINT hash = hash_char_array (str, size_byte);
5177 return knuth_hash (reduce_emacs_uint_to_hash_hash (hash), oa->size_bits); 5177 return knuth_hash (reduce_emacs_uint_to_hash_hash (hash), oa->size_bits);
5178} 5178}
5179 5179
diff --git a/src/macfont.m b/src/macfont.m
index 4ff720c5dd2..2a0b9aa2554 100644
--- a/src/macfont.m
+++ b/src/macfont.m
@@ -1018,7 +1018,7 @@ macfont_get_family_cache_if_present (Lisp_Object symbol, CFStringRef *string)
1018 if (HASH_TABLE_P (macfont_family_cache)) 1018 if (HASH_TABLE_P (macfont_family_cache))
1019 { 1019 {
1020 struct Lisp_Hash_Table *h = XHASH_TABLE (macfont_family_cache); 1020 struct Lisp_Hash_Table *h = XHASH_TABLE (macfont_family_cache);
1021 ptrdiff_t i = hash_lookup (h, symbol); 1021 ptrdiff_t i = hash_find (h, symbol);
1022 1022
1023 if (i >= 0) 1023 if (i >= 0)
1024 { 1024 {
@@ -1045,7 +1045,7 @@ macfont_set_family_cache (Lisp_Object symbol, CFStringRef string)
1045 1045
1046 h = XHASH_TABLE (macfont_family_cache); 1046 h = XHASH_TABLE (macfont_family_cache);
1047 hash_hash_t hash; 1047 hash_hash_t hash;
1048 i = hash_lookup_get_hash (h, symbol, &hash); 1048 i = hash_find_get_hash (h, symbol, &hash);
1049 value = string ? make_mint_ptr ((void *) CFRetain (string)) : Qnil; 1049 value = string ? make_mint_ptr ((void *) CFRetain (string)) : Qnil;
1050 if (i >= 0) 1050 if (i >= 0)
1051 { 1051 {
diff --git a/src/minibuf.c b/src/minibuf.c
index 28ec780b24e..6d96160a851 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2103,7 +2103,7 @@ the values STRING, PREDICATE and `lambda'. */)
2103 else if (HASH_TABLE_P (collection)) 2103 else if (HASH_TABLE_P (collection))
2104 { 2104 {
2105 struct Lisp_Hash_Table *h = XHASH_TABLE (collection); 2105 struct Lisp_Hash_Table *h = XHASH_TABLE (collection);
2106 ptrdiff_t i = hash_lookup (h, string); 2106 ptrdiff_t i = hash_find (h, string);
2107 if (i >= 0) 2107 if (i >= 0)
2108 { 2108 {
2109 tem = HASH_KEY (h, i); 2109 tem = HASH_KEY (h, i);