From 578c21e6cbfcd42d2b765ff93a5340555ef91d9d Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 12 Jun 2011 23:53:31 -0700 Subject: [PATCH] Remove unnecessary casts. * xterm.c (x_term_init): * xfns.c (x_set_border_pixel): * widget.c (create_frame_gcs): Remove casts to unsigned long etc. These aren't needed now that we assume ANSI C. --- src/ChangeLog | 6 ++++++ src/widget.c | 12 ++++-------- src/xfns.c | 3 +-- src/xterm.c | 2 +- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 686c728f0a3..ff6945d8656 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2011-06-13 Paul Eggert + Remove unnecessary casts. + * xterm.c (x_term_init): + * xfns.c (x_set_border_pixel): + * widget.c (create_frame_gcs): Remove casts to unsigned long etc. + These aren't needed now that we assume ANSI C. + * sound.c (Fplay_sound_internal): Remove cast to unsigned long. It's more likely to cause problems (due to unsigned overflow) than to cure them. diff --git a/src/widget.c b/src/widget.c index 3053ceaea13..daea382d654 100644 --- a/src/widget.c +++ b/src/widget.c @@ -523,14 +523,11 @@ create_frame_gcs (ew) struct frame *s = ew->emacs_frame.frame; s->output_data.x->normal_gc - = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), - (unsigned long)0, (XGCValues *)0); + = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0); s->output_data.x->reverse_gc - = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), - (unsigned long)0, (XGCValues *)0); + = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0); s->output_data.x->cursor_gc - = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), - (unsigned long)0, (XGCValues *)0); + = XCreateGC (XtDisplay (ew), RootWindowOfScreen (XtScreen (ew)), 0, 0); s->output_data.x->black_relief.gc = 0; s->output_data.x->white_relief.gc = 0; } @@ -589,8 +586,7 @@ setup_frame_gcs (EmacsFrame ew) = XCreatePixmapFromBitmapData (XtDisplay(ew), RootWindowOfScreen (XtScreen (ew)), setup_frame_cursor_bits, 2, 2, - (unsigned long)0, (unsigned long)1, - ew->core.depth); + 0, 1, ew->core.depth); /* Normal video */ gc_values.foreground = ew->emacs_frame.foreground_pixel; diff --git a/src/xfns.c b/src/xfns.c index 8417db7d6e5..f847e41855e 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1074,8 +1074,7 @@ x_set_border_pixel (struct frame *f, int pix) if (FRAME_X_WINDOW (f) != 0 && f->border_width > 0) { BLOCK_INPUT; - XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), - (unsigned long)pix); + XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), pix); UNBLOCK_INPUT; if (FRAME_VISIBLE_P (f)) diff --git a/src/xterm.c b/src/xterm.c index 39e4abb1630..85c19ed16af 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -10268,7 +10268,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, gray_bitmap_bits, gray_bitmap_width, gray_bitmap_height, - (unsigned long) 1, (unsigned long) 0, 1); + 1, 0, 1); } #ifdef HAVE_X_I18N -- 2.39.2