aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2019-01-31 15:31:41 -0800
committerPaul Eggert2019-01-31 15:33:21 -0800
commit47679e63230da94cffed568a4d5167ffc1baea96 (patch)
tree45a1f8a1ed3fe07174d509205a4ba1d393435758 /src
parent05d2fc7170fb66a87601b1c76ddae2c1b7b4b934 (diff)
downloademacs-47679e63230da94cffed568a4d5167ffc1baea96.tar.gz
emacs-47679e63230da94cffed568a4d5167ffc1baea96.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/charset.c2
-rw-r--r--src/charset.h1
-rw-r--r--src/gtkutil.c4
-rw-r--r--src/lread.c3
-rw-r--r--src/pdumper.c2
-rw-r--r--src/pdumper.h34
-rw-r--r--src/sysdep.c4
-rw-r--r--src/syssignal.h1
-rw-r--r--src/window.c2
-rw-r--r--src/window.h1
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;
62 62
63/* Table of struct charset. */ 63/* Table of struct charset. */
64struct charset *charset_table; 64struct charset *charset_table;
65ptrdiff_t charset_table_size; 65static int charset_table_size;
66int charset_table_used; 66int charset_table_used;
67 67
68/* Special charsets corresponding to symbols. */ 68/* 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;
248 248
249/* Table of struct charset. */ 249/* Table of struct charset. */
250extern struct charset *charset_table; 250extern struct charset *charset_table;
251extern ptrdiff_t charset_table_size;
252extern int charset_table_used; 251extern int charset_table_used;
253 252
254#define CHARSET_FROM_ID(id) (charset_table + (id)) 253#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
147 GtkTextDirection dir; 147 GtkTextDirection dir;
148}; 148};
149 149
150#ifdef HAVE_XWIDGETS
150bool xg_gtk_initialized; /* Used to make sure xwidget calls are possible */ 151bool xg_gtk_initialized; /* Used to make sure xwidget calls are possible */
152#endif
151 153
152static GtkWidget * xg_get_widget_from_map (ptrdiff_t idx); 154static GtkWidget * xg_get_widget_from_map (ptrdiff_t idx);
153 155
@@ -5324,7 +5326,9 @@ xg_initialize (void)
5324 x_last_font_name = NULL; 5326 x_last_font_name = NULL;
5325#endif 5327#endif
5326 5328
5329#ifdef HAVE_XWIDGETS
5327 xg_gtk_initialized = true; 5330 xg_gtk_initialized = true;
5331#endif
5328} 5332}
5329 5333
5330#endif /* USE_GTK */ 5334#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)
4402} 4402}
4403 4403
4404 4404
4405int ndefsubr;
4406
4407void 4405void
4408defsubr (union Aligned_Lisp_Subr *aname) 4406defsubr (union Aligned_Lisp_Subr *aname)
4409{ 4407{
@@ -4413,7 +4411,6 @@ defsubr (union Aligned_Lisp_Subr *aname)
4413 XSETPVECTYPE (sname, PVEC_SUBR); 4411 XSETPVECTYPE (sname, PVEC_SUBR);
4414 XSETSUBR (tem, sname); 4412 XSETSUBR (tem, sname);
4415 set_symbol_function (sym, tem); 4413 set_symbol_function (sym, tem);
4416 ++ndefsubr;
4417} 4414}
4418 4415
4419#ifdef NOTDEF /* Use fset in subr.el now! */ 4416#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
5019}; 5019};
5020 5020
5021struct pdumper_loaded_dump dump_public; 5021struct pdumper_loaded_dump dump_public;
5022struct pdumper_loaded_dump_private dump_private; 5022static struct pdumper_loaded_dump_private dump_private;
5023 5023
5024/* Return a pointer to offset OFFSET within the dump, which begins at 5024/* Return a pointer to offset OFFSET within the dump, which begins at
5025 DUMP_BASE. DUMP_BASE must be equal to the current dump load 5025 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
52 52
53extern void pdumper_remember_scalar_impl (void *data, ptrdiff_t nbytes); 53extern void pdumper_remember_scalar_impl (void *data, ptrdiff_t nbytes);
54 54
55INLINE 55INLINE void
56void
57pdumper_remember_scalar (void *data, ptrdiff_t nbytes) 56pdumper_remember_scalar (void *data, ptrdiff_t nbytes)
58{ 57{
59#ifdef HAVE_PDUMPER 58#ifdef HAVE_PDUMPER
@@ -70,8 +69,7 @@ extern void pdumper_remember_lv_ptr_raw_impl (
70/* Remember the pointer at *PTR. *PTR must be null or point to a Lisp 69/* Remember the pointer at *PTR. *PTR must be null or point to a Lisp
71 object. TYPE is the rough type of Lisp object to which *PTR 70 object. TYPE is the rough type of Lisp object to which *PTR
72 points. */ 71 points. */
73INLINE 72INLINE void
74void
75pdumper_remember_lv_ptr_raw (void* ptr, enum Lisp_Type type) 73pdumper_remember_lv_ptr_raw (void* ptr, enum Lisp_Type type)
76{ 74{
77#ifdef HAVE_PDUMPER 75#ifdef HAVE_PDUMPER
@@ -137,15 +135,12 @@ struct pdumper_loaded_dump {
137 uintptr_t end; 135 uintptr_t end;
138}; 136};
139 137
140#ifdef HAVE_PDUMPER
141extern struct pdumper_loaded_dump dump_public; 138extern struct pdumper_loaded_dump dump_public;
142#endif
143 139
144/* Return whether the OBJ points somewhere into the loaded dump image. 140/* Return whether the OBJ points somewhere into the loaded dump image.
145 Works even when we have no dump loaded --- in this case, it just 141 Works even when we have no dump loaded --- in this case, it just
146 returns false. */ 142 returns false. */
147INLINE _GL_ATTRIBUTE_CONST 143INLINE _GL_ATTRIBUTE_CONST bool
148bool
149pdumper_object_p (const void *obj) 144pdumper_object_p (const void *obj)
150{ 145{
151#ifdef HAVE_PDUMPER 146#ifdef HAVE_PDUMPER
@@ -163,8 +158,7 @@ extern bool pdumper_cold_object_p_impl (const void *obj);
163 Only bool-vectors and floats should end up there. 158 Only bool-vectors and floats should end up there.
164 pdumper_object_p() and pdumper_object_p_precise() must have 159 pdumper_object_p() and pdumper_object_p_precise() must have
165 returned true for OBJ before calling this function. */ 160 returned true for OBJ before calling this function. */
166INLINE _GL_ATTRIBUTE_CONST 161INLINE _GL_ATTRIBUTE_CONST bool
167bool
168pdumper_cold_object_p (const void *obj) 162pdumper_cold_object_p (const void *obj)
169{ 163{
170#ifdef HAVE_PDUMPER 164#ifdef HAVE_PDUMPER
@@ -181,8 +175,7 @@ extern enum Lisp_Type pdumper_find_object_type_impl (const void *obj);
181/* Return the type of the dumped object that starts at OBJ. It is a 175/* Return the type of the dumped object that starts at OBJ. It is a
182 programming error to call this routine for an OBJ for which 176 programming error to call this routine for an OBJ for which
183 pdumper_object_p would return false. */ 177 pdumper_object_p would return false. */
184INLINE _GL_ATTRIBUTE_CONST 178INLINE _GL_ATTRIBUTE_CONST enum Lisp_Type
185enum Lisp_Type
186pdumper_find_object_type (const void *obj) 179pdumper_find_object_type (const void *obj)
187{ 180{
188#ifdef HAVE_PDUMPER 181#ifdef HAVE_PDUMPER
@@ -197,8 +190,7 @@ pdumper_find_object_type (const void *obj)
197 the loaded dump image. It is a programming error to call this 190 the loaded dump image. It is a programming error to call this
198 routine for an OBJ for which pdumper_object_p would return 191 routine for an OBJ for which pdumper_object_p would return
199 false. */ 192 false. */
200INLINE _GL_ATTRIBUTE_CONST 193INLINE _GL_ATTRIBUTE_CONST bool
201bool
202pdumper_object_p_precise (const void *obj) 194pdumper_object_p_precise (const void *obj)
203{ 195{
204#ifdef HAVE_PDUMPER 196#ifdef HAVE_PDUMPER
@@ -214,8 +206,7 @@ extern bool pdumper_marked_p_impl (const void *obj);
214/* Return whether OBJ is marked according to the portable dumper. 206/* Return whether OBJ is marked according to the portable dumper.
215 It is an error to call this routine for an OBJ for which 207 It is an error to call this routine for an OBJ for which
216 pdumper_object_p_precise would return false. */ 208 pdumper_object_p_precise would return false. */
217INLINE 209INLINE bool
218bool
219pdumper_marked_p (const void *obj) 210pdumper_marked_p (const void *obj)
220{ 211{
221#ifdef HAVE_PDUMPER 212#ifdef HAVE_PDUMPER
@@ -231,8 +222,7 @@ extern void pdumper_set_marked_impl (const void *obj);
231/* Set the pdumper mark bit for OBJ. It is a programming error to 222/* Set the pdumper mark bit for OBJ. It is a programming error to
232 call this function with an OBJ for which pdumper_object_p_precise 223 call this function with an OBJ for which pdumper_object_p_precise
233 would return false. */ 224 would return false. */
234INLINE 225INLINE void
235void
236pdumper_set_marked (const void *obj) 226pdumper_set_marked (const void *obj)
237{ 227{
238#ifdef HAVE_PDUMPER 228#ifdef HAVE_PDUMPER
@@ -246,8 +236,7 @@ pdumper_set_marked (const void *obj)
246extern void pdumper_clear_marks_impl (void); 236extern void pdumper_clear_marks_impl (void);
247 237
248/* Clear all the mark bits for pdumper objects. */ 238/* Clear all the mark bits for pdumper objects. */
249INLINE 239INLINE void
250void
251pdumper_clear_marks (void) 240pdumper_clear_marks (void)
252{ 241{
253#ifdef HAVE_PDUMPER 242#ifdef HAVE_PDUMPER
@@ -255,11 +244,6 @@ pdumper_clear_marks (void)
255#endif 244#endif
256} 245}
257 246
258/* Handle a page fault that occurs when we access the portable dumper
259 mapping. Return true iff the fault should be considered handled
260 and execution should resume. */
261bool pdumper_handle_page_fault (void *fault_addr_ptr);
262
263/* Record the Emacs startup directory, relative to which the pdump 247/* Record the Emacs startup directory, relative to which the pdump
264 file was loaded. */ 248 file was loaded. */
265extern void pdumper_record_wd (const char *); 249extern 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)
1893/* Return true if we have successfully set up SIGSEGV handler on alternate 1893/* Return true if we have successfully set up SIGSEGV handler on alternate
1894 stack. Otherwise we just treat SIGSEGV among the rest of fatal signals. */ 1894 stack. Otherwise we just treat SIGSEGV among the rest of fatal signals. */
1895 1895
1896bool 1896static bool
1897init_sigsegv (void) 1897init_sigsegv (void)
1898{ 1898{
1899 struct sigaction sa; 1899 struct sigaction sa;
@@ -1916,7 +1916,7 @@ init_sigsegv (void)
1916 1916
1917#else /* not HAVE_STACK_OVERFLOW_HANDLING or WINDOWSNT */ 1917#else /* not HAVE_STACK_OVERFLOW_HANDLING or WINDOWSNT */
1918 1918
1919bool 1919static bool
1920init_sigsegv (void) 1920init_sigsegv (void)
1921{ 1921{
1922 return 0; 1922 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/>. */
23#include <signal.h> 23#include <signal.h>
24 24
25extern void init_signals (void); 25extern void init_signals (void);
26extern bool init_sigsegv (void);
27extern void block_child_signal (sigset_t *); 26extern void block_child_signal (sigset_t *);
28extern void unblock_child_signal (sigset_t const *); 27extern void unblock_child_signal (sigset_t const *);
29extern void block_interrupt_signal (sigset_t *); 28extern 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;
81/* The value of selected_window at the last time window change 81/* The value of selected_window at the last time window change
82 functions were run. This is always the same as 82 functions were run. This is always the same as
83 FRAME_OLD_SELECTED_WINDOW (old_selected_frame). */ 83 FRAME_OLD_SELECTED_WINDOW (old_selected_frame). */
84Lisp_Object old_selected_window; 84static Lisp_Object old_selected_window;
85 85
86/* A list of all windows for use by next_window and Fwindow_list. 86/* A list of all windows for use by next_window and Fwindow_list.
87 Functions creating or deleting windows should invalidate this cache 87 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)
1039 This value is always the same as FRAME_SELECTED_WINDOW (selected_frame). */ 1039 This value is always the same as FRAME_SELECTED_WINDOW (selected_frame). */
1040 1040
1041extern Lisp_Object selected_window; 1041extern Lisp_Object selected_window;
1042extern Lisp_Object old_selected_window;
1043 1042
1044/* This is a time stamp for window selection, so we can find the least 1043/* This is a time stamp for window selection, so we can find the least
1045 recently used window. Its only users are Fselect_window, 1044 recently used window. Its only users are Fselect_window,