]> git.eshelyaron.com Git - emacs.git/commitdiff
Clean up some extern decls.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Sep 2012 16:56:31 +0000 (09:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 2 Sep 2012 16:56:31 +0000 (09:56 -0700)
Mostly, this hoists extern decls out of .c files and into .h files.
That way, we're more likely to catch errors if the interfaces change.
* alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
declare xg_mark_data.
* dispextern.h (x_frame_parm_handlers):
* font.h (Qxft):
* lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
(Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
(Qultra_bold, Qoblique, Qitalic):
Move extern decl here from .c file.
* alloc.c (xg_mark_data) [USE_GTK]:
* doc.c (Qclosure):
* eval.c (Qlexical_binding):
* fns.c (time) [!HAVE_UNISTD_H]:
* gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
(Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
* image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
* lread.c (Qinternal_interpreter_environment):
* minibuf.c (Qbuffer):
* process.c (QCfamily, QCfilter):
* widget.c (free_frame_faces):
* xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
* xfont.c (x_clear_errors):
* xterm.c (x_frame_parm_handlers):
Remove now-redundant extern decls.
* keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
* xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
Now static.
* xfaces.c: Remove unnecessary static decls.
* xterm.c (updating_frame): Remove decl of nonexistent object.

19 files changed:
src/ChangeLog
src/alloc.c
src/dispextern.h
src/doc.c
src/eval.c
src/fns.c
src/font.h
src/gtkutil.c
src/image.c
src/keyboard.c
src/keyboard.h
src/lisp.h
src/lread.c
src/minibuf.c
src/process.c
src/widget.c
src/xfaces.c
src/xfont.c
src/xterm.c

index 4986726d7c8114af2ffcc5fd9f7b5e3fddf5e71c..a5978e6456b2fa1b2902d6b3602dadb934f2f962 100644 (file)
@@ -1,5 +1,37 @@
 2012-09-02  Paul Eggert  <eggert@cs.ucla.edu>
 
+       Clean up some extern decls.
+       Mostly, this hoists extern decls out of .c files and into .h files.
+       That way, we're more likely to catch errors if the interfaces change.
+       * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
+       declare xg_mark_data.
+       * dispextern.h (x_frame_parm_handlers):
+       * font.h (Qxft):
+       * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
+       (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
+       (Qultra_bold, Qoblique, Qitalic):
+       Move extern decl here from .c file.
+       * alloc.c (xg_mark_data) [USE_GTK]:
+       * doc.c (Qclosure):
+       * eval.c (Qlexical_binding):
+       * fns.c (time) [!HAVE_UNISTD_H]:
+       * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
+       (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
+       * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
+       * lread.c (Qinternal_interpreter_environment):
+       * minibuf.c (Qbuffer):
+       * process.c (QCfamily, QCfilter):
+       * widget.c (free_frame_faces):
+       * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
+       * xfont.c (x_clear_errors):
+       * xterm.c (x_frame_parm_handlers):
+       Remove now-redundant extern decls.
+       * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
+       * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
+       Now static.
+       * xfaces.c: Remove unnecessary static decls.
+       * xterm.c (updating_frame): Remove decl of nonexistent object.
+
        * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
        when building globals.h, as the objects that are not built on
        this host are not needed to compile C files on this host.
index e8637471bc70f5cec1ac496b9a003a425e31103f..188a514376d6af56788a51567fe6f421d1bf8df1 100644 (file)
@@ -69,6 +69,9 @@ extern void *sbrk ();
 
 #include <fcntl.h>
 
+#ifdef USE_GTK
+# include "gtkutil.h"
+#endif
 #ifdef WINDOWSNT
 #include "w32.h"
 #endif
@@ -5478,10 +5481,7 @@ See Info node `(elisp)Garbage Collection'.  */)
   mark_kboards ();
 
 #ifdef USE_GTK
-  {
-    extern void xg_mark_data (void);
-    xg_mark_data ();
-  }
+  xg_mark_data ();
 #endif
 
 #if (GC_MARK_STACK == GC_MAKE_GCPROS_NOOPS \
index 1140d98f8a7ed52d6ce9128eaed35581e9516bd3..e74e7deb5910fdce939d68ea1fef96214b55095e 100644 (file)
@@ -3251,9 +3251,12 @@ void x_implicitly_set_name (struct frame *, Lisp_Object, Lisp_Object);
 
 extern Lisp_Object tip_frame;
 extern Window tip_window;
+extern frame_parm_handler x_frame_parm_handlers[];
+
 extern void start_hourglass (void);
 extern void cancel_hourglass (void);
 extern int hourglass_shown_p;
+
 struct atimer;                 /* Defined in atimer.h.  */
 /* If non-null, an asynchronous timer that, when it expires, displays
    an hourglass cursor on all frames.  */
index b4eadfff87537a210f3ce2272681a962013aab8c..02a5b4b814395630f869a7f8ec944474adeaca2b 100644 (file)
--- a/src/doc.c
+++ b/src/doc.c
@@ -37,7 +37,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 Lisp_Object Qfunction_documentation;
 
-extern Lisp_Object Qclosure;
 /* Buffer used for reading from documentation file.  */
 static char *get_doc_string_buffer;
 static ptrdiff_t get_doc_string_buffer_size;
index c56be10c5a06bf9d40b76c734faf91715c54cd4d..ad1daf721b8350af208edec1e94d1e37531ca4b4 100644 (file)
@@ -2232,7 +2232,6 @@ eval_sub (Lisp_Object form)
       if (EQ (funcar, Qmacro))
        {
          ptrdiff_t count = SPECPDL_INDEX ();
-         extern Lisp_Object Qlexical_binding;
          Lisp_Object exp;
          /* Bind lexical-binding during expansion of the macro, so the
             macro can know reliably if the code it outputs will be
index 2dee8515799c08af8137a008ef655a1a7c65ceb5..4d82e4e6e1dd2c341708faad999c48069ec12921 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -52,10 +52,6 @@ static Lisp_Object Qcodeset, Qdays, Qmonths, Qpaper;
 static Lisp_Object Qmd5, Qsha1, Qsha224, Qsha256, Qsha384, Qsha512;
 
 static int internal_equal (Lisp_Object , Lisp_Object, int, int);
-
-#ifndef HAVE_UNISTD_H
-extern long time ();
-#endif
 \f
 DEFUN ("identity", Fidentity, Sidentity, 1, 1, 0,
        doc: /* Return the argument unchanged.  */)
index 6e9387f76329381235442bd48b9859d9accf68d8..3b90bc2ab8a5fc8b98bb945194695d05cf236203 100644 (file)
@@ -817,6 +817,7 @@ extern struct font_driver xfont_driver;
 extern void syms_of_xfont (void);
 extern void syms_of_ftxfont (void);
 #ifdef HAVE_XFT
+extern Lisp_Object Qxft;
 extern struct font_driver xftfont_driver;
 extern void syms_of_xftfont (void);
 #elif defined HAVE_FREETYPE
index 939e472d6d25d9445244e09c000827d43de502d6..48a83725fd97488d5a5607eb2dbb7bc465ac263f 100644 (file)
@@ -2019,11 +2019,6 @@ xg_get_file_name (FRAME_PTR f,
 
 #if USE_NEW_GTK_FONT_CHOOSER
 
-extern Lisp_Object Qxft, Qnormal;
-extern Lisp_Object Qextra_light, Qlight, Qsemi_light, Qsemi_bold;
-extern Lisp_Object Qbold, Qextra_bold, Qultra_bold;
-extern Lisp_Object Qoblique, Qitalic;
-
 #define XG_WEIGHT_TO_SYMBOL(w)                 \
   (w <= PANGO_WEIGHT_THIN ? Qextra_light       \
    : w <= PANGO_WEIGHT_ULTRALIGHT ? Qlight     \
index d4e78d41000d9dc908f215278b706b312ef59175..a067dae77376b832bd2c762ae0cba5bca2a13614 100644 (file)
@@ -570,7 +570,6 @@ static void x_emboss (struct frame *, struct image *);
 static int x_build_heuristic_mask (struct frame *, struct image *,
                                    Lisp_Object);
 #ifdef HAVE_NTGUI
-extern Lisp_Object Vlibrary_cache, QCloaded_from;
 #define CACHE_IMAGE_TYPE(type, status) \
   do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0)
 #else
index ff2b75e351c387f63d58e3190b7594c3abaf0d19..464c3ae0d66decb4ba201e589f039b4b17738584 100644 (file)
@@ -1315,7 +1315,7 @@ usage: (track-mouse BODY...)  */)
    If ignore_mouse_drag_p is non-zero, ignore (implicit) mouse movement
    after resizing the tool-bar window.  */
 
-#if !defined HAVE_WINDOW_SYSTEM
+#if !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS
 static
 #endif
 int ignore_mouse_drag_p;
index 98b1933f3f9739fac1dc50fa49fe85dedeccb324..91484b3649bdba0beaccbba86af3775ecd3f1ecd 100644 (file)
@@ -469,7 +469,7 @@ extern int waiting_for_input;
    happens.  */
 extern EMACS_TIME *input_available_clear_time;
 
-#if defined HAVE_WINDOW_SYSTEM
+#if defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS
 extern int ignore_mouse_drag_p;
 #endif
 
index b906e4a1dfdc53c627228102f1604f30ea4aa9f5..75f1b5e802d7b8a1cd8429f10a0016738913a1d7 100644 (file)
@@ -2988,6 +2988,7 @@ extern ptrdiff_t evxprintf (char **, ptrdiff_t *, char const *, ptrdiff_t,
 /* Defined in lread.c.  */
 extern Lisp_Object Qvariable_documentation, Qstandard_input;
 extern Lisp_Object Qbackquote, Qcomma, Qcomma_at, Qcomma_dot, Qfunction;
+extern Lisp_Object Qlexical_binding;
 extern Lisp_Object check_obarray (Lisp_Object);
 extern Lisp_Object intern_1 (const char *, ptrdiff_t);
 extern Lisp_Object intern_c_string_1 (const char *, ptrdiff_t);
@@ -3021,7 +3022,7 @@ intern_c_string (const char *str)
 
 /* Defined in eval.c.  */
 extern Lisp_Object Qautoload, Qexit, Qinteractive, Qcommandp, Qmacro;
-extern Lisp_Object Qinhibit_quit, Qclosure;
+extern Lisp_Object Qinhibit_quit, Qinternal_interpreter_environment, Qclosure;
 extern Lisp_Object Qand_rest;
 extern Lisp_Object Vautoload_queue;
 extern Lisp_Object Vsignaling_function;
@@ -3466,6 +3467,9 @@ extern Lisp_Object Qface;
 extern Lisp_Object Qnormal;
 extern Lisp_Object QCfamily, QCweight, QCslant;
 extern Lisp_Object QCheight, QCname, QCwidth, QCforeground, QCbackground;
+extern Lisp_Object Qextra_light, Qlight, Qsemi_light, Qsemi_bold;
+extern Lisp_Object Qbold, Qextra_bold, Qultra_bold;
+extern Lisp_Object Qoblique, Qitalic;
 extern Lisp_Object Vface_alternative_font_family_alist;
 extern Lisp_Object Vface_alternative_font_registry_alist;
 extern void syms_of_xfaces (void);
index aa3e0cfc5b80bf65198cf738c26704dcc79262f4..1dd6275684b60cb94955e849d103238519f0887a 100644 (file)
@@ -89,8 +89,6 @@ static Lisp_Object Qget_emacs_mule_file_char;
 
 static Lisp_Object Qload_force_doc_strings;
 
-extern Lisp_Object Qinternal_interpreter_environment;
-
 static Lisp_Object Qload_in_progress;
 
 /* The association list of objects read with the #n=object form.
index 41cc48017eb111d4c728ff5737d67b4776d31e76..2035a3e39850d2c42916cd4fc272e06a2b222868 100644 (file)
@@ -1860,7 +1860,6 @@ the values STRING, PREDICATE and `lambda'.  */)
 }
 
 static Lisp_Object Qmetadata;
-extern Lisp_Object Qbuffer;
 
 DEFUN ("internal-complete-buffer", Finternal_complete_buffer, Sinternal_complete_buffer, 3, 3, 0,
        doc: /* Perform completion on buffer names.
index bfac054c3c2a3a1770d51b60668721506503673b..81fa98a028d46d4c7caf721fe248070d2a17530e 100644 (file)
@@ -165,16 +165,6 @@ static Lisp_Object QClocal, QCremote, QCcoding;
 static Lisp_Object QCserver, QCnowait, QCnoquery, QCstop;
 static Lisp_Object QCsentinel, QClog, QCoptions, QCplist;
 static Lisp_Object Qlast_nonmenu_event;
-/* QCfamily is declared and initialized in xfaces.c,
-   QCfilter in keyboard.c.  */
-extern Lisp_Object QCfamily, QCfilter;
-
-/* Qexit is declared and initialized in eval.c.  */
-
-/* QCfamily is defined in xfaces.c.  */
-extern Lisp_Object QCfamily;
-/* QCfilter is defined in keyboard.c.  */
-extern Lisp_Object QCfilter;
 
 #define NETCONN_P(p) (EQ (XPROCESS (p)->type, Qnetwork))
 #define NETCONN1_P(p) (EQ (p->type, Qnetwork))
index b94c30f4e9c2746ba59535d9644d07f62c5143cf..ea9bdb61b1387f8759303ef828f69c3a8bb884df 100644 (file)
@@ -671,8 +671,6 @@ EmacsFrameRealize (Widget widget, XtValueMask *mask, XSetWindowAttributes *attrs
   update_wm_hints (ew);
 }
 
-extern void free_frame_faces (struct frame *);
-
 static void
 EmacsFrameDestroy (Widget widget)
 {
index 5554c4aa7059fa148cbb268f321c9e1c10f80190..4df5caf6f2a8dcbe1b9be5b5c55179b866318796 100644 (file)
@@ -315,9 +315,10 @@ static Lisp_Object QCfontset;
 Lisp_Object Qnormal;
 Lisp_Object Qbold;
 static Lisp_Object Qline, Qwave;
-Lisp_Object Qultra_light, Qextra_light, Qlight;
+static Lisp_Object Qultra_light, Qreverse_oblique, Qreverse_italic;
+Lisp_Object Qextra_light, Qlight;
 Lisp_Object Qsemi_light, Qsemi_bold, Qextra_bold, Qultra_bold;
-Lisp_Object Qoblique, Qreverse_oblique, Qreverse_italic;
+Lisp_Object Qoblique;
 Lisp_Object Qitalic;
 static Lisp_Object Qultra_condensed, Qextra_condensed;
 Lisp_Object Qcondensed;
@@ -452,18 +453,7 @@ static int menu_face_changed_default;
 struct table_entry;
 struct named_merge_point;
 
-static void map_tty_color (struct frame *, struct face *,
-                          enum lface_attribute_index, int *);
-static Lisp_Object resolve_face_name (Lisp_Object, int);
 static void set_font_frame_param (Lisp_Object, Lisp_Object);
-static int get_lface_attributes (struct frame *, Lisp_Object, Lisp_Object *,
-                                int, struct named_merge_point *);
-static ptrdiff_t load_pixmap (struct frame *, Lisp_Object,
-                             unsigned *, unsigned *);
-static struct frame *frame_or_selected_frame (Lisp_Object, int);
-static void load_face_colors (struct frame *, struct face *, Lisp_Object *);
-static void free_face_colors (struct frame *, struct face *);
-static int face_color_gray_p (struct frame *, const char *);
 static struct face *realize_face (struct face_cache *, Lisp_Object *,
                                  int);
 static struct face *realize_non_ascii_face (struct frame *, Lisp_Object,
@@ -473,38 +463,11 @@ static struct face *realize_tty_face (struct face_cache *, Lisp_Object *);
 static int realize_basic_faces (struct frame *);
 static int realize_default_face (struct frame *);
 static void realize_named_face (struct frame *, Lisp_Object, int);
-static int lface_fully_specified_p (Lisp_Object *);
-static int lface_equal_p (Lisp_Object *, Lisp_Object *);
-static unsigned hash_string_case_insensitive (Lisp_Object);
-static unsigned lface_hash (Lisp_Object *);
-static int lface_same_font_attributes_p (Lisp_Object *, Lisp_Object *);
 static struct face_cache *make_face_cache (struct frame *);
 static void clear_face_gcs (struct face_cache *);
 static void free_face_cache (struct face_cache *);
-static int face_fontset (Lisp_Object *);
-static void merge_face_vectors (struct frame *, Lisp_Object *, Lisp_Object*,
-                               struct named_merge_point *);
 static int merge_face_ref (struct frame *, Lisp_Object, Lisp_Object *,
                           int, struct named_merge_point *);
-static int set_lface_from_font (struct frame *, Lisp_Object, Lisp_Object,
-                               int);
-static Lisp_Object lface_from_face_name (struct frame *, Lisp_Object, int);
-static struct face *make_realized_face (Lisp_Object *);
-static void cache_face (struct face_cache *, struct face *, unsigned);
-static void uncache_face (struct face_cache *, struct face *);
-
-#ifdef HAVE_WINDOW_SYSTEM
-
-static GC x_create_gc (struct frame *, unsigned long, XGCValues *);
-static void x_free_gc (struct frame *, GC);
-
-#ifdef USE_X_TOOLKIT
-static void x_update_menu_appearance (struct frame *);
-
-extern void free_frame_menubar (struct frame *);
-#endif /* USE_X_TOOLKIT */
-
-#endif /* HAVE_WINDOW_SYSTEM */
 
 \f
 /***********************************************************************
index cbb24622ae9f2734e706e9f29d4028d8375dab02..be9556d585a51097409ce99c765a5f8850b3ff3b 100644 (file)
@@ -46,7 +46,6 @@ struct xfont_info
 };
 
 /* Prototypes of support functions.  */
-extern void x_clear_errors (Display *);
 
 static XCharStruct *xfont_get_pcm (XFontStruct *, XChar2b *);
 
index 7e61cc4d8eae139bec48f5efb0c0940e4c1956a2..052db0f3e63a74d2455546c3b97339c97da1536b 100644 (file)
@@ -165,13 +165,6 @@ struct x_display_info *x_display_list;
 
 Lisp_Object x_display_name_list;
 
-/* Frame being updated by update_frame.  This is declared in term.c.
-   This is set by update_begin and looked at by all the XT functions.
-   It is zero while not inside an update.  In that case, the XT
-   functions assume that `selected_frame' is the frame to apply to.  */
-
-extern struct frame *updating_frame;
-
 /* This is a frame waiting to be auto-raised, within XTread_socket.  */
 
 static struct frame *pending_autoraise_frame;
@@ -10609,8 +10602,6 @@ x_activate_timeout_atimer (void)
 \f
 /* Set up use of X before we make the first connection.  */
 
-extern frame_parm_handler x_frame_parm_handlers[];
-
 static struct redisplay_interface x_redisplay_interface =
   {
     x_frame_parm_handlers,