* 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.
(cherry picked from commit
76497a01425e19a6c3a02c1e3031061fa0e7885b)
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);
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);
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)