diff options
| author | Paul Eggert | 2018-06-14 15:59:08 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-06-14 17:13:38 -0700 |
| commit | 30d393f9118035ec5d12917252bc4339c771a539 (patch) | |
| tree | 6a36241db9db62022c6cd39dc71ae71f3fdb371e /src | |
| parent | 51adab5de24b3ee215fe636aedb7ff91d69a220c (diff) | |
| download | emacs-30d393f9118035ec5d12917252bc4339c771a539.tar.gz emacs-30d393f9118035ec5d12917252bc4339c771a539.zip | |
New mint_ptr representation for C pointers
* src/lisp.h (make_mint_ptr, mint_ptrp, xmint_pointer): New functions.
* src/dbusbind.c (xd_lisp_dbus_to_dbus, Fdbus__init_bus):
* src/emacs-module.c (module_free_global_ref, Fmodule_load)
(module_assert_runtime, module_assert_env, value_to_lisp)
(lisp_to_value, initialize_environment)
(finalize_environment, finalize_runtime_unwind)
(mark_modules):
* src/font.c (otf_open, font_put_frame_data)
(font_get_frame_data):
* src/macfont.m (macfont_invalidate_family_cache)
(macfont_get_family_cache_if_present)
(macfont_set_family_cache):
* src/nsterm.h (XNS_SCROLL_BAR):
* src/nsterm.m (ns_set_vertical_scroll_bar)
(ns_set_horizontal_scroll_bar):
* src/w32fns.c (w32_monitor_enum)
(w32_display_monitor_attributes_list):
* src/xterm.c (x_cr_destroy, x_cr_export_frames):
* src/xwidget.c (webkit_javascript_finished_cb)
(save_script_callback, Fxwidget_webkit_execute_script)
(kill_buffer_xwidgets):
Use mint pointers instead of merely save pointers.
Diffstat (limited to 'src')
| -rw-r--r-- | src/dbusbind.c | 4 | ||||
| -rw-r--r-- | src/emacs-module.c | 24 | ||||
| -rw-r--r-- | src/font.c | 10 | ||||
| -rw-r--r-- | src/lisp.h | 43 | ||||
| -rw-r--r-- | src/macfont.m | 12 | ||||
| -rw-r--r-- | src/nsterm.h | 4 | ||||
| -rw-r--r-- | src/nsterm.m | 4 | ||||
| -rw-r--r-- | src/w32fns.c | 4 | ||||
| -rw-r--r-- | src/xterm.c | 4 | ||||
| -rw-r--r-- | src/xwidget.c | 8 |
10 files changed, 78 insertions, 39 deletions
diff --git a/src/dbusbind.c b/src/dbusbind.c index 4e0b99bea9d..4ebea5712a8 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c | |||
| @@ -946,7 +946,7 @@ xd_get_connection_references (DBusConnection *connection) | |||
| 946 | static DBusConnection * | 946 | static DBusConnection * |
| 947 | xd_lisp_dbus_to_dbus (Lisp_Object bus) | 947 | xd_lisp_dbus_to_dbus (Lisp_Object bus) |
| 948 | { | 948 | { |
| 949 | return (DBusConnection *) XSAVE_POINTER (bus, 0); | 949 | return xmint_pointer (bus); |
| 950 | } | 950 | } |
| 951 | 951 | ||
| 952 | /* Return D-Bus connection address. BUS is either a Lisp symbol, | 952 | /* Return D-Bus connection address. BUS is either a Lisp symbol, |
| @@ -1189,7 +1189,7 @@ this connection to those buses. */) | |||
| 1189 | XD_SIGNAL1 (build_string ("Cannot add watch functions")); | 1189 | XD_SIGNAL1 (build_string ("Cannot add watch functions")); |
| 1190 | 1190 | ||
| 1191 | /* Add bus to list of registered buses. */ | 1191 | /* Add bus to list of registered buses. */ |
| 1192 | val = make_save_ptr (connection); | 1192 | val = make_mint_ptr (connection); |
| 1193 | xd_registered_buses = Fcons (Fcons (bus, val), xd_registered_buses); | 1193 | xd_registered_buses = Fcons (Fcons (bus, val), xd_registered_buses); |
| 1194 | 1194 | ||
| 1195 | /* Cleanup. */ | 1195 | /* Cleanup. */ |
diff --git a/src/emacs-module.c b/src/emacs-module.c index c18c7ab308b..ff575ff44df 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -347,7 +347,7 @@ module_free_global_ref (emacs_env *env, emacs_value ref) | |||
| 347 | for (Lisp_Object tail = global_env_private.values; CONSP (tail); | 347 | for (Lisp_Object tail = global_env_private.values; CONSP (tail); |
| 348 | tail = XCDR (tail)) | 348 | tail = XCDR (tail)) |
| 349 | { | 349 | { |
| 350 | emacs_value global = XSAVE_POINTER (XCAR (globals), 0); | 350 | emacs_value global = xmint_pointer (XCAR (globals)); |
| 351 | if (global == ref) | 351 | if (global == ref) |
| 352 | { | 352 | { |
| 353 | if (NILP (prev)) | 353 | if (NILP (prev)) |
| @@ -735,7 +735,7 @@ DEFUN ("module-load", Fmodule_load, Smodule_load, 1, 1, 0, | |||
| 735 | rt->private_members = &rt_priv; | 735 | rt->private_members = &rt_priv; |
| 736 | rt->get_environment = module_get_environment; | 736 | rt->get_environment = module_get_environment; |
| 737 | 737 | ||
| 738 | Vmodule_runtimes = Fcons (make_save_ptr (rt), Vmodule_runtimes); | 738 | Vmodule_runtimes = Fcons (make_mint_ptr (rt), Vmodule_runtimes); |
| 739 | ptrdiff_t count = SPECPDL_INDEX (); | 739 | ptrdiff_t count = SPECPDL_INDEX (); |
| 740 | record_unwind_protect_ptr (finalize_runtime_unwind, rt); | 740 | record_unwind_protect_ptr (finalize_runtime_unwind, rt); |
| 741 | 741 | ||
| @@ -830,7 +830,7 @@ module_assert_runtime (struct emacs_runtime *ert) | |||
| 830 | ptrdiff_t count = 0; | 830 | ptrdiff_t count = 0; |
| 831 | for (Lisp_Object tail = Vmodule_runtimes; CONSP (tail); tail = XCDR (tail)) | 831 | for (Lisp_Object tail = Vmodule_runtimes; CONSP (tail); tail = XCDR (tail)) |
| 832 | { | 832 | { |
| 833 | if (XSAVE_POINTER (XCAR (tail), 0) == ert) | 833 | if (xmint_pointer (XCAR (tail)) == ert) |
| 834 | return; | 834 | return; |
| 835 | ++count; | 835 | ++count; |
| 836 | } | 836 | } |
| @@ -847,7 +847,7 @@ module_assert_env (emacs_env *env) | |||
| 847 | for (Lisp_Object tail = Vmodule_environments; CONSP (tail); | 847 | for (Lisp_Object tail = Vmodule_environments; CONSP (tail); |
| 848 | tail = XCDR (tail)) | 848 | tail = XCDR (tail)) |
| 849 | { | 849 | { |
| 850 | if (XSAVE_POINTER (XCAR (tail), 0) == env) | 850 | if (xmint_pointer (XCAR (tail)) == env) |
| 851 | return; | 851 | return; |
| 852 | ++count; | 852 | ++count; |
| 853 | } | 853 | } |
| @@ -959,11 +959,11 @@ value_to_lisp (emacs_value v) | |||
| 959 | for (Lisp_Object environments = Vmodule_environments; | 959 | for (Lisp_Object environments = Vmodule_environments; |
| 960 | CONSP (environments); environments = XCDR (environments)) | 960 | CONSP (environments); environments = XCDR (environments)) |
| 961 | { | 961 | { |
| 962 | emacs_env *env = XSAVE_POINTER (XCAR (environments), 0); | 962 | emacs_env *env = xmint_pointer (XCAR (environments)); |
| 963 | for (Lisp_Object values = env->private_members->values; | 963 | for (Lisp_Object values = env->private_members->values; |
| 964 | CONSP (values); values = XCDR (values)) | 964 | CONSP (values); values = XCDR (values)) |
| 965 | { | 965 | { |
| 966 | Lisp_Object *p = XSAVE_POINTER (XCAR (values), 0); | 966 | Lisp_Object *p = xmint_pointer (XCAR (values)); |
| 967 | if (p == optr) | 967 | if (p == optr) |
| 968 | return *p; | 968 | return *p; |
| 969 | ++num_values; | 969 | ++num_values; |
| @@ -1021,7 +1021,7 @@ lisp_to_value (emacs_env *env, Lisp_Object o) | |||
| 1021 | void *vptr = optr; | 1021 | void *vptr = optr; |
| 1022 | ATTRIBUTE_MAY_ALIAS emacs_value ret = vptr; | 1022 | ATTRIBUTE_MAY_ALIAS emacs_value ret = vptr; |
| 1023 | struct emacs_env_private *priv = env->private_members; | 1023 | struct emacs_env_private *priv = env->private_members; |
| 1024 | priv->values = Fcons (make_save_ptr (ret), priv->values); | 1024 | priv->values = Fcons (make_mint_ptr (ret), priv->values); |
| 1025 | return ret; | 1025 | return ret; |
| 1026 | } | 1026 | } |
| 1027 | 1027 | ||
| @@ -1086,7 +1086,7 @@ initialize_environment (emacs_env *env, struct emacs_env_private *priv) | |||
| 1086 | env->vec_get = module_vec_get; | 1086 | env->vec_get = module_vec_get; |
| 1087 | env->vec_size = module_vec_size; | 1087 | env->vec_size = module_vec_size; |
| 1088 | env->should_quit = module_should_quit; | 1088 | env->should_quit = module_should_quit; |
| 1089 | Vmodule_environments = Fcons (make_save_ptr (env), Vmodule_environments); | 1089 | Vmodule_environments = Fcons (make_mint_ptr (env), Vmodule_environments); |
| 1090 | return env; | 1090 | return env; |
| 1091 | } | 1091 | } |
| 1092 | 1092 | ||
| @@ -1095,7 +1095,7 @@ initialize_environment (emacs_env *env, struct emacs_env_private *priv) | |||
| 1095 | static void | 1095 | static void |
| 1096 | finalize_environment (emacs_env *env) | 1096 | finalize_environment (emacs_env *env) |
| 1097 | { | 1097 | { |
| 1098 | eassert (XSAVE_POINTER (XCAR (Vmodule_environments), 0) == env); | 1098 | eassert (xmint_pointer (XCAR (Vmodule_environments)) == env); |
| 1099 | Vmodule_environments = XCDR (Vmodule_environments); | 1099 | Vmodule_environments = XCDR (Vmodule_environments); |
| 1100 | if (module_assertions) | 1100 | if (module_assertions) |
| 1101 | /* There is always at least the global environment. */ | 1101 | /* There is always at least the global environment. */ |
| @@ -1109,10 +1109,10 @@ finalize_environment_unwind (void *env) | |||
| 1109 | } | 1109 | } |
| 1110 | 1110 | ||
| 1111 | static void | 1111 | static void |
| 1112 | finalize_runtime_unwind (void* raw_ert) | 1112 | finalize_runtime_unwind (void *raw_ert) |
| 1113 | { | 1113 | { |
| 1114 | struct emacs_runtime *ert = raw_ert; | 1114 | struct emacs_runtime *ert = raw_ert; |
| 1115 | eassert (XSAVE_POINTER (XCAR (Vmodule_runtimes), 0) == ert); | 1115 | eassert (xmint_pointer (XCAR (Vmodule_runtimes)) == ert); |
| 1116 | Vmodule_runtimes = XCDR (Vmodule_runtimes); | 1116 | Vmodule_runtimes = XCDR (Vmodule_runtimes); |
| 1117 | finalize_environment (ert->private_members->env); | 1117 | finalize_environment (ert->private_members->env); |
| 1118 | } | 1118 | } |
| @@ -1123,7 +1123,7 @@ mark_modules (void) | |||
| 1123 | for (Lisp_Object tail = Vmodule_environments; CONSP (tail); | 1123 | for (Lisp_Object tail = Vmodule_environments; CONSP (tail); |
| 1124 | tail = XCDR (tail)) | 1124 | tail = XCDR (tail)) |
| 1125 | { | 1125 | { |
| 1126 | emacs_env *env = XSAVE_POINTER (XCAR (tail), 0); | 1126 | emacs_env *env = xmint_pointer (XCAR (tail)); |
| 1127 | struct emacs_env_private *priv = env->private_members; | 1127 | struct emacs_env_private *priv = env->private_members; |
| 1128 | mark_object (priv->non_local_exit_symbol); | 1128 | mark_object (priv->non_local_exit_symbol); |
| 1129 | mark_object (priv->non_local_exit_data); | 1129 | mark_object (priv->non_local_exit_data); |
diff --git a/src/font.c b/src/font.c index 3800869c5b3..3a82e501a84 100644 --- a/src/font.c +++ b/src/font.c | |||
| @@ -1897,11 +1897,11 @@ otf_open (Lisp_Object file) | |||
| 1897 | OTF *otf; | 1897 | OTF *otf; |
| 1898 | 1898 | ||
| 1899 | if (! NILP (val)) | 1899 | if (! NILP (val)) |
| 1900 | otf = XSAVE_POINTER (XCDR (val), 0); | 1900 | otf = xmint_pointer (XCDR (val)); |
| 1901 | else | 1901 | else |
| 1902 | { | 1902 | { |
| 1903 | otf = STRINGP (file) ? OTF_open (SSDATA (file)) : NULL; | 1903 | otf = STRINGP (file) ? OTF_open (SSDATA (file)) : NULL; |
| 1904 | val = make_save_ptr (otf); | 1904 | val = make_mint_ptr (otf); |
| 1905 | otf_list = Fcons (Fcons (file, val), otf_list); | 1905 | otf_list = Fcons (Fcons (file, val), otf_list); |
| 1906 | } | 1906 | } |
| 1907 | return otf; | 1907 | return otf; |
| @@ -3632,10 +3632,10 @@ font_put_frame_data (struct frame *f, Lisp_Object driver, void *data) | |||
| 3632 | else | 3632 | else |
| 3633 | { | 3633 | { |
| 3634 | if (NILP (val)) | 3634 | if (NILP (val)) |
| 3635 | fset_font_data (f, Fcons (Fcons (driver, make_save_ptr (data)), | 3635 | fset_font_data (f, Fcons (Fcons (driver, make_mint_ptr (data)), |
| 3636 | f->font_data)); | 3636 | f->font_data)); |
| 3637 | else | 3637 | else |
| 3638 | XSETCDR (val, make_save_ptr (data)); | 3638 | XSETCDR (val, make_mint_ptr (data)); |
| 3639 | } | 3639 | } |
| 3640 | } | 3640 | } |
| 3641 | 3641 | ||
| @@ -3644,7 +3644,7 @@ font_get_frame_data (struct frame *f, Lisp_Object driver) | |||
| 3644 | { | 3644 | { |
| 3645 | Lisp_Object val = assq_no_quit (driver, f->font_data); | 3645 | Lisp_Object val = assq_no_quit (driver, f->font_data); |
| 3646 | 3646 | ||
| 3647 | return NILP (val) ? NULL : XSAVE_POINTER (XCDR (val), 0); | 3647 | return NILP (val) ? NULL : xmint_pointer (XCDR (val)); |
| 3648 | } | 3648 | } |
| 3649 | 3649 | ||
| 3650 | #endif /* HAVE_XFT || HAVE_FREETYPE */ | 3650 | #endif /* HAVE_XFT || HAVE_FREETYPE */ |
diff --git a/src/lisp.h b/src/lisp.h index aaad90b2dad..b7e5d9e3761 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -2494,7 +2494,47 @@ XSAVE_FUNCPOINTER (Lisp_Object obj, int n) | |||
| 2494 | return XSAVE_VALUE (obj)->data[n].funcpointer; | 2494 | return XSAVE_VALUE (obj)->data[n].funcpointer; |
| 2495 | } | 2495 | } |
| 2496 | 2496 | ||
| 2497 | /* Likewise for the saved integer. */ | 2497 | extern Lisp_Object make_save_ptr (void *); |
| 2498 | |||
| 2499 | /* A mint_ptr object OBJ represents a C-language pointer P efficiently. | ||
| 2500 | Preferably (and typically), OBJ is a Lisp integer I such that | ||
| 2501 | XINTPTR (I) == P, as this represents P within a single Lisp value | ||
| 2502 | without requiring any auxiliary memory. However, if P would be | ||
| 2503 | damaged by being tagged as an integer and then untagged via | ||
| 2504 | XINTPTR, then OBJ is a Lisp_Save_Value with pointer component P. | ||
| 2505 | |||
| 2506 | mint_ptr objects are efficiency hacks intended for C code. | ||
| 2507 | Although xmint_ptr can be given any mint_ptr generated by non-buggy | ||
| 2508 | C code, it should not be given a mint_ptr generated from Lisp code | ||
| 2509 | as that would allow Lisp code to coin pointers from integers and | ||
| 2510 | could lead to crashes. To package a C pointer into a Lisp-visible | ||
| 2511 | object you can put the pointer into a Lisp_Misc object instead; see | ||
| 2512 | Lisp_User_Ptr for an example. */ | ||
| 2513 | |||
| 2514 | INLINE Lisp_Object | ||
| 2515 | make_mint_ptr (void *a) | ||
| 2516 | { | ||
| 2517 | Lisp_Object val = TAG_PTR (Lisp_Int0, a); | ||
| 2518 | return INTEGERP (val) && XINTPTR (val) == a ? val : make_save_ptr (a); | ||
| 2519 | } | ||
| 2520 | |||
| 2521 | INLINE bool | ||
| 2522 | mint_ptrp (Lisp_Object x) | ||
| 2523 | { | ||
| 2524 | return (INTEGERP (x) | ||
| 2525 | || (SAVE_VALUEP (x) && XSAVE_VALUE (x)->save_type == SAVE_POINTER)); | ||
| 2526 | } | ||
| 2527 | |||
| 2528 | INLINE void * | ||
| 2529 | xmint_pointer (Lisp_Object a) | ||
| 2530 | { | ||
| 2531 | eassert (mint_ptrp (a)); | ||
| 2532 | if (INTEGERP (a)) | ||
| 2533 | return XINTPTR (a); | ||
| 2534 | return XSAVE_POINTER (a, 0); | ||
| 2535 | } | ||
| 2536 | |||
| 2537 | /* Get and set the Nth saved integer. */ | ||
| 2498 | 2538 | ||
| 2499 | INLINE ptrdiff_t | 2539 | INLINE ptrdiff_t |
| 2500 | XSAVE_INTEGER (Lisp_Object obj, int n) | 2540 | XSAVE_INTEGER (Lisp_Object obj, int n) |
| @@ -3801,7 +3841,6 @@ extern ptrdiff_t inhibit_garbage_collection (void); | |||
| 3801 | extern Lisp_Object make_save_int_int_int (ptrdiff_t, ptrdiff_t, ptrdiff_t); | 3841 | extern Lisp_Object make_save_int_int_int (ptrdiff_t, ptrdiff_t, ptrdiff_t); |
| 3802 | extern Lisp_Object make_save_obj_obj_obj_obj (Lisp_Object, Lisp_Object, | 3842 | extern Lisp_Object make_save_obj_obj_obj_obj (Lisp_Object, Lisp_Object, |
| 3803 | Lisp_Object, Lisp_Object); | 3843 | Lisp_Object, Lisp_Object); |
| 3804 | extern Lisp_Object make_save_ptr (void *); | ||
| 3805 | extern Lisp_Object make_save_ptr_int (void *, ptrdiff_t); | 3844 | extern Lisp_Object make_save_ptr_int (void *, ptrdiff_t); |
| 3806 | extern Lisp_Object make_save_ptr_ptr (void *, void *); | 3845 | extern Lisp_Object make_save_ptr_ptr (void *, void *); |
| 3807 | extern Lisp_Object make_save_funcptr_ptr_obj (void (*) (void), void *, | 3846 | extern Lisp_Object make_save_funcptr_ptr_obj (void (*) (void), void *, |
diff --git a/src/macfont.m b/src/macfont.m index 817071fa44f..3b14a89c5cc 100644 --- a/src/macfont.m +++ b/src/macfont.m | |||
| @@ -943,8 +943,8 @@ macfont_invalidate_family_cache (void) | |||
| 943 | { | 943 | { |
| 944 | Lisp_Object value = HASH_VALUE (h, i); | 944 | Lisp_Object value = HASH_VALUE (h, i); |
| 945 | 945 | ||
| 946 | if (SAVE_VALUEP (value)) | 946 | if (mint_ptrp (value)) |
| 947 | CFRelease (XSAVE_POINTER (value, 0)); | 947 | CFRelease (xmint_pointer (value)); |
| 948 | } | 948 | } |
| 949 | macfont_family_cache = Qnil; | 949 | macfont_family_cache = Qnil; |
| 950 | } | 950 | } |
| @@ -962,7 +962,7 @@ macfont_get_family_cache_if_present (Lisp_Object symbol, CFStringRef *string) | |||
| 962 | { | 962 | { |
| 963 | Lisp_Object value = HASH_VALUE (h, i); | 963 | Lisp_Object value = HASH_VALUE (h, i); |
| 964 | 964 | ||
| 965 | *string = SAVE_VALUEP (value) ? XSAVE_POINTER (value, 0) : NULL; | 965 | *string = mint_ptrp (value) ? xmint_pointer (value) : NULL; |
| 966 | 966 | ||
| 967 | return true; | 967 | return true; |
| 968 | } | 968 | } |
| @@ -984,13 +984,13 @@ macfont_set_family_cache (Lisp_Object symbol, CFStringRef string) | |||
| 984 | 984 | ||
| 985 | h = XHASH_TABLE (macfont_family_cache); | 985 | h = XHASH_TABLE (macfont_family_cache); |
| 986 | i = hash_lookup (h, symbol, &hash); | 986 | i = hash_lookup (h, symbol, &hash); |
| 987 | value = string ? make_save_ptr ((void *) CFRetain (string)) : Qnil; | 987 | value = string ? make_mint_ptr (CFRetain (string)) : Qnil; |
| 988 | if (i >= 0) | 988 | if (i >= 0) |
| 989 | { | 989 | { |
| 990 | Lisp_Object old_value = HASH_VALUE (h, i); | 990 | Lisp_Object old_value = HASH_VALUE (h, i); |
| 991 | 991 | ||
| 992 | if (SAVE_VALUEP (old_value)) | 992 | if (mint_ptrp (old_value)) |
| 993 | CFRelease (XSAVE_POINTER (old_value, 0)); | 993 | CFRelease (xmint_pointer (old_value)); |
| 994 | set_hash_value_slot (h, i, value); | 994 | set_hash_value_slot (h, i, value); |
| 995 | } | 995 | } |
| 996 | else | 996 | else |
diff --git a/src/nsterm.h b/src/nsterm.h index a99b517fd5e..23460abc659 100644 --- a/src/nsterm.h +++ b/src/nsterm.h | |||
| @@ -1019,9 +1019,9 @@ struct x_output | |||
| 1019 | #define FRAME_FONT(f) ((f)->output_data.ns->font) | 1019 | #define FRAME_FONT(f) ((f)->output_data.ns->font) |
| 1020 | 1020 | ||
| 1021 | #ifdef __OBJC__ | 1021 | #ifdef __OBJC__ |
| 1022 | #define XNS_SCROLL_BAR(vec) ((id) XSAVE_POINTER (vec, 0)) | 1022 | #define XNS_SCROLL_BAR(vec) ((id) xmint_pointer (vec)) |
| 1023 | #else | 1023 | #else |
| 1024 | #define XNS_SCROLL_BAR(vec) XSAVE_POINTER (vec, 0) | 1024 | #define XNS_SCROLL_BAR(vec) xmint_pointer (vec) |
| 1025 | #endif | 1025 | #endif |
| 1026 | 1026 | ||
| 1027 | /* Compute pixel height of the frame's titlebar. */ | 1027 | /* Compute pixel height of the frame's titlebar. */ |
diff --git a/src/nsterm.m b/src/nsterm.m index c0d2d91fde8..f0e6790e99e 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -4819,7 +4819,7 @@ ns_set_vertical_scroll_bar (struct window *window, | |||
| 4819 | ns_clear_frame_area (f, left, top, width, height); | 4819 | ns_clear_frame_area (f, left, top, width, height); |
| 4820 | 4820 | ||
| 4821 | bar = [[EmacsScroller alloc] initFrame: r window: win]; | 4821 | bar = [[EmacsScroller alloc] initFrame: r window: win]; |
| 4822 | wset_vertical_scroll_bar (window, make_save_ptr (bar)); | 4822 | wset_vertical_scroll_bar (window, make_mint_ptr (bar)); |
| 4823 | update_p = YES; | 4823 | update_p = YES; |
| 4824 | } | 4824 | } |
| 4825 | else | 4825 | else |
| @@ -4898,7 +4898,7 @@ ns_set_horizontal_scroll_bar (struct window *window, | |||
| 4898 | ns_clear_frame_area (f, left, top, width, height); | 4898 | ns_clear_frame_area (f, left, top, width, height); |
| 4899 | 4899 | ||
| 4900 | bar = [[EmacsScroller alloc] initFrame: r window: win]; | 4900 | bar = [[EmacsScroller alloc] initFrame: r window: win]; |
| 4901 | wset_horizontal_scroll_bar (window, make_save_ptr (bar)); | 4901 | wset_horizontal_scroll_bar (window, make_mint_ptr (bar)); |
| 4902 | update_p = YES; | 4902 | update_p = YES; |
| 4903 | } | 4903 | } |
| 4904 | else | 4904 | else |
diff --git a/src/w32fns.c b/src/w32fns.c index 2cb715a356d..3bd320928dd 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -6296,7 +6296,7 @@ w32_monitor_enum (HMONITOR monitor, HDC hdc, RECT *rcMonitor, LPARAM dwData) | |||
| 6296 | { | 6296 | { |
| 6297 | Lisp_Object *monitor_list = (Lisp_Object *) dwData; | 6297 | Lisp_Object *monitor_list = (Lisp_Object *) dwData; |
| 6298 | 6298 | ||
| 6299 | *monitor_list = Fcons (make_save_ptr (monitor), *monitor_list); | 6299 | *monitor_list = Fcons (make_mint_ptr (monitor), *monitor_list); |
| 6300 | 6300 | ||
| 6301 | return TRUE; | 6301 | return TRUE; |
| 6302 | } | 6302 | } |
| @@ -6325,7 +6325,7 @@ w32_display_monitor_attributes_list (void) | |||
| 6325 | monitors = xmalloc (n_monitors * sizeof (*monitors)); | 6325 | monitors = xmalloc (n_monitors * sizeof (*monitors)); |
| 6326 | for (i = 0; i < n_monitors; i++) | 6326 | for (i = 0; i < n_monitors; i++) |
| 6327 | { | 6327 | { |
| 6328 | monitors[i] = XSAVE_POINTER (XCAR (monitor_list), 0); | 6328 | monitors[i] = xmint_pointer (XCAR (monitor_list)); |
| 6329 | monitor_list = XCDR (monitor_list); | 6329 | monitor_list = XCDR (monitor_list); |
| 6330 | } | 6330 | } |
| 6331 | 6331 | ||
diff --git a/src/xterm.c b/src/xterm.c index decaa33670b..00ca18c2a96 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -546,7 +546,7 @@ x_cr_accumulate_data (void *closure, const unsigned char *data, | |||
| 546 | static void | 546 | static void |
| 547 | x_cr_destroy (Lisp_Object arg) | 547 | x_cr_destroy (Lisp_Object arg) |
| 548 | { | 548 | { |
| 549 | cairo_t *cr = (cairo_t *) XSAVE_POINTER (arg, 0); | 549 | cairo_t *cr = xmint_pointer (arg); |
| 550 | 550 | ||
| 551 | block_input (); | 551 | block_input (); |
| 552 | cairo_destroy (cr); | 552 | cairo_destroy (cr); |
| @@ -606,7 +606,7 @@ x_cr_export_frames (Lisp_Object frames, cairo_surface_type_t surface_type) | |||
| 606 | 606 | ||
| 607 | cr = cairo_create (surface); | 607 | cr = cairo_create (surface); |
| 608 | cairo_surface_destroy (surface); | 608 | cairo_surface_destroy (surface); |
| 609 | record_unwind_protect (x_cr_destroy, make_save_ptr (cr)); | 609 | record_unwind_protect (x_cr_destroy, make_mint_ptr (cr)); |
| 610 | 610 | ||
| 611 | while (1) | 611 | while (1) |
| 612 | { | 612 | { |
diff --git a/src/xwidget.c b/src/xwidget.c index 5f2651214e3..2a53966ef43 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -374,7 +374,7 @@ webkit_javascript_finished_cb (GObject *webview, | |||
| 374 | Lisp_Object script_callback = AREF (xw->script_callbacks, script_idx); | 374 | Lisp_Object script_callback = AREF (xw->script_callbacks, script_idx); |
| 375 | ASET (xw->script_callbacks, script_idx, Qnil); | 375 | ASET (xw->script_callbacks, script_idx, Qnil); |
| 376 | if (!NILP (script_callback)) | 376 | if (!NILP (script_callback)) |
| 377 | xfree (XSAVE_POINTER (XCAR (script_callback), 0)); | 377 | xfree (xmint_pointer (XCAR (script_callback))); |
| 378 | 378 | ||
| 379 | js_result = webkit_web_view_run_javascript_finish | 379 | js_result = webkit_web_view_run_javascript_finish |
| 380 | (WEBKIT_WEB_VIEW (webview), result, &error); | 380 | (WEBKIT_WEB_VIEW (webview), result, &error); |
| @@ -724,7 +724,7 @@ save_script_callback (struct xwidget *xw, Lisp_Object script, Lisp_Object fun) | |||
| 724 | break; | 724 | break; |
| 725 | } | 725 | } |
| 726 | 726 | ||
| 727 | ASET (cbs, idx, Fcons (make_save_ptr (xlispstrdup (script)), fun)); | 727 | ASET (cbs, idx, Fcons (make_mint_ptr (xlispstrdup (script)), fun)); |
| 728 | return idx; | 728 | return idx; |
| 729 | } | 729 | } |
| 730 | 730 | ||
| @@ -750,7 +750,7 @@ argument procedure FUN.*/) | |||
| 750 | callback function is provided we pass it to the C callback | 750 | callback function is provided we pass it to the C callback |
| 751 | procedure that retrieves the return value. */ | 751 | procedure that retrieves the return value. */ |
| 752 | gchar *script_string | 752 | gchar *script_string |
| 753 | = XSAVE_POINTER (XCAR (AREF (xw->script_callbacks, idx)), 0); | 753 | = xmint_pointer (XCAR (AREF (xw->script_callbacks, idx))); |
| 754 | webkit_web_view_run_javascript (WEBKIT_WEB_VIEW (xw->widget_osr), | 754 | webkit_web_view_run_javascript (WEBKIT_WEB_VIEW (xw->widget_osr), |
| 755 | script_string, | 755 | script_string, |
| 756 | NULL, /* cancelable */ | 756 | NULL, /* cancelable */ |
| @@ -1227,7 +1227,7 @@ kill_buffer_xwidgets (Lisp_Object buffer) | |||
| 1227 | { | 1227 | { |
| 1228 | Lisp_Object cb = AREF (xw->script_callbacks, idx); | 1228 | Lisp_Object cb = AREF (xw->script_callbacks, idx); |
| 1229 | if (!NILP (cb)) | 1229 | if (!NILP (cb)) |
| 1230 | xfree (XSAVE_POINTER (XCAR (cb), 0)); | 1230 | xfree (xmint_pointer (XCAR (cb))); |
| 1231 | ASET (xw->script_callbacks, idx, Qnil); | 1231 | ASET (xw->script_callbacks, idx, Qnil); |
| 1232 | } | 1232 | } |
| 1233 | } | 1233 | } |