diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-07-18 23:07:07 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-07-18 23:07:07 -0700 |
commit | d3411f89d34bd1009cae738f917abf477be09882 (patch) | |
tree | 1faf0e2f21f2ea5e19a33eb5ae1c4ae633a1f1ea /src/fns.c | |
parent | e097a6fa863b26952a476e71a786fa7b2460277b (diff) | |
download | emacs-d3411f89d34bd1009cae738f917abf477be09882.tar.gz emacs-d3411f89d34bd1009cae738f917abf477be09882.tar.bz2 emacs-d3411f89d34bd1009cae738f917abf477be09882.zip |
Use ptrdiff_t for hash table indexes.
* category.c (hash_get_category_set):
* ccl.c (ccl_driver):
* charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
* coding.c (coding_system_charset_list, detect_coding_system):
* coding.h (struct coding_system.id):
* composite.c (get_composition_id, gstring_lookup_cache):
* fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
* image.c (xpm_get_color_table_h):
* lisp.h (hash_lookup, hash_put):
* minibuf.c (Ftest_completion):
Use ptrdiff_t for hash table indexes, not int (which is too
narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
32-bit --with-wide-int hosts).
Diffstat (limited to 'src/fns.c')
-rw-r--r-- | src/fns.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fns.c b/src/fns.c index 9c9d19fe26a..fdaffe947ac 100644 --- a/src/fns.c +++ b/src/fns.c @@ -3787,11 +3787,11 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h) the hash code of KEY. Value is the index of the entry in H matching KEY, or -1 if not found. */ -EMACS_INT +ptrdiff_t hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key, EMACS_UINT *hash) { EMACS_UINT hash_code; - EMACS_INT start_of_bucket; + ptrdiff_t start_of_bucket; Lisp_Object idx; hash_code = h->hashfn (h, key); @@ -3821,11 +3821,11 @@ hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key, EMACS_UINT *hash) HASH is a previously computed hash code of KEY. Value is the index of the entry in H matching KEY. */ -EMACS_INT +ptrdiff_t hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value, EMACS_UINT hash) { - EMACS_INT start_of_bucket, i; + ptrdiff_t start_of_bucket, i; xassert ((hash & ~INTMASK) == 0); @@ -4482,7 +4482,7 @@ If KEY is not found, return DFLT which defaults to nil. */) (Lisp_Object key, Lisp_Object table, Lisp_Object dflt) { struct Lisp_Hash_Table *h = check_hash_table (table); - EMACS_INT i = hash_lookup (h, key, NULL); + ptrdiff_t i = hash_lookup (h, key, NULL); return i >= 0 ? HASH_VALUE (h, i) : dflt; } @@ -4494,7 +4494,7 @@ VALUE. In any case, return VALUE. */) (Lisp_Object key, Lisp_Object value, Lisp_Object table) { struct Lisp_Hash_Table *h = check_hash_table (table); - EMACS_INT i; + ptrdiff_t i; EMACS_UINT hash; i = hash_lookup (h, key, &hash); |