diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-01-14 09:46:14 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-01-14 09:46:14 -0800 |
commit | c50cf2eac4b18e38bef5b6e58827cc2bce1e98f4 (patch) | |
tree | 56685b68573608bf284b55d0996cc471fda34366 | |
parent | 57dd9e68862eeb452388b07c855a8112c3a7b22f (diff) | |
download | emacs-c50cf2eac4b18e38bef5b6e58827cc2bce1e98f4.tar.gz |
Avoid needless casts with XSAVE_POINTER.
* alloc.c (mark_object) [GC_MARK_STACK]:
* dired.c (directory_files_internal_unwind):
* fileio.c (do_auto_save_unwind):
* gtkutil.c (pop_down_dialog):
* keymap.c (map_keymap_char_table_item):
* lread.c (load_unwind):
* nsmenu.m (pop_down_menu):
* print.c (print_object) [GC_MARK_STACK]:
* xfns.c (clean_up_file_dialog):
* xmenu.c (cleanup_widget_value_tree):
Omit casts between XSAVE_POINTER and a pointer type.
-rw-r--r-- | src/ChangeLog | 15 | ||||
-rw-r--r-- | src/alloc.c | 2 | ||||
-rw-r--r-- | src/dired.c | 2 | ||||
-rw-r--r-- | src/fileio.c | 2 | ||||
-rw-r--r-- | src/gtkutil.c | 2 | ||||
-rw-r--r-- | src/keymap.c | 3 | ||||
-rw-r--r-- | src/lread.c | 2 | ||||
-rw-r--r-- | src/nsmenu.m | 2 | ||||
-rw-r--r-- | src/print.c | 2 | ||||
-rw-r--r-- | src/xfns.c | 2 | ||||
-rw-r--r-- | src/xmenu.c | 2 |
11 files changed, 25 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2445027edd5..80f5875ef16 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,18 @@ +2013-01-14 Paul Eggert <eggert@cs.ucla.edu> + + Avoid needless casts with XSAVE_POINTER. + * alloc.c (mark_object) [GC_MARK_STACK]: + * dired.c (directory_files_internal_unwind): + * fileio.c (do_auto_save_unwind): + * gtkutil.c (pop_down_dialog): + * keymap.c (map_keymap_char_table_item): + * lread.c (load_unwind): + * nsmenu.m (pop_down_menu): + * print.c (print_object) [GC_MARK_STACK]: + * xfns.c (clean_up_file_dialog): + * xmenu.c (cleanup_widget_value_tree): + Omit casts between XSAVE_POINTER and a pointer type. + 2013-01-14 Dmitry Antipov <dmantipov@yandex.ru> Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE. diff --git a/src/alloc.c b/src/alloc.c index c50bb0f32c7..3f1ccc82a58 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -5943,7 +5943,7 @@ mark_object (Lisp_Object arg) #if GC_MARK_STACK if (ptr->area) { - Lisp_Object *p = (Lisp_Object *) ptr->data[0].pointer; + Lisp_Object *p = ptr->data[0].pointer; ptrdiff_t nelt; for (nelt = ptr->data[1].integer; nelt > 0; nelt--, p++) mark_maybe_object (*p); diff --git a/src/dired.c b/src/dired.c index 77e89c6e6b3..8483721401a 100644 --- a/src/dired.c +++ b/src/dired.c @@ -78,7 +78,7 @@ directory_files_internal_w32_unwind (Lisp_Object arg) static Lisp_Object directory_files_internal_unwind (Lisp_Object dh) { - DIR *d = (DIR *) XSAVE_POINTER (dh); + DIR *d = XSAVE_POINTER (dh); block_input (); closedir (d); unblock_input (); diff --git a/src/fileio.c b/src/fileio.c index 67b4b884bc0..d468576d639 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5507,7 +5507,7 @@ static Lisp_Object do_auto_save_unwind (Lisp_Object arg) /* used as unwind-protect function */ { - FILE *stream = (FILE *) XSAVE_POINTER (arg); + FILE *stream = XSAVE_POINTER (arg); auto_saving = 0; if (stream != NULL) { diff --git a/src/gtkutil.c b/src/gtkutil.c index 3b1bbc73cff..259e0e971fd 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -1650,7 +1650,7 @@ xg_dialog_response_cb (GtkDialog *w, static Lisp_Object pop_down_dialog (Lisp_Object arg) { - struct xg_dialog_data *dd = (struct xg_dialog_data *) XSAVE_POINTER (arg); + struct xg_dialog_data *dd = XSAVE_POINTER (arg); block_input (); if (dd->w) gtk_widget_destroy (dd->w); diff --git a/src/keymap.c b/src/keymap.c index 7b5aa45ebf3..82c9e980221 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -565,8 +565,7 @@ map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val) { if (!NILP (val)) { - map_keymap_function_t fun - = (map_keymap_function_t) XSAVE_POINTER (XCAR (args)); + map_keymap_function_t fun = XSAVE_POINTER (XCAR (args)); args = XCDR (args); /* If the key is a range, make a copy since map_char_table modifies it in place. */ diff --git a/src/lread.c b/src/lread.c index 35b61cbad4d..ced690a77b0 100644 --- a/src/lread.c +++ b/src/lread.c @@ -1357,7 +1357,7 @@ Return t if the file exists and loads successfully. */) static Lisp_Object load_unwind (Lisp_Object arg) /* Used as unwind-protect function in load. */ { - FILE *stream = (FILE *) XSAVE_POINTER (arg); + FILE *stream = XSAVE_POINTER (arg); if (stream != NULL) { block_input (); diff --git a/src/nsmenu.m b/src/nsmenu.m index 4e81b3201c8..3e6fa54b047 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -1347,7 +1347,7 @@ struct Popdown_data static Lisp_Object pop_down_menu (Lisp_Object arg) { - struct Popdown_data *unwind_data = (struct Popdown_data *) XSAVE_POINTER (arg); + struct Popdown_data *unwind_data = XSAVE_POINTER (arg); block_input (); if (popup_activated_flag) diff --git a/src/print.c b/src/print.c index 0ae83cdf6d2..2d96202f389 100644 --- a/src/print.c +++ b/src/print.c @@ -2054,7 +2054,7 @@ print_object (Lisp_Object obj, register Lisp_Object printcharfun, int escapeflag normal circumstances. */ int limit = min (amount, 8); - Lisp_Object *area = (Lisp_Object *) v->data[0].pointer; + Lisp_Object *area = v->data[0].pointer; i = sprintf (buf, "with %"pD"d objects", amount); strout (buf, i, i, printcharfun); diff --git a/src/xfns.c b/src/xfns.c index 245ffae3573..fe99d36f9f4 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -5292,7 +5292,7 @@ file_dialog_unmap_cb (Widget widget, XtPointer client_data, XtPointer call_data) static Lisp_Object clean_up_file_dialog (Lisp_Object arg) { - Widget dialog = (Widget) XSAVE_POINTER (arg); + Widget dialog = XSAVE_POINTER (arg); /* Clean up. */ block_input (); diff --git a/src/xmenu.c b/src/xmenu.c index cbb5a3dc77e..6d880993d19 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -1610,7 +1610,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, static Lisp_Object cleanup_widget_value_tree (Lisp_Object arg) { - free_menubar_widget_value_tree ((widget_value *) XSAVE_POINTER (arg)); + free_menubar_widget_value_tree (XSAVE_POINTER (arg)); return Qnil; } |