From: Paul Eggert Date: Fri, 27 Mar 2020 21:17:44 +0000 (-0700) Subject: Use ATTRIBUTE_CONST for some bignum functions X-Git-Tag: emacs-28.0.90~7705 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=90b6ba0a1697c07a668be1776f22246470682724;p=emacs.git Use ATTRIBUTE_CONST for some bignum functions * src/bignum.h (mpz_get_d_rounded): * src/lisp.h (bignum_to_double, bignum_to_intmax) (bignum_to_uintmax, bignum_bufsize): Declare as ATTRIBUTE_CONST. --- diff --git a/src/bignum.h b/src/bignum.h index 0c2541a9dc7..ad9021f15fd 100644 --- a/src/bignum.h +++ b/src/bignum.h @@ -55,7 +55,7 @@ extern void emacs_mpz_mul_2exp (mpz_t, mpz_t const, EMACS_INT) ARG_NONNULL ((1, 2)); extern void emacs_mpz_pow_ui (mpz_t, mpz_t const, unsigned long) ARG_NONNULL ((1, 2)); -extern double mpz_get_d_rounded (mpz_t const); +extern double mpz_get_d_rounded (mpz_t const) ATTRIBUTE_CONST; INLINE_HEADER_BEGIN diff --git a/src/lisp.h b/src/lisp.h index d3b1c39c8fb..f223814d8f3 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -585,7 +585,7 @@ INLINE void set_sub_char_table_contents (Lisp_Object, ptrdiff_t, Lisp_Object); /* Defined in bignum.c. */ -extern double bignum_to_double (Lisp_Object); +extern double bignum_to_double (Lisp_Object) ATTRIBUTE_CONST; extern Lisp_Object make_bigint (intmax_t); extern Lisp_Object make_biguint (uintmax_t); @@ -3484,9 +3484,9 @@ set_sub_char_table_contents (Lisp_Object table, ptrdiff_t idx, Lisp_Object val) /* Defined in bignum.c. This part of bignum.c's API does not require the caller to access bignum internals; see bignum.h for that. */ -extern intmax_t bignum_to_intmax (Lisp_Object); -extern uintmax_t bignum_to_uintmax (Lisp_Object); -extern ptrdiff_t bignum_bufsize (Lisp_Object, int); +extern intmax_t bignum_to_intmax (Lisp_Object) ATTRIBUTE_CONST; +extern uintmax_t bignum_to_uintmax (Lisp_Object) ATTRIBUTE_CONST; +extern ptrdiff_t bignum_bufsize (Lisp_Object, int) ATTRIBUTE_CONST; 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);