APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1506240962 -3600
# Sun Sep 24 09:16:02 2017 +0100
# Node ID dfe676a17ebadf7f07b8b5afb67f38e30fc65400
# Parent d3e0eec3a5082a28cdff11a9e5629b076abd4a17
Support the full bit width of the underlying Fixnum, const-integer variables
src/ChangeLog addition:
2017-09-24 Aidan Kehoe <kehoea(a)parhasard.net>
* symbols.c (do_symval_forwarding):
* symbols.c (store_symval_forwarding):
If we have bignum support, and a const-integer or built-in integer
value (bit width one more than Lisp fixnums) needs bignum support
to pass its value to Lisp, use that support.
diff -r d3e0eec3a508 -r dfe676a17eba src/ChangeLog
--- a/src/ChangeLog Sat Sep 23 11:18:46 2017 +0100
+++ b/src/ChangeLog Sun Sep 24 09:16:02 2017 +0100
@@ -1,3 +1,11 @@
+2017-09-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * symbols.c (do_symval_forwarding):
+ * symbols.c (store_symval_forwarding):
+ If we have bignum support, and a const-integer or built-in integer
+ value (bit width one more than Lisp fixnums) needs bignum support
+ to pass its value to Lisp, use that support.
+
2017-09-23 Aidan Kehoe <kehoea(a)parhasard.net>
* process.c (read_process_output): Have this return a Bytecount,
diff -r d3e0eec3a508 -r dfe676a17eba src/symbols.c
--- a/src/symbols.c Sat Sep 23 11:18:46 2017 +0100
+++ b/src/symbols.c Sun Sep 24 09:16:02 2017 +0100
@@ -875,7 +875,7 @@
{
case SYMVAL_FIXNUM_FORWARD:
case SYMVAL_CONST_FIXNUM_FORWARD:
- return make_fixnum (*((Fixnum *)symbol_value_forward_forward (fwd)));
+ return make_integer (*((Fixnum *)symbol_value_forward_forward (fwd)));
case SYMVAL_BOOLEAN_FORWARD:
case SYMVAL_CONST_BOOLEAN_FORWARD:
@@ -1045,10 +1045,29 @@
switch (XSYMBOL_VALUE_MAGIC_TYPE (ovalue))
{
case SYMVAL_FIXNUM_FORWARD:
- CHECK_FIXNUM (newval);
+ CHECK_INTEGER (newval);
if (magicfun)
magicfun (sym, &newval, Qnil, 0);
- *((Fixnum *) symbol_value_forward_forward (fwd)) = XFIXNUM (newval);
+#if HAVE_BIGNUM
+ if (BIGNUMP (newval))
+ {
+ if (bignum_fits_emacs_int_p (XBIGNUM_DATA (newval)))
+ {
+ *((Fixnum *) symbol_value_forward_forward (fwd))
+ = bignum_to_emacs_int (XBIGNUM_DATA (newval));
+ }
+ else
+ {
+ args_out_of_range (sym, newval);
+ }
+ }
+ else
+#endif
+ {
+ *((Fixnum *) symbol_value_forward_forward (fwd))
+ = XFIXNUM (newval);
+ }
+
return;
case SYMVAL_BOOLEAN_FORWARD:
--
‘As I sat looking up at the Guinness ad, I could never figure out /
How your man stayed up on the surfboard after forty pints of stout’
(C. Moore)
Show replies by date