diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2013-08-10 18:30:20 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2013-08-10 18:30:20 -0700 |
commit | 7d652d97681c4f1b67018f44f64c619ef5edd990 (patch) | |
tree | a9d8ac72718b53f60ddd3e7cbca7180b5796b79e /src/xfns.c | |
parent | 9a4ebc748797acc8af74f561367aa1b34ca02d2e (diff) |
Omit some unnecessary casts.
Many of these go back to the old pre-C89 days, when they may have
been needed, but we've been assuming C89 or later for a while now.
* alloc.c (live_string_p, live_cons_p, live_symbol_p)
(live_float_p, live_misc_p, live_vector_p):
* buffer.c (compare_overlays, cmp_for_strings, mmap_find)
(mmap_alloc, alloc_buffer_text, enlarge_buffer_text)
(defvar_per_buffer):
* callint.c (Fcall_interactively):
* doc.c (Fsubstitute_command_keys):
* filelock.c (get_boot_time):
* frame.c (xrdb_get_resource):
* gtkutil.c (hierarchy_ch_cb, qttip_cb, style_changed_cb)
(delete_cb, xg_dialog_response_cb, xg_maybe_add_timer)
(xg_get_file_name_from_selector, menuitem_destroy_callback)
(menuitem_highlight_callback, menu_destroy_callback)
(xg_update_menu_item, xg_modify_menubar_widgets, menubar_map_cb)
(xg_tool_bar_callback, xg_get_tool_bar_widgets)
(xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
(xg_tool_bar_help_callback, tb_size_cb):
* image.c (xpm_alloc_color, png_read_from_memory)
(png_read_from_file, png_load_body, our_memory_skip_input_data)
(jpeg_memory_src, jpeg_file_src, imagemagick_load_image)
(syms_of_image):
* keymap.c (describe_map):
* nsfns.m (Fns_display_monitor_attributes_list):
* nsmenu.m (process_dialog:):
* nsterm.m (hold_event):
* process.c (wait_reading_process_output):
* regex.c (REGEX_REALLOCATE, re_set_registers, re_exec, regexec):
* scroll.c (do_direct_scrolling, scrolling_1):
* termcap.c (tgetent):
* window.c (check_window_containing, add_window_to_list)
(freeze_window_starts):
* xdisp.c (compare_overlay_entries, vmessage):
* xfns.c (x_window, x_get_monitor_attributes_xinerama)
(x_get_monitor_attributes_xrandr)
(Fx_display_monitor_attributes_list, x_display_info_for_name)
(Fx_open_connection, file_dialog_cb, file_dialog_unmap_cb):
* xfont.c (xfont_match, xfont_open):
* xmenu.c (x_menu_wait_for_event, menu_highlight_callback)
(menubar_selection_callback, menu_position_func)
(popup_selection_callback, create_and_show_popup_menu)
(dialog_selection_callback, create_and_show_dialog):
* xrdb.c (x_get_string_resource):
(main) [TESTRM]:
* xsmfns.c (x_session_check_input):
* xterm.c (x_draw_glyphless_glyph_string_foreground)
(xm_scroll_callback, xg_scroll_callback, xg_end_scroll_callback)
(xaw_jump_callback, xaw_scroll_callback):
Omit unnecessary casts.
Diffstat (limited to 'src/xfns.c')
-rw-r--r-- | src/xfns.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/src/xfns.c b/src/xfns.c index 92a7964eb7..4f728ad59b 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -2331,12 +2331,8 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) /* maybe_set_screen_title_format (shell_widget); */ pane_widget = lw_create_widget ("main", "pane", widget_id_tick++, - (widget_value *) NULL, - shell_widget, False, - (lw_callback) NULL, - (lw_callback) NULL, - (lw_callback) NULL, - (lw_callback) NULL); + NULL, shell_widget, False, + NULL, NULL, NULL, NULL); ac = 0; XtSetArg (al[ac], XtNvisual, FRAME_X_VISUAL (f)); ac++; @@ -2483,8 +2479,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) */ XChangeProperty (XtDisplay (frame_widget), XtWindow (frame_widget), FRAME_X_DISPLAY_INFO (f)->Xatom_wm_protocols, - XA_ATOM, 32, PropModeAppend, - (unsigned char*) NULL, 0); + XA_ATOM, 32, PropModeAppend, NULL, 0); /* Make all the standard events reach the Emacs frame. */ attributes.event_mask = STANDARD_EVENT_SET; @@ -4009,7 +4004,7 @@ x_get_monitor_attributes_xinerama (struct x_display_info *dpyinfo) / x_display_pixel_width (dpyinfo)); mm_height_per_pixel = ((double) HeightMMOfScreen (dpyinfo->screen) / x_display_pixel_height (dpyinfo)); - monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors)); + monitors = xzalloc (n_monitors * sizeof *monitors); for (i = 0; i < n_monitors; ++i) { struct MonitorInfo *mi = &monitors[i]; @@ -4069,7 +4064,7 @@ x_get_monitor_attributes_xrandr (struct x_display_info *dpyinfo) return Qnil; } n_monitors = resources->noutput; - monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors)); + monitors = xzalloc (n_monitors * sizeof *monitors); #ifdef HAVE_XRRGETOUTPUTPRIMARY pxid = XRRGetOutputPrimary (dpy, dpyinfo->root_window); @@ -4225,7 +4220,7 @@ Internal use only, use `display-monitor-attributes-list' instead. */) #endif n_monitors = gdk_screen_get_n_monitors (gscreen); monitor_frames = Fmake_vector (make_number (n_monitors), Qnil); - monitors = (struct MonitorInfo *) xzalloc (n_monitors * sizeof (*monitors)); + monitors = xzalloc (n_monitors * sizeof *monitors); FOR_EACH_FRAME (rest, frame) { @@ -4463,8 +4458,7 @@ x_display_info_for_name (Lisp_Object name) validate_x_resource_name (); - dpyinfo = x_term_init (name, (char *)0, - SSDATA (Vx_resource_name)); + dpyinfo = x_term_init (name, 0, SSDATA (Vx_resource_name)); if (dpyinfo == 0) error ("Cannot connect to X server %s", SDATA (name)); @@ -4497,10 +4491,7 @@ terminate Emacs if we can't open the connection. error ("Not using X Windows"); /* That doesn't stop us anymore. */ #endif - if (! NILP (xrm_string)) - xrm_option = SSDATA (xrm_string); - else - xrm_option = (char *) 0; + xrm_option = NILP (xrm_string) ? 0 : SSDATA (xrm_string); validate_x_resource_name (); @@ -5724,8 +5715,8 @@ DEFUN ("x-uses-old-gtk-dialog", Fx_uses_old_gtk_dialog, static void file_dialog_cb (Widget widget, XtPointer client_data, XtPointer call_data) { - int *result = (int *) client_data; - XmAnyCallbackStruct *cb = (XmAnyCallbackStruct *) call_data; + int *result = client_data; + XmAnyCallbackStruct *cb = call_data; *result = cb->reason; } @@ -5738,7 +5729,7 @@ file_dialog_cb (Widget widget, XtPointer client_data, XtPointer call_data) static void file_dialog_unmap_cb (Widget widget, XtPointer client_data, XtPointer call_data) { - int *result = (int *) client_data; + int *result = client_data; *result = XmCR_CANCEL; } |