diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-08-18 12:11:06 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-08-18 12:12:45 -0700 |
commit | 780509f29f0aa006a578744f7e871eb6d5ce5931 (patch) | |
tree | f8b9af7529ea7d617038eebf12b62299a19750d9 /src/bignum.h | |
parent | f92d61c06c82d515ee83e340b8af4b1489778404 (diff) | |
download | emacs-780509f29f0aa006a578744f7e871eb6d5ce5931.tar.gz emacs-780509f29f0aa006a578744f7e871eb6d5ce5931.tar.bz2 emacs-780509f29f0aa006a578744f7e871eb6d5ce5931.zip |
Improve bignum_integer static checking
* src/bignum.h (bignum_integer): Now returns pointer-to-const,
to catch trivial mistakes where the caller might try to modify
a Lisp bignum. Lisp bignums are supposed to be immutable.
All callers changed.
Diffstat (limited to 'src/bignum.h')
-rw-r--r-- | src/bignum.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bignum.h b/src/bignum.h index 743a18fc0f7..a9c7a0a09a8 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -83,7 +83,7 @@ mpz_set_uintmax (mpz_t result, uintmax_t v) /* Return a pointer to an mpz_t that is equal to the Lisp integer I. If I is a bignum this returns a pointer to I's representation; otherwise this sets *TMP to I's value and returns TMP. */ -INLINE mpz_t * +INLINE mpz_t const * bignum_integer (mpz_t *tmp, Lisp_Object i) { if (FIXNUMP (i)) |