diff --git a/src/ChangeLog b/src/ChangeLog index e638728a655a9f0c491afd9956ee5176bd189029..a1e5f3a22007206677374d823e6a508fd18cf80f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,34 @@ +2011-06-11 Paul Eggert + + * buffer.c (Qclone_number): Remove for now, as it's unused. + (record_buffer, Funrecord_buffer): Rename local to avoid shadowing. + (record_buffer): Remove unused local. + * frame.c (other_visible_frames, frame_buffer_list): Now static. + (set_frame_buffer_list): Remove; unused. + * frame.h (other_visible_frames): Remove decl. + * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF. + * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls. + (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only + if HAVE_GPM. + * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF. + * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): + Define only if HAVE_GPM. + * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static. + (update_hints_inhibit): Remove; never set. All uses removed. + * widgetprv.h (emacsFrameClassRec): Remove decl. + * window.c (delete_deletable_window): Now returns void, since it + wasn't returning anything. + (compare_window_configurations): Remove unused locals. + * xfns.c (x_set_scroll_bar_default_width): Remove unused locals. + * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF. + Omit no-longer-needed #ifdef USE_X_TOOLKIT, since USE_X_TOOLKIT is + implied by USE_GTK || USE_MOTIF. + (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers + the same widths as pointers. This follows up on the 2011-05-06 patch. + * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID. + * xterm.h: Likewise. + (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF. + 2011-06-11 Martin Rudalics * window.c (delete_deletable_window): Re-add. diff --git a/src/buffer.c b/src/buffer.c index bd059cdbe140373b3c9b8c17d25a468f92c03c1a..7030fea100209982ee95222a6abadbeb675c5d19 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -139,7 +139,7 @@ static Lisp_Object Qoverlayp; Lisp_Object Qpriority, Qbefore_string, Qafter_string; -static Lisp_Object Qclone_number, Qevaporate; +static Lisp_Object Qevaporate; Lisp_Object Qmodification_hooks; Lisp_Object Qinsert_in_front_hooks; @@ -1664,9 +1664,8 @@ with SIGHUP. */) void record_buffer (Lisp_Object buffer) { - Lisp_Object aelt, link, tem; + Lisp_Object aelt, aelt_cons, tem; register struct frame *f = XFRAME (selected_frame); - register struct window *w = XWINDOW (FRAME_SELECTED_WINDOW (f)); CHECK_BUFFER (buffer); @@ -1676,10 +1675,10 @@ record_buffer (Lisp_Object buffer) tem = Vinhibit_quit; Vinhibit_quit = Qt; aelt = Frassq (buffer, Vbuffer_alist); - link = Fmemq (aelt, Vbuffer_alist); + aelt_cons = Fmemq (aelt, Vbuffer_alist); Vbuffer_alist = Fdelq (aelt, Vbuffer_alist); - XSETCDR (link, Vbuffer_alist); - Vbuffer_alist = link; + XSETCDR (aelt_cons, Vbuffer_alist); + Vbuffer_alist = aelt_cons; Vinhibit_quit = tem; /* Update buffer list of selected frame. */ @@ -1714,7 +1713,7 @@ DEFUN ("unrecord-buffer", Funrecord_buffer, Sunrecord_buffer, 1, 1, 0, Return BUFFER. */) (Lisp_Object buffer) { - Lisp_Object aelt, link, tem; + Lisp_Object aelt, aelt_cons, tem; register struct frame *f = XFRAME (selected_frame); CHECK_BUFFER (buffer); @@ -1725,10 +1724,10 @@ Return BUFFER. */) tem = Vinhibit_quit; Vinhibit_quit = Qt; aelt = Frassq (buffer, Vbuffer_alist); - link = Fmemq (aelt, Vbuffer_alist); + aelt_cons = Fmemq (aelt, Vbuffer_alist); Vbuffer_alist = Fdelq (aelt, Vbuffer_alist); - XSETCDR (link, Qnil); - Vbuffer_alist = nconc2 (Vbuffer_alist, link); + XSETCDR (aelt_cons, Qnil); + Vbuffer_alist = nconc2 (Vbuffer_alist, aelt_cons); Vinhibit_quit = tem; /* Update buffer lists of selected frame. */ diff --git a/src/frame.c b/src/frame.c index 6baf2d0e6710649681f6e60b978c625cc4c03cbd..66e0078d3822a4f4b071ceca1ebaf5fa6f64fa11 100644 --- a/src/frame.c +++ b/src/frame.c @@ -1115,7 +1115,7 @@ Otherwise, include all frames. */) 0 if all frames aside from F are invisible. (Exception: if F is the terminal frame, and we are using X, return 1.) */ -int +static int other_visible_frames (FRAME_PTR f) { /* We know the selected frame is visible, @@ -2012,20 +2012,12 @@ frame_buffer_predicate (Lisp_Object frame) /* Return the buffer-list of the selected frame. */ -Lisp_Object +static Lisp_Object frame_buffer_list (Lisp_Object frame) { return XFRAME (frame)->buffer_list; } -/* Set the buffer-list of the selected frame. */ - -void -set_frame_buffer_list (Lisp_Object frame, Lisp_Object list) -{ - XFRAME (frame)->buffer_list = list; -} - /* Discard BUFFER from the buffer-list and buried-buffer-list of each frame. */ void diff --git a/src/frame.h b/src/frame.h index db57b1be9801b3df2e56df84c2d15d0a56db183b..8dccfb8540a7da92c853ac966810354558698974 100644 --- a/src/frame.h +++ b/src/frame.h @@ -844,7 +844,6 @@ extern struct frame *make_frame_without_minibuffer (Lisp_Object, struct kboard *, Lisp_Object); #endif /* HAVE_WINDOW_SYSTEM */ -extern int other_visible_frames (struct frame *); extern void frame_make_pointer_invisible (void); extern void frame_make_pointer_visible (void); extern Lisp_Object delete_frame (Lisp_Object, Lisp_Object); diff --git a/src/keyboard.h b/src/keyboard.h index 802c99edb5ef073ea6755ac595250d2eca2206f9..20763c35f3a2c44fe89cb4d7e822e65315cfb8a0 100644 --- a/src/keyboard.h +++ b/src/keyboard.h @@ -268,7 +268,9 @@ extern Lisp_Object menu_items; /* If non-nil, means that the global vars defined here are already in use. Used to detect cases where we try to re-enter this non-reentrant code. */ +#if defined USE_GTK || defined USE_MOTIF extern Lisp_Object menu_items_inuse; +#endif /* Number of slots currently allocated in menu_items. */ extern int menu_items_allocated; diff --git a/src/lisp.h b/src/lisp.h index ae9296b49447f0e7a9218c5ee47d3b3366b0c801..8aa36601dd7479ea6c508a3a8bcf53d8665e9b7c 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -3222,9 +3222,7 @@ EXFUN (Fframe_parameter, 2); EXFUN (Fmodify_frame_parameters, 2); EXFUN (Fraise_frame, 1); EXFUN (Fredirect_frame_focus, 2); -extern Lisp_Object frame_buffer_list (Lisp_Object); extern void frames_discard_buffer (Lisp_Object); -extern void set_frame_buffer_list (Lisp_Object, Lisp_Object); extern void syms_of_frame (void); /* Defined in emacs.c */ @@ -3281,8 +3279,10 @@ extern int wait_reading_process_output (int, int, int, int, int); extern void add_keyboard_wait_descriptor (int); extern void delete_keyboard_wait_descriptor (int); +#ifdef HAVE_GPM extern void add_gpm_wait_descriptor (int); extern void delete_gpm_wait_descriptor (int); +#endif extern void close_process_descs (void); extern void init_process (void); extern void syms_of_process (void); diff --git a/src/menu.c b/src/menu.c index 7eda4c6ebb5aad78ba4ce108d9818a9f08708a28..fa31c8a51c1b01888d6433505765c9c3845de9af 100644 --- a/src/menu.c +++ b/src/menu.c @@ -67,6 +67,9 @@ Lisp_Object menu_items; /* If non-nil, means that the global vars defined here are already in use. Used to detect cases where we try to re-enter this non-reentrant code. */ +#if ! (defined USE_GTK || defined USE_MOTIF) +static +#endif Lisp_Object menu_items_inuse; /* Number of slots currently allocated in menu_items. */ diff --git a/src/process.c b/src/process.c index 51deb1c933f6088c7a8cff64a0f961fd001e12f2..9ff7dd198dd951b3d5fbb34c54fad1332c12c710 100644 --- a/src/process.c +++ b/src/process.c @@ -6593,6 +6593,8 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p, +# ifdef HAVE_GPM + void add_gpm_wait_descriptor (int desc) { @@ -6605,6 +6607,8 @@ delete_gpm_wait_descriptor (int desc) delete_keyboard_wait_descriptor (desc); } +# endif + # ifdef SIGIO /* Return nonzero if *MASK has a bit set diff --git a/src/widget.c b/src/widget.c index 3053ceaea133a66babd4f4d2fed2d31f9b363e16..7d32e30eed7ceeab94090a56fd68f44c6d4b6331 100644 --- a/src/widget.c +++ b/src/widget.c @@ -78,7 +78,7 @@ along with GNU Emacs. If not, see . */ static void EmacsFrameInitialize (Widget request, Widget new, ArgList dum1, Cardinal *dum2); static void EmacsFrameDestroy (Widget widget); static void EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs); -void EmacsFrameResize (Widget widget); +static void EmacsFrameResize (Widget widget); static Boolean EmacsFrameSetValues (Widget cur_widget, Widget req_widget, Widget new_widget, ArgList dum1, Cardinal *dum2); static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeometry *result); @@ -137,7 +137,7 @@ emacsFrameTranslations [] = "\ "; */ -EmacsFrameClassRec emacsFrameClassRec = { +static EmacsFrameClassRec emacsFrameClassRec = { { /* core fields */ /* superclass */ &widgetClassRec, /* class_name */ "EmacsFrame", @@ -463,10 +463,6 @@ set_frame_size (EmacsFrame ew) } } -/* Nonzero tells update_wm_hints not to do anything - (the caller should call update_wm_hints explicitly later.) */ -int update_hints_inhibit; - static void update_wm_hints (EmacsFrame ew) { @@ -481,9 +477,6 @@ update_wm_hints (EmacsFrame ew) int base_height; int min_rows = 0, min_cols = 0; - if (update_hints_inhibit) - return; - #if 0 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); #endif @@ -703,7 +696,7 @@ EmacsFrameDestroy (Widget widget) UNBLOCK_INPUT; } -void +static void EmacsFrameResize (Widget widget) { EmacsFrame ew = (EmacsFrame)widget; diff --git a/src/widgetprv.h b/src/widgetprv.h index 5df0976f8797eb6978d71197f34cd3302835ff74..997a70e026cfd1fe1875c5239242b55f0b1326f8 100644 --- a/src/widgetprv.h +++ b/src/widgetprv.h @@ -70,9 +70,4 @@ typedef struct _EmacsFrameClassRec { /* full class record declaration */ EmacsFrameClassPart emacs_frame_class; } EmacsFrameClassRec; -extern EmacsFrameClassRec emacsFrameClassRec; /* class pointer */ - - - #endif /* _EmacsFrameP_h */ - diff --git a/src/window.c b/src/window.c index ae5798c7ebc74dc872a0696d0d61eeae70f00a54..4345a13ea5947e792b6d7297e613d7e65d347c01 100644 --- a/src/window.c +++ b/src/window.c @@ -1976,7 +1976,7 @@ recombine_windows (Lisp_Object window) } /* If WINDOW can be deleted, delete it. */ -static Lisp_Object +static void delete_deletable_window (Lisp_Object window) { if (!NILP (call1 (Qwindow_deletable_p, window))) @@ -6364,7 +6364,6 @@ compare_window_configurations (Lisp_Object configuration1, Lisp_Object configura for (i = 0; i < sws1->header.size; i++) { struct saved_window *sw1, *sw2; - int w1_is_current, w2_is_current; sw1 = SAVED_WINDOW_N (sws1, i); sw2 = SAVED_WINDOW_N (sws2, i); diff --git a/src/xfns.c b/src/xfns.c index 3d74ead330aa0ca47dc58bd58bf9b3b69dcdd858..8417db7d6e5375b94633333afcb8968d8427a523 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -1699,14 +1699,14 @@ void x_set_scroll_bar_default_width (struct frame *f) { int wid = FRAME_COLUMN_WIDTH (f); - int minw = 16; - int width; #ifdef USE_TOOLKIT_SCROLL_BARS #ifdef USE_GTK - minw = xg_get_default_scrollbar_width (f); + int minw = xg_get_default_scrollbar_width (f); +#else + int minw = 16; #endif /* A minimum width of 14 doesn't look good for toolkit scroll bars. */ - width = minw + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM; + int width = minw + 2 * VERTICAL_SCROLL_BAR_WIDTH_TRIM; FRAME_CONFIG_SCROLL_BAR_COLS (f) = (width + wid - 1) / wid; FRAME_CONFIG_SCROLL_BAR_WIDTH (f) = width; #else diff --git a/src/xmenu.c b/src/xmenu.c index 7d7515a8f2552d6ea6f9a6b6183f0df9e66e4763..db1d8823a7ecf77729d9a1cd2f65556df8ee5524 100644 --- a/src/xmenu.c +++ b/src/xmenu.c @@ -347,6 +347,8 @@ for instance using the window manager, then this produces a quit and #ifndef MSDOS +#if defined USE_GTK || defined USE_MOTIF + /* Set menu_items_inuse so no other popup menu or dialog is created. */ void @@ -354,12 +356,12 @@ x_menu_set_in_use (int in_use) { menu_items_inuse = in_use ? Qt : Qnil; popup_activated_flag = in_use; -#ifdef USE_X_TOOLKIT if (popup_activated_flag) x_activate_timeout_atimer (); -#endif } +#endif + /* Wait for an X event to arrive or for a timer to expire. */ #ifndef USE_MOTIF @@ -1919,9 +1921,9 @@ create_and_show_dialog (FRAME_PTR f, widget_value *first_wv) static void dialog_selection_callback (Widget widget, LWLIB_ID id, XtPointer client_data) { - /* The EMACS_INT cast avoids a warning. There's no problem + /* Treat the pointer as an integer. There's no problem as long as pointers have enough bits to hold small integers. */ - if ((int) (EMACS_INT) client_data != -1) + if ((intptr_t) client_data != -1) menu_item_selection = (Lisp_Object *) client_data; BLOCK_INPUT; diff --git a/src/xterm.c b/src/xterm.c index d6d6457f522792d2277746c51c9bf5e62e1d9598..9673e5e315ee121d5435da88aec9cc3505bb2dfe 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1446,6 +1446,8 @@ x_frame_of_widget (Widget widget) } +#ifdef USE_LUCID + /* Allocate a color which is lighter or darker than *PIXEL by FACTOR or DELTA. Try a color with RGB values multiplied by FACTOR first. If this produces the same color as PIXEL, try a color where all RGB @@ -1461,6 +1463,8 @@ x_alloc_lighter_color_for_widget (Widget widget, Display *display, Colormap cmap return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta); } +#endif + /* Structure specifying which arguments should be passed by Xt to cvt_string_to_pixel. We want the widget's screen and colormap. */ diff --git a/src/xterm.h b/src/xterm.h index 2938de9b339276a77cbeddb4a0e05152b152b3cd..47d7e533769ad45f25e786b6c97502e025d926c0 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -973,10 +973,12 @@ extern void x_delete_terminal (struct terminal *terminal); extern unsigned long x_copy_color (struct frame *, unsigned long); #ifdef USE_X_TOOLKIT extern XtAppContext Xt_app_con; +extern void x_activate_timeout_atimer (void); +#endif +#ifdef USE_LUCID extern int x_alloc_lighter_color_for_widget (Widget, Display *, Colormap, unsigned long *, double, int); -extern void x_activate_timeout_atimer (void); #endif extern int x_alloc_nearest_color (struct frame *, Colormap, XColor *); extern void x_query_colors (struct frame *f, XColor *, int); @@ -1069,7 +1071,9 @@ extern void x_free_dpy_colors (Display *, Screen *, Colormap, /* Defined in xmenu.c */ +#if defined USE_GTK || defined USE_MOTIF extern void x_menu_set_in_use (int); +#endif #ifdef USE_MOTIF extern void x_menu_wait_for_event (void *data); #endif