aboutsummaryrefslogtreecommitdiffstats
path: root/src/fns.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/fns.c b/src/fns.c
index 9c9d19fe26a..a3af6b8c15a 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -602,7 +602,7 @@ concat (ptrdiff_t nargs, Lisp_Object *args,
602 602
603 prev = Qnil; 603 prev = Qnil;
604 if (STRINGP (val)) 604 if (STRINGP (val))
605 SAFE_ALLOCA (textprops, struct textprop_rec *, sizeof (struct textprop_rec) * nargs); 605 SAFE_NALLOCA (textprops, 1, nargs);
606 606
607 for (argnum = 0; argnum < nargs; argnum++) 607 for (argnum = 0; argnum < nargs; argnum++)
608 { 608 {
@@ -3395,11 +3395,13 @@ check_hash_table (Lisp_Object obj)
3395 3395
3396 3396
3397/* Value is the next integer I >= N, N >= 0 which is "almost" a prime 3397/* Value is the next integer I >= N, N >= 0 which is "almost" a prime
3398 number. */ 3398 number. A number is "almost" a prime number if it is not divisible
3399 by any integer in the range 2 .. (NEXT_ALMOST_PRIME_LIMIT - 1). */
3399 3400
3400EMACS_INT 3401EMACS_INT
3401next_almost_prime (EMACS_INT n) 3402next_almost_prime (EMACS_INT n)
3402{ 3403{
3404 verify (NEXT_ALMOST_PRIME_LIMIT == 11);
3403 for (n |= 1; ; n += 2) 3405 for (n |= 1; ; n += 2)
3404 if (n % 3 != 0 && n % 5 != 0 && n % 7 != 0) 3406 if (n % 3 != 0 && n % 5 != 0 && n % 7 != 0)
3405 return n; 3407 return n;
@@ -3787,11 +3789,11 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
3787 the hash code of KEY. Value is the index of the entry in H 3789 the hash code of KEY. Value is the index of the entry in H
3788 matching KEY, or -1 if not found. */ 3790 matching KEY, or -1 if not found. */
3789 3791
3790EMACS_INT 3792ptrdiff_t
3791hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key, EMACS_UINT *hash) 3793hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key, EMACS_UINT *hash)
3792{ 3794{
3793 EMACS_UINT hash_code; 3795 EMACS_UINT hash_code;
3794 EMACS_INT start_of_bucket; 3796 ptrdiff_t start_of_bucket;
3795 Lisp_Object idx; 3797 Lisp_Object idx;
3796 3798
3797 hash_code = h->hashfn (h, key); 3799 hash_code = h->hashfn (h, key);
@@ -3821,11 +3823,11 @@ hash_lookup (struct Lisp_Hash_Table *h, Lisp_Object key, EMACS_UINT *hash)
3821 HASH is a previously computed hash code of KEY. 3823 HASH is a previously computed hash code of KEY.
3822 Value is the index of the entry in H matching KEY. */ 3824 Value is the index of the entry in H matching KEY. */
3823 3825
3824EMACS_INT 3826ptrdiff_t
3825hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value, 3827hash_put (struct Lisp_Hash_Table *h, Lisp_Object key, Lisp_Object value,
3826 EMACS_UINT hash) 3828 EMACS_UINT hash)
3827{ 3829{
3828 EMACS_INT start_of_bucket, i; 3830 ptrdiff_t start_of_bucket, i;
3829 3831
3830 xassert ((hash & ~INTMASK) == 0); 3832 xassert ((hash & ~INTMASK) == 0);
3831 3833
@@ -4482,7 +4484,7 @@ If KEY is not found, return DFLT which defaults to nil. */)
4482 (Lisp_Object key, Lisp_Object table, Lisp_Object dflt) 4484 (Lisp_Object key, Lisp_Object table, Lisp_Object dflt)
4483{ 4485{
4484 struct Lisp_Hash_Table *h = check_hash_table (table); 4486 struct Lisp_Hash_Table *h = check_hash_table (table);
4485 EMACS_INT i = hash_lookup (h, key, NULL); 4487 ptrdiff_t i = hash_lookup (h, key, NULL);
4486 return i >= 0 ? HASH_VALUE (h, i) : dflt; 4488 return i >= 0 ? HASH_VALUE (h, i) : dflt;
4487} 4489}
4488 4490
@@ -4494,7 +4496,7 @@ VALUE. In any case, return VALUE. */)
4494 (Lisp_Object key, Lisp_Object value, Lisp_Object table) 4496 (Lisp_Object key, Lisp_Object value, Lisp_Object table)
4495{ 4497{
4496 struct Lisp_Hash_Table *h = check_hash_table (table); 4498 struct Lisp_Hash_Table *h = check_hash_table (table);
4497 EMACS_INT i; 4499 ptrdiff_t i;
4498 EMACS_UINT hash; 4500 EMACS_UINT hash;
4499 4501
4500 i = hash_lookup (h, key, &hash); 4502 i = hash_lookup (h, key, &hash);