Change list-length intptr_t to ptrdiff_t
* src/fns.c (list_length, Fsafe_length, Fproper_list_p): Use ptrdiff_t not intptr_t for accumulator, since result is ptrdiff_t. This fixes a minor glitch in 2019-01-11T05:35:31!eggert@cs.ucla.edu where I removed unnecessary overflow checks but forgot to change types. This change should alter generated code only on oddball platforms where ptrdiff_t is narrower than intptr_t, e.g., CheriBSD.
This commit is contained in:
parent
55fefe06ef
commit
76497a0142
1 changed files with 3 additions and 3 deletions
|
|
@ -117,7 +117,7 @@ See Info node `(elisp)Random Numbers' for more details. */)
|
|||
ptrdiff_t
|
||||
list_length (Lisp_Object list)
|
||||
{
|
||||
intptr_t i = 0;
|
||||
ptrdiff_t i = 0;
|
||||
FOR_EACH_TAIL (list)
|
||||
i++;
|
||||
CHECK_LIST_END (list, list);
|
||||
|
|
@ -167,7 +167,7 @@ it returns 0. If LIST is circular, it returns an integer that is at
|
|||
least the number of distinct elements. */)
|
||||
(Lisp_Object list)
|
||||
{
|
||||
intptr_t len = 0;
|
||||
ptrdiff_t len = 0;
|
||||
FOR_EACH_TAIL_SAFE (list)
|
||||
len++;
|
||||
return make_fixnum (len);
|
||||
|
|
@ -248,7 +248,7 @@ A proper list is neither circular nor dotted (i.e., its last cdr is nil). */
|
|||
attributes: const)
|
||||
(Lisp_Object object)
|
||||
{
|
||||
intptr_t len = 0;
|
||||
ptrdiff_t len = 0;
|
||||
Lisp_Object last_tail = object;
|
||||
Lisp_Object tail = object;
|
||||
FOR_EACH_TAIL_SAFE (tail)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue