aboutsummaryrefslogtreecommitdiffstats
path: root/src/xwidget.c
diff options
context:
space:
mode:
authorPaul Eggert2017-12-12 12:59:57 -0800
committerPaul Eggert2017-12-12 15:17:12 -0800
commit244346c744a6700d320a0a0fe8c796be3b3ff023 (patch)
tree145dc0ba87fcf82de44e62ecbdeb70fe86c28c7a /src/xwidget.c
parentc705f7250d6f17f1682ee5ad7eec516dbf6c3916 (diff)
downloademacs-244346c744a6700d320a0a0fe8c796be3b3ff023.tar.gz
emacs-244346c744a6700d320a0a0fe8c796be3b3ff023.zip
Reimplement Lisp_Object as pointer-to-incomplete
This makes Lisp_Object values opaque pointers instead of integers, which helps avoid the same sort of typos that CHECK_LISP_OBJECT_TYPE helps to avoid, without having to wrap pointers inside structures. This also looks forward to supporting -fcheck-pointer-bounds. * etc/DEBUG: * src/.gdbinit (Lisp_Object_Printer.to_string): Lisp_Object can be a pointer type now. * src/alloc.c (macro_XPNTR, XPNTR): * src/emacs-module.c (value_to_lisp_bits, lisp_to_value_bits): * src/lisp.h (lisp_h_XLI, lisp_h_XIL): (lisp_h_XUNTAG) [USE_LSB_TAG]: (XUNTAG) [!USE_LSB_TAG]: (Lisp_Object, TAG_PTR, make_lisp_symbol): Support new Lisp_Object implementation as a pointer to an incomplete type. Keep pointers pointers, as much as possible. * src/alloc.c (macro_XPNTR_OR_SYMBOL_OFFSET, XPNTR_OR_SYMBOL_OFFSET): Remove. All uses replaced by plain XPNTR. * src/emacs-module.c: Work around GCC bug 83162. * src/lisp.h (LISP_WORDS_ARE_POINTERS, lisp_h_XLP, lisp_h_XPL): (XLP, XPL) [DEFINE_KEY_OPS_AS_MACROS]: New macros. (Lisp_Word, untagged_ptr, Lisp_Word_tag): New types. (XLP, XPL): New inline functions. (TAG_PTR): Now expands to an initializer, not an expression. All uses changed. (TAG_SYMOFFSET, XLI_BUILTIN_LISPSYM): Remove. All uses removed. (LISPSYM_INITIALLY): Redo in terms of the new TAG_PTR. (NIL_IS_ZERO): Redo without XLI_BUILTIN_LISPSYM. * src/xwidget.c (webkit_javascript_finished_cb): Use XPL instead of XIL with a non-EMACS_INT arg. (Fxwidget_webkit_execute_script): Use XLP instead of XLI followed by two conversions.
Diffstat (limited to 'src/xwidget.c')
-rw-r--r--src/xwidget.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/xwidget.c b/src/xwidget.c
index a67dc0ecf4d..c7f0594728c 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -392,8 +392,7 @@ webkit_javascript_finished_cb (GObject *webview,
392 /* FIXME: This might lead to disaster if LISP_CALLBACK’s object 392 /* FIXME: This might lead to disaster if LISP_CALLBACK’s object
393 was garbage collected before now. See the FIXME in 393 was garbage collected before now. See the FIXME in
394 Fxwidget_webkit_execute_script. */ 394 Fxwidget_webkit_execute_script. */
395 store_xwidget_js_callback_event (xw, XIL ((intptr_t) lisp_callback), 395 store_xwidget_js_callback_event (xw, XPL (lisp_callback), lisp_value);
396 lisp_value);
397} 396}
398 397
399 398
@@ -723,7 +722,7 @@ argument procedure FUN.*/)
723 /* FIXME: This hack might lead to disaster if FUN is garbage 722 /* FIXME: This hack might lead to disaster if FUN is garbage
724 collected before store_xwidget_js_callback_event makes it visible 723 collected before store_xwidget_js_callback_event makes it visible
725 to Lisp again. See the FIXME in webkit_javascript_finished_cb. */ 724 to Lisp again. See the FIXME in webkit_javascript_finished_cb. */
726 gpointer callback_arg = (gpointer) (intptr_t) XLI (fun); 725 gpointer callback_arg = XLP (fun);
727 726
728 /* JavaScript execution happens asynchronously. If an elisp 727 /* JavaScript execution happens asynchronously. If an elisp
729 callback function is provided we pass it to the C callback 728 callback function is provided we pass it to the C callback