]> git.eshelyaron.com Git - emacs.git/commit
Be more careful about pointers to bignum vals
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 21 Aug 2019 07:06:00 +0000 (00:06 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 21 Aug 2019 07:11:45 +0000 (00:11 -0700)
commit39fee209942ab7c35b4789f0010264cd6a52197b
tree96f1858c890436713ba0da0fca93d1f33d7dd33a
parent3881542edeac3e94291c2ce574edf0b0e52764a8
Be more careful about pointers to bignum vals

This uses ‘const’ to be better at catching bugs that
mistakenly attempt to modify a bignum value.
Lisp bignums are supposed to be immutable.
* src/alloc.c (make_pure_bignum):
* src/fns.c (sxhash_bignum):
Accept Lisp_Object instead of struct Lisp_Bignum *, as that’s
simpler now.  Caller changed.
* src/bignum.h (bignum_val, xbignum_val): New inline functions.
Prefer them to &i->value and XBIGNUM (i)->value, since they
apply ‘const’ to the result.
* src/timefns.c (lisp_to_timespec): Use mpz_t const *
to point to a bignum value.
src/alloc.c
src/bignum.c
src/bignum.h
src/data.c
src/floatfns.c
src/fns.c
src/pdumper.c
src/timefns.c