From 10a45096988f6f19e36e2e7865b6eb35c0929b6d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 10 Sep 2018 08:59:39 -0700 Subject: [PATCH] =?utf8?q?Fix=20misleading=20name=20=E2=80=98double=5Fto?= =?utf8?q?=5Fbignum=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/bignum.c (double_to_integer): Rename from double_to_bignum, since the result is not necessarily a bignum. All uses changed. --- src/bignum.c | 4 ++-- src/editfns.c | 2 +- src/floatfns.c | 2 +- src/lisp.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/bignum.c b/src/bignum.c index 35894f5647d..f4c24d132be 100644 --- a/src/bignum.c +++ b/src/bignum.c @@ -64,9 +64,9 @@ bignum_to_double (Lisp_Object n) return mpz_get_d (XBIGNUM (n)->value); } -/* Return D, converted to a bignum. Discard any fraction. */ +/* Return D, converted to a Lisp integer. Discard any fraction. */ Lisp_Object -double_to_bignum (double d) +double_to_integer (double d) { mpz_set_d (mpz[0], d); return make_integer_mpz (); diff --git a/src/editfns.c b/src/editfns.c index f19c3f1dca9..8c7491beedc 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -4657,7 +4657,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) /* Characters to be inserted after spaces and before leading zeros. This can occur with bignums, since - string_to_bignum does only leading '-'. */ + bignum_to_string does only leading '-'. */ char prefix[sizeof "-0x" - 1]; int prefixlen = 0; diff --git a/src/floatfns.c b/src/floatfns.c index dc7236353c0..8e56fed9d09 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -391,7 +391,7 @@ rounding_driver (Lisp_Object arg, Lisp_Object divisor, if (! FIXNUM_OVERFLOW_P (ir)) return make_fixnum (ir); } - return double_to_bignum (dr); + return double_to_integer (dr); } static EMACS_INT diff --git a/src/lisp.h b/src/lisp.h index f2a3ac92132..454d728f9e0 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3327,7 +3327,7 @@ extern ptrdiff_t bignum_bufsize (Lisp_Object, int); extern ptrdiff_t bignum_to_c_string (char *, ptrdiff_t, Lisp_Object, int); extern Lisp_Object bignum_to_string (Lisp_Object, int); extern Lisp_Object make_bignum_str (char const *, int); -extern Lisp_Object double_to_bignum (double); +extern Lisp_Object double_to_integer (double); /* Converthe integer NUM to *N. Return true if successful, false (possibly setting *N) otherwise. */ -- 2.39.2