]> code.delx.au - gnu-emacs/commit
Improve module interface when WIDE_EMACS_INT
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Dec 2015 17:09:07 +0000 (09:09 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Dec 2015 17:09:58 +0000 (09:09 -0800)
commit302bbe00b31852942827dab42154f33411b99171
tree4d8a800f08f4283b4d3dbbfb1c47267efc2e11bc
parent2b3f5de2b31b90733a88868b31bed3f7038f7055
Improve module interface when WIDE_EMACS_INT

* src/emacs-module.c (plain_values): New constant.
(module_nil): Now a constant.
(Finternal_module_call, value_to_lisp_bits, lisp_to_value_bits)
(syms_of_module): Use if, not #ifdef, so that both sides are
checked at compile-time, and so that GCC doesn’t complain
about an unused var in the typical case.  Also, depend on
plain_values, not on WIDE_EMACS_INT; the code shouldn’t assume
that WIDE_EMACS_INT implies !USE_LSB_TAG.
(value_to_lisp_bits, lisp_to_value_bits): New functions.
Sign-extend integers rather than zero-extending them, as small
negative integers are more likely.
(value_to_lisp, lisp_to_value): Rewrite in terms of the new *_bits
functions.
(HAVE_STRUCT_ATTRIBUTE_ALIGNED): Define to 0 if not already defined.
(mark_modules): Remove.  All uses removed.
(lisp_to_value): Don’t assume Fcons returns a pointer aligned
to GCALIGNMENT.
(syms_of_module): Check that module_nil converts to Qnil.
* src/lisp.h (lisp_h_XSYMBOL, XSYMBOL): Use signed conversion, since
we prefer signed to unsigned when either will do.
(TAG_PTR): Sign-extend pointers when USE_LSB_TAG, as this is
a bit better for emacs-module.c.
src/alloc.c
src/emacs-module.c
src/lisp.h