diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2019-01-31 15:31:41 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-01-31 15:33:21 -0800 |
commit | 47679e63230da94cffed568a4d5167ffc1baea96 (patch) | |
tree | 45a1f8a1ed3fe07174d509205a4ba1d393435758 | |
parent | 05d2fc7170fb66a87601b1c76ddae2c1b7b4b934 (diff) | |
download | emacs-47679e63230da94cffed568a4d5167ffc1baea96.tar.gz |
Prefer static to extern where either will do
* src/charset.c (charset_table_size):
* src/pdumper.c (dump_private):
* src/sysdep.c (init_sigsegv):
* src/window.c (old_selected_window):
Now static.
* src/charset.c (charset_table_size):
Now int, since the value always fits in int.
* src/gtkutil.c (xg_gtk_initialized): Now present only if
HAVE_XWIDGETS, to make it clearer that this is an xwidgets
hack. All uses changed.
* src/lread.c (ndefsubr): Remove; unused.
* src/pdumper.h: Use usual GNU indenting style for functions,
since my static-vs-extern checking hack relies on it.
(dump_public): Always declare; simpler and doesn’t hurt.
(pdumper_handle_page_fault): Remove unused decl.
-rw-r--r-- | src/charset.c | 2 | ||||
-rw-r--r-- | src/charset.h | 1 | ||||
-rw-r--r-- | src/gtkutil.c | 4 | ||||
-rw-r--r-- | src/lread.c | 3 | ||||
-rw-r--r-- | src/pdumper.c | 2 | ||||
-rw-r--r-- | src/pdumper.h | 34 | ||||
-rw-r--r-- | src/sysdep.c | 4 | ||||
-rw-r--r-- | src/syssignal.h | 1 | ||||
-rw-r--r-- | src/window.c | 2 | ||||
-rw-r--r-- | src/window.h | 1 |
10 files changed, 18 insertions, 36 deletions
diff --git a/src/charset.c b/src/charset.c index 28f6203a66d..7e2e657c7fc 100644 --- a/src/charset.c +++ b/src/charset.c @@ -62,7 +62,7 @@ Lisp_Object Vcharset_hash_table; /* Table of struct charset. */ struct charset *charset_table; -ptrdiff_t charset_table_size; +static int charset_table_size; int charset_table_used; /* Special charsets corresponding to symbols. */ diff --git a/src/charset.h b/src/charset.h index f4bed558cf2..ee697b8d3ef 100644 --- a/src/charset.h +++ b/src/charset.h @@ -248,7 +248,6 @@ extern Lisp_Object Vcharset_hash_table; /* Table of struct charset. */ extern struct charset *charset_table; -extern ptrdiff_t charset_table_size; extern int charset_table_used; #define CHARSET_FROM_ID(id) (charset_table + (id)) diff --git a/src/gtkutil.c b/src/gtkutil.c index 92199bb0af2..75fc9ea5477 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c @@ -147,7 +147,9 @@ struct xg_frame_tb_info GtkTextDirection dir; }; +#ifdef HAVE_XWIDGETS bool xg_gtk_initialized; /* Used to make sure xwidget calls are possible */ +#endif static GtkWidget * xg_get_widget_from_map (ptrdiff_t idx); @@ -5324,7 +5326,9 @@ xg_initialize (void) x_last_font_name = NULL; #endif +#ifdef HAVE_XWIDGETS xg_gtk_initialized = true; +#endif } #endif /* USE_GTK */ diff --git a/src/lread.c b/src/lread.c index dde9ccef549..ff9b75475b8 100644 --- a/src/lread.c +++ b/src/lread.c @@ -4402,8 +4402,6 @@ init_obarray_once (void) } -int ndefsubr; - void defsubr (union Aligned_Lisp_Subr *aname) { @@ -4413,7 +4411,6 @@ defsubr (union Aligned_Lisp_Subr *aname) XSETPVECTYPE (sname, PVEC_SUBR); XSETSUBR (tem, sname); set_symbol_function (sym, tem); - ++ndefsubr; } #ifdef NOTDEF /* Use fset in subr.el now! */ diff --git a/src/pdumper.c b/src/pdumper.c index d4fbc4b0494..301a52804f0 100644 --- a/src/pdumper.c +++ b/src/pdumper.c @@ -5019,7 +5019,7 @@ struct pdumper_loaded_dump_private }; struct pdumper_loaded_dump dump_public; -struct pdumper_loaded_dump_private dump_private; +static struct pdumper_loaded_dump_private dump_private; /* Return a pointer to offset OFFSET within the dump, which begins at DUMP_BASE. DUMP_BASE must be equal to the current dump load diff --git a/src/pdumper.h b/src/pdumper.h index 90c744f0a4e..7be8a8f8775 100644 --- a/src/pdumper.h +++ b/src/pdumper.h @@ -52,8 +52,7 @@ INLINE_HEADER_BEGIN extern void pdumper_remember_scalar_impl (void *data, ptrdiff_t nbytes); -INLINE -void +INLINE void pdumper_remember_scalar (void *data, ptrdiff_t nbytes) { #ifdef HAVE_PDUMPER @@ -70,8 +69,7 @@ extern void pdumper_remember_lv_ptr_raw_impl ( /* Remember the pointer at *PTR. *PTR must be null or point to a Lisp object. TYPE is the rough type of Lisp object to which *PTR points. */ -INLINE -void +INLINE void pdumper_remember_lv_ptr_raw (void* ptr, enum Lisp_Type type) { #ifdef HAVE_PDUMPER @@ -137,15 +135,12 @@ struct pdumper_loaded_dump { uintptr_t end; }; -#ifdef HAVE_PDUMPER extern struct pdumper_loaded_dump dump_public; -#endif /* Return whether the OBJ points somewhere into the loaded dump image. Works even when we have no dump loaded --- in this case, it just returns false. */ -INLINE _GL_ATTRIBUTE_CONST -bool +INLINE _GL_ATTRIBUTE_CONST bool pdumper_object_p (const void *obj) { #ifdef HAVE_PDUMPER @@ -163,8 +158,7 @@ extern bool pdumper_cold_object_p_impl (const void *obj); Only bool-vectors and floats should end up there. pdumper_object_p() and pdumper_object_p_precise() must have returned true for OBJ before calling this function. */ -INLINE _GL_ATTRIBUTE_CONST -bool +INLINE _GL_ATTRIBUTE_CONST bool pdumper_cold_object_p (const void *obj) { #ifdef HAVE_PDUMPER @@ -181,8 +175,7 @@ extern enum Lisp_Type pdumper_find_object_type_impl (const void *obj); /* Return the type of the dumped object that starts at OBJ. It is a programming error to call this routine for an OBJ for which pdumper_object_p would return false. */ -INLINE _GL_ATTRIBUTE_CONST -enum Lisp_Type +INLINE _GL_ATTRIBUTE_CONST enum Lisp_Type pdumper_find_object_type (const void *obj) { #ifdef HAVE_PDUMPER @@ -197,8 +190,7 @@ pdumper_find_object_type (const void *obj) the loaded dump image. It is a programming error to call this routine for an OBJ for which pdumper_object_p would return false. */ -INLINE _GL_ATTRIBUTE_CONST -bool +INLINE _GL_ATTRIBUTE_CONST bool pdumper_object_p_precise (const void *obj) { #ifdef HAVE_PDUMPER @@ -214,8 +206,7 @@ extern bool pdumper_marked_p_impl (const void *obj); /* Return whether OBJ is marked according to the portable dumper. It is an error to call this routine for an OBJ for which pdumper_object_p_precise would return false. */ -INLINE -bool +INLINE bool pdumper_marked_p (const void *obj) { #ifdef HAVE_PDUMPER @@ -231,8 +222,7 @@ extern void pdumper_set_marked_impl (const void *obj); /* Set the pdumper mark bit for OBJ. It is a programming error to call this function with an OBJ for which pdumper_object_p_precise would return false. */ -INLINE -void +INLINE void pdumper_set_marked (const void *obj) { #ifdef HAVE_PDUMPER @@ -246,8 +236,7 @@ pdumper_set_marked (const void *obj) extern void pdumper_clear_marks_impl (void); /* Clear all the mark bits for pdumper objects. */ -INLINE -void +INLINE void pdumper_clear_marks (void) { #ifdef HAVE_PDUMPER @@ -255,11 +244,6 @@ pdumper_clear_marks (void) #endif } -/* Handle a page fault that occurs when we access the portable dumper - mapping. Return true iff the fault should be considered handled - and execution should resume. */ -bool pdumper_handle_page_fault (void *fault_addr_ptr); - /* Record the Emacs startup directory, relative to which the pdump file was loaded. */ extern void pdumper_record_wd (const char *); diff --git a/src/sysdep.c b/src/sysdep.c index f8594d6a915..6d85692ab11 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -1893,7 +1893,7 @@ handle_sigsegv (int sig, siginfo_t *siginfo, void *arg) /* Return true if we have successfully set up SIGSEGV handler on alternate stack. Otherwise we just treat SIGSEGV among the rest of fatal signals. */ -bool +static bool init_sigsegv (void) { struct sigaction sa; @@ -1916,7 +1916,7 @@ init_sigsegv (void) #else /* not HAVE_STACK_OVERFLOW_HANDLING or WINDOWSNT */ -bool +static bool init_sigsegv (void) { return 0; diff --git a/src/syssignal.h b/src/syssignal.h index ecd6c9cc8c2..82e376126ae 100644 --- a/src/syssignal.h +++ b/src/syssignal.h @@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ #include <signal.h> extern void init_signals (void); -extern bool init_sigsegv (void); extern void block_child_signal (sigset_t *); extern void unblock_child_signal (sigset_t const *); extern void block_interrupt_signal (sigset_t *); diff --git a/src/window.c b/src/window.c index c0d745995a8..1b474a663a4 100644 --- a/src/window.c +++ b/src/window.c @@ -81,7 +81,7 @@ Lisp_Object selected_window; /* The value of selected_window at the last time window change functions were run. This is always the same as FRAME_OLD_SELECTED_WINDOW (old_selected_frame). */ -Lisp_Object old_selected_window; +static Lisp_Object old_selected_window; /* A list of all windows for use by next_window and Fwindow_list. Functions creating or deleting windows should invalidate this cache diff --git a/src/window.h b/src/window.h index 514bf1fb6ec..d816bb1683d 100644 --- a/src/window.h +++ b/src/window.h @@ -1039,7 +1039,6 @@ wset_next_buffers (struct window *w, Lisp_Object val) This value is always the same as FRAME_SELECTED_WINDOW (selected_frame). */ extern Lisp_Object selected_window; -extern Lisp_Object old_selected_window; /* This is a time stamp for window selection, so we can find the least recently used window. Its only users are Fselect_window, |