emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 75dfc1e870 1/2: Port module_bignum_count_max to strict C


From: Paul Eggert
Subject: master 75dfc1e870 1/2: Port module_bignum_count_max to strict C
Date: Mon, 18 Apr 2022 22:47:44 -0400 (EDT)

branch: master
commit 75dfc1e8706d994bd7b18a24360847fd12bd5af0
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Port module_bignum_count_max to strict C
    
    * src/emacs-module.c (module_bignum_count_max): Make
    this a macro, not an enum, since it might not fit into
    int as C99 requires.
---
 src/emacs-module.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/emacs-module.c b/src/emacs-module.c
index 0974a199e5..0d3cce0276 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -955,11 +955,9 @@ single memcpy to convert the magnitude.  This way we 
largely avoid the
 import/export overhead on most platforms.
 */
 
-enum
-{
-  /* Documented maximum count of magnitude elements. */
-  module_bignum_count_max = min (SIZE_MAX, PTRDIFF_MAX) / sizeof (emacs_limb_t)
-};
+/* Documented maximum count of magnitude elements. */
+#define module_bignum_count_max \
+  ((ptrdiff_t) min (SIZE_MAX, PTRDIFF_MAX) / sizeof (emacs_limb_t))
 
 /* Verify that emacs_limb_t indeed has unique object
    representations.  */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]