aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorPaul Eggert2013-07-01 20:41:16 -0700
committerPaul Eggert2013-07-01 20:41:16 -0700
commit52a9bcae40a1c8536cf70cc4622a6877024e4b36 (patch)
tree90f239c0a7f16286c3938b1e1f4c8b72ce56b1e9 /src/keymap.c
parentbb70a65f1de65b5abf87c0b43d03e55ed6e579f6 (diff)
downloademacs-52a9bcae40a1c8536cf70cc4622a6877024e4b36.tar.gz
emacs-52a9bcae40a1c8536cf70cc4622a6877024e4b36.zip
Don't convert function pointers to void * and back.
It isn't portable C, and it's easy enough to avoid. * alloc.c: Verify SAVE_FUNCPOINTER bits, too. (make_save_value): Add support for SAVE_FUNCPOINTER. * keymap.c (map_keymap_char_table_item, map_keymap_internal): * print.c (print_object): Distinguish function from object pointers. * lisp.h (SAVE_FUNCPOINTER): New constant. (SAVE_SLOT_BITS): Adjust to it. (SAVE_TYPE_FUNCPTR_PTR_OBJ): New constant, replacing SAVE_TYPE_PTR_PTR_OBJ. Change the only use. (voidfuncptr): New typedef. (struct Lisp_Save_Value): New member data[0].funcpointer. (XSAVE_FUNCPOINTER): New function.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 4e3eff332cc..d29d5636e1c 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -572,7 +572,7 @@ map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val)
572 if (!NILP (val)) 572 if (!NILP (val))
573 { 573 {
574 map_keymap_function_t fun 574 map_keymap_function_t fun
575 = (map_keymap_function_t) XSAVE_POINTER (args, 0); 575 = (map_keymap_function_t) XSAVE_FUNCPOINTER (args, 0);
576 /* If the key is a range, make a copy since map_char_table modifies 576 /* If the key is a range, make a copy since map_char_table modifies
577 it in place. */ 577 it in place. */
578 if (CONSP (key)) 578 if (CONSP (key))
@@ -617,8 +617,8 @@ map_keymap_internal (Lisp_Object map,
617 } 617 }
618 else if (CHAR_TABLE_P (binding)) 618 else if (CHAR_TABLE_P (binding))
619 map_char_table (map_keymap_char_table_item, Qnil, binding, 619 map_char_table (map_keymap_char_table_item, Qnil, binding,
620 make_save_value (SAVE_TYPE_PTR_PTR_OBJ, 620 make_save_value (SAVE_TYPE_FUNCPTR_PTR_OBJ,
621 fun, data, args)); 621 (voidfuncptr) fun, data, args));
622 } 622 }
623 UNGCPRO; 623 UNGCPRO;
624 return tail; 624 return tail;