* buffer.c (Qclone_number): Remove for now, as it's unused.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 Jun 2011 21:31:32 +0000 (14:31 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 11 Jun 2011 21:31:32 +0000 (14:31 -0700)
(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.

15 files changed:
src/ChangeLog
src/buffer.c
src/frame.c
src/frame.h
src/keyboard.h
src/lisp.h
src/menu.c
src/process.c
src/widget.c
src/widgetprv.h
src/window.c
src/xfns.c
src/xmenu.c
src/xterm.c
src/xterm.h

index e638728..a1e5f3a 100644 (file)
@@ -1,3 +1,34 @@
+2011-06-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * 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  <rudalics@gmx.at>
 
        * window.c (delete_deletable_window): Re-add.
index bd059cd..7030fea 100644 (file)
@@ -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.  */
index 6baf2d0..66e0078 100644 (file)
@@ -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
index db57b1b..8dccfb8 100644 (file)
@@ -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);
index 802c99e..20763c3 100644 (file)
@@ -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;
index ae9296b..8aa3660 100644 (file)
@@ -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);
index 7eda4c6..fa31c8a 100644 (file)
@@ -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.  */
index 51deb1c..9ff7dd1 100644 (file)
@@ -6593,6 +6593,8 @@ DEFUN ("process-filter-multibyte-p", Fprocess_filter_multibyte_p,
 
 \f
 
+# 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
index 3053cea..7d32e30 100644 (file)
@@ -78,7 +78,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 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;
index 5df0976..997a70e 100644 (file)
@@ -70,9 +70,4 @@ typedef struct _EmacsFrameClassRec {  /* full class record declaration */
     EmacsFrameClassPart        emacs_frame_class;
 } EmacsFrameClassRec;
 
-extern EmacsFrameClassRec emacsFrameClassRec;   /* class pointer */
-
-
-
 #endif /* _EmacsFrameP_h */
-
index ae5798c..4345a13 100644 (file)
@@ -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);
index 3d74ead..8417db7 100644 (file)
@@ -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
index 7d7515a..db1d882 100644 (file)
@@ -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;
index d6d6457..9673e5e 100644 (file)
@@ -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.  */
index 2938de9..47d7e53 100644 (file)
@@ -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