diff options
| author | Paul Eggert | 2014-08-31 19:37:22 -0700 |
|---|---|---|
| committer | Paul Eggert | 2014-08-31 19:37:22 -0700 |
| commit | 1564080f0b24551765d7068b9fc02f6e5a78fea3 (patch) | |
| tree | c710c96b8aef1bdb16ae9287b5fd775695a8547c /src | |
| parent | 56f9f0ab54fd752773d8bb371a4032e43c9c224c (diff) | |
| download | emacs-1564080f0b24551765d7068b9fc02f6e5a78fea3.tar.gz emacs-1564080f0b24551765d7068b9fc02f6e5a78fea3.zip | |
Clean up extern decls a bit.
* configure.ac (WERROR_CFLAGS): Don't disable -Wnested-externs.
While we're at it, don't disable -Wlogical-op either.
* src/bytecode.c: Include blockinput.h and keyboard.h rather
than rolling their APIs by hand.
* src/emacs.c: Include regex.h and rely on its and lisp.h's API
rather than rolling them by hand.
* src/lastfile.c: Include lisp.h, to check this file's API.
* src/lisp.h (lisp_eval_depth, my_edata, my_endbss, my_endbss_static):
New decls.
* src/regex.h (re_max_failures): New decl.
* src/unexcw.c, src/unexmacosx.c, src/unexw32.c:
Rely on lisp.h's API rather than rolling it by hand.
* src/vm-limit.c (__after_morecore_hook, __morecore, real_morecore):
Declare at top level, to pacify GCC -Wnested-externs.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 16 | ||||
| -rw-r--r-- | src/bytecode.c | 5 | ||||
| -rw-r--r-- | src/emacs.c | 10 | ||||
| -rw-r--r-- | src/lastfile.c | 2 | ||||
| -rw-r--r-- | src/lisp.h | 6 | ||||
| -rw-r--r-- | src/regex.h | 3 | ||||
| -rw-r--r-- | src/unexcw.c | 4 | ||||
| -rw-r--r-- | src/unexmacosx.c | 2 | ||||
| -rw-r--r-- | src/unexw32.c | 3 | ||||
| -rw-r--r-- | src/vm-limit.c | 16 |
10 files changed, 41 insertions, 26 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 26ee524acda..0bf0842690b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2014-09-01 Paul Eggert <eggert@cs.ucla.edu> | ||
| 2 | |||
| 3 | Clean up extern decls a bit. | ||
| 4 | * bytecode.c: Include blockinput.h and keyboard.h rather | ||
| 5 | than rolling their APIs by hand. | ||
| 6 | * emacs.c: Include regex.h and rely on its and lisp.h's API | ||
| 7 | rather than rolling them by hand. | ||
| 8 | * lastfile.c: Include lisp.h, to check this file's API. | ||
| 9 | * lisp.h (lisp_eval_depth, my_edata, my_endbss, my_endbss_static): | ||
| 10 | New decls. | ||
| 11 | * regex.h (re_max_failures): New decl. | ||
| 12 | * unexcw.c, unexmacosx.c, unexw32.c: | ||
| 13 | Rely on lisp.h's API rather than rolling it by hand. | ||
| 14 | * vm-limit.c (__after_morecore_hook, __morecore, real_morecore): | ||
| 15 | Declare at top level, to pacify GCC -Wnested-externs. | ||
| 16 | |||
| 1 | 2014-08-31 Eli Zaretskii <eliz@gnu.org> | 17 | 2014-08-31 Eli Zaretskii <eliz@gnu.org> |
| 2 | 18 | ||
| 3 | * xdisp.c (get_glyph_string_clip_rects): Don't let the width of a | 19 | * xdisp.c (get_glyph_string_clip_rects): Don't let the width of a |
diff --git a/src/bytecode.c b/src/bytecode.c index ca6681f21e9..d3c8b470cc3 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -36,8 +36,10 @@ by Hallvard: | |||
| 36 | #include <config.h> | 36 | #include <config.h> |
| 37 | 37 | ||
| 38 | #include "lisp.h" | 38 | #include "lisp.h" |
| 39 | #include "blockinput.h" | ||
| 39 | #include "character.h" | 40 | #include "character.h" |
| 40 | #include "buffer.h" | 41 | #include "buffer.h" |
| 42 | #include "keyboard.h" | ||
| 41 | #include "syntax.h" | 43 | #include "syntax.h" |
| 42 | #include "window.h" | 44 | #include "window.h" |
| 43 | 45 | ||
| @@ -1106,9 +1108,6 @@ exec_byte_code (Lisp_Object bytestr, Lisp_Object vector, Lisp_Object maxdepth, | |||
| 1106 | goto pushhandler; | 1108 | goto pushhandler; |
| 1107 | CASE (Bpushconditioncase): /* New in 24.4. */ | 1109 | CASE (Bpushconditioncase): /* New in 24.4. */ |
| 1108 | { | 1110 | { |
| 1109 | extern EMACS_INT lisp_eval_depth; | ||
| 1110 | extern int poll_suppress_count; | ||
| 1111 | extern int interrupt_input_blocked; | ||
| 1112 | struct handler *c; | 1111 | struct handler *c; |
| 1113 | Lisp_Object tag; | 1112 | Lisp_Object tag; |
| 1114 | int dest; | 1113 | int dest; |
diff --git a/src/emacs.c b/src/emacs.c index 0b52659172c..9b05d68b914 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -83,6 +83,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 83 | #include "charset.h" | 83 | #include "charset.h" |
| 84 | #include "composite.h" | 84 | #include "composite.h" |
| 85 | #include "dispextern.h" | 85 | #include "dispextern.h" |
| 86 | #include "regex.h" | ||
| 86 | #include "syntax.h" | 87 | #include "syntax.h" |
| 87 | #include "sysselect.h" | 88 | #include "sysselect.h" |
| 88 | #include "systime.h" | 89 | #include "systime.h" |
| @@ -741,9 +742,6 @@ main (int argc, char **argv) | |||
| 741 | #ifdef GNU_LINUX | 742 | #ifdef GNU_LINUX |
| 742 | if (!initialized) | 743 | if (!initialized) |
| 743 | { | 744 | { |
| 744 | extern char my_endbss[]; | ||
| 745 | extern char *my_endbss_static; | ||
| 746 | |||
| 747 | if (my_heap_start == 0) | 745 | if (my_heap_start == 0) |
| 748 | my_heap_start = sbrk (0); | 746 | my_heap_start = sbrk (0); |
| 749 | 747 | ||
| @@ -872,7 +870,6 @@ main (int argc, char **argv) | |||
| 872 | && !getrlimit (RLIMIT_STACK, &rlim)) | 870 | && !getrlimit (RLIMIT_STACK, &rlim)) |
| 873 | { | 871 | { |
| 874 | long newlim; | 872 | long newlim; |
| 875 | extern size_t re_max_failures; | ||
| 876 | /* Approximate the amount regex.c needs per unit of re_max_failures. */ | 873 | /* Approximate the amount regex.c needs per unit of re_max_failures. */ |
| 877 | int ratio = 20 * sizeof (char *); | 874 | int ratio = 20 * sizeof (char *); |
| 878 | /* Then add 33% to cover the size of the smaller stacks that regex.c | 875 | /* Then add 33% to cover the size of the smaller stacks that regex.c |
| @@ -2136,10 +2133,7 @@ You must run Emacs in batch mode in order to dump it. */) | |||
| 2136 | #ifndef WINDOWSNT | 2133 | #ifndef WINDOWSNT |
| 2137 | /* On Windows, this was done before dumping, and that once suffices. | 2134 | /* On Windows, this was done before dumping, and that once suffices. |
| 2138 | Meanwhile, my_edata is not valid on Windows. */ | 2135 | Meanwhile, my_edata is not valid on Windows. */ |
| 2139 | { | 2136 | memory_warnings (my_edata, malloc_warning); |
| 2140 | extern char my_edata[]; | ||
| 2141 | memory_warnings (my_edata, malloc_warning); | ||
| 2142 | } | ||
| 2143 | #endif /* not WINDOWSNT */ | 2137 | #endif /* not WINDOWSNT */ |
| 2144 | #endif /* not SYSTEM_MALLOC and not HYBRID_MALLOC */ | 2138 | #endif /* not SYSTEM_MALLOC and not HYBRID_MALLOC */ |
| 2145 | #ifdef DOUG_LEA_MALLOC | 2139 | #ifdef DOUG_LEA_MALLOC |
diff --git a/src/lastfile.c b/src/lastfile.c index a900e9541c8..e7136e069d0 100644 --- a/src/lastfile.c +++ b/src/lastfile.c | |||
| @@ -36,6 +36,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 36 | 36 | ||
| 37 | #include <config.h> | 37 | #include <config.h> |
| 38 | 38 | ||
| 39 | #include <lisp.h> | ||
| 40 | |||
| 39 | char my_edata[] = "End of Emacs initialized data"; | 41 | char my_edata[] = "End of Emacs initialized data"; |
| 40 | 42 | ||
| 41 | /* Help unexec locate the end of the .bss area used by Emacs (which | 43 | /* Help unexec locate the end of the .bss area used by Emacs (which |
diff --git a/src/lisp.h b/src/lisp.h index d31c5ae50c3..53d6cf8009e 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3885,6 +3885,7 @@ intern_c_string (const char *str) | |||
| 3885 | } | 3885 | } |
| 3886 | 3886 | ||
| 3887 | /* Defined in eval.c. */ | 3887 | /* Defined in eval.c. */ |
| 3888 | extern EMACS_INT lisp_eval_depth; | ||
| 3888 | extern Lisp_Object Qexit, Qinteractive, Qcommandp, Qmacro; | 3889 | extern Lisp_Object Qexit, Qinteractive, Qcommandp, Qmacro; |
| 3889 | extern Lisp_Object Qinhibit_quit, Qinternal_interpreter_environment, Qclosure; | 3890 | extern Lisp_Object Qinhibit_quit, Qinternal_interpreter_environment, Qclosure; |
| 3890 | extern Lisp_Object Qand_rest; | 3891 | extern Lisp_Object Qand_rest; |
| @@ -4419,6 +4420,11 @@ extern void syms_of_profiler (void); | |||
| 4419 | extern char *emacs_root_dir (void); | 4420 | extern char *emacs_root_dir (void); |
| 4420 | #endif /* DOS_NT */ | 4421 | #endif /* DOS_NT */ |
| 4421 | 4422 | ||
| 4423 | /* Defined in lastfile.c. */ | ||
| 4424 | extern char my_edata[]; | ||
| 4425 | extern char my_endbss[]; | ||
| 4426 | extern char *my_endbss_static; | ||
| 4427 | |||
| 4422 | /* True means ^G can quit instantly. */ | 4428 | /* True means ^G can quit instantly. */ |
| 4423 | extern bool immediate_quit; | 4429 | extern bool immediate_quit; |
| 4424 | 4430 | ||
diff --git a/src/regex.h b/src/regex.h index 1b064987eb7..0e25723a85e 100644 --- a/src/regex.h +++ b/src/regex.h | |||
| @@ -172,6 +172,9 @@ extern reg_syntax_t re_syntax_options; | |||
| 172 | extern Lisp_Object re_match_object; | 172 | extern Lisp_Object re_match_object; |
| 173 | #endif | 173 | #endif |
| 174 | 174 | ||
| 175 | /* Roughly the maximum number of failure points on the stack. */ | ||
| 176 | extern size_t re_max_failures; | ||
| 177 | |||
| 175 | 178 | ||
| 176 | /* Define combinations of the above bits for the standard possibilities. | 179 | /* Define combinations of the above bits for the standard possibilities. |
| 177 | (The [[[ comments delimit what gets put into the Texinfo file, so | 180 | (The [[[ comments delimit what gets put into the Texinfo file, so |
diff --git a/src/unexcw.c b/src/unexcw.c index 72456b33ec4..cdeb899fd30 100644 --- a/src/unexcw.c +++ b/src/unexcw.c | |||
| @@ -34,10 +34,6 @@ extern void report_sheap_usage (int); | |||
| 34 | 34 | ||
| 35 | extern int bss_sbrk_did_unexec; | 35 | extern int bss_sbrk_did_unexec; |
| 36 | 36 | ||
| 37 | /* emacs symbols that indicate where bss and data end for emacs internals */ | ||
| 38 | extern char my_endbss[]; | ||
| 39 | extern char my_edata[]; | ||
| 40 | |||
| 41 | /* | 37 | /* |
| 42 | ** header for Windows executable files | 38 | ** header for Windows executable files |
| 43 | */ | 39 | */ |
diff --git a/src/unexmacosx.c b/src/unexmacosx.c index 8cd80a7a544..ae34237a66b 100644 --- a/src/unexmacosx.c +++ b/src/unexmacosx.c | |||
| @@ -826,7 +826,6 @@ copy_data_segment (struct load_command *lc) | |||
| 826 | file. */ | 826 | file. */ |
| 827 | if (strncmp (sectp->sectname, SECT_DATA, 16) == 0) | 827 | if (strncmp (sectp->sectname, SECT_DATA, 16) == 0) |
| 828 | { | 828 | { |
| 829 | extern char my_edata[]; | ||
| 830 | unsigned long my_size; | 829 | unsigned long my_size; |
| 831 | 830 | ||
| 832 | /* The __data section is basically dumped from memory. But | 831 | /* The __data section is basically dumped from memory. But |
| @@ -857,7 +856,6 @@ copy_data_segment (struct load_command *lc) | |||
| 857 | } | 856 | } |
| 858 | else if (strncmp (sectp->sectname, SECT_BSS, 16) == 0) | 857 | else if (strncmp (sectp->sectname, SECT_BSS, 16) == 0) |
| 859 | { | 858 | { |
| 860 | extern char *my_endbss_static; | ||
| 861 | unsigned long my_size; | 859 | unsigned long my_size; |
| 862 | 860 | ||
| 863 | sectp->flags = S_REGULAR; | 861 | sectp->flags = S_REGULAR; |
diff --git a/src/unexw32.c b/src/unexw32.c index 7cbd95a46fe..95c805d09ae 100644 --- a/src/unexw32.c +++ b/src/unexw32.c | |||
| @@ -43,11 +43,8 @@ PIMAGE_NT_HEADERS | |||
| 43 | extern BOOL ctrl_c_handler (unsigned long type); | 43 | extern BOOL ctrl_c_handler (unsigned long type); |
| 44 | 44 | ||
| 45 | extern char my_begdata[]; | 45 | extern char my_begdata[]; |
| 46 | extern char my_edata[]; | ||
| 47 | extern char my_begbss[]; | 46 | extern char my_begbss[]; |
| 48 | extern char my_endbss[]; | ||
| 49 | extern char *my_begbss_static; | 47 | extern char *my_begbss_static; |
| 50 | extern char *my_endbss_static; | ||
| 51 | 48 | ||
| 52 | #include "w32heap.h" | 49 | #include "w32heap.h" |
| 53 | 50 | ||
diff --git a/src/vm-limit.c b/src/vm-limit.c index 308613f7eb4..015f3ee2111 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c | |||
| @@ -51,6 +51,15 @@ char data_start[1] = { 1 }; | |||
| 51 | # endif | 51 | # endif |
| 52 | #endif | 52 | #endif |
| 53 | 53 | ||
| 54 | /* From gmalloc.c. */ | ||
| 55 | extern void (* __after_morecore_hook) (void); | ||
| 56 | extern void *(*__morecore) (ptrdiff_t); | ||
| 57 | |||
| 58 | /* From ralloc.c. */ | ||
| 59 | #ifdef REL_ALLOC | ||
| 60 | extern void *(*real_morecore) (ptrdiff_t); | ||
| 61 | #endif | ||
| 62 | |||
| 54 | /* | 63 | /* |
| 55 | Level number of warnings already issued. | 64 | Level number of warnings already issued. |
| 56 | 0 -- no warnings issued. | 65 | 0 -- no warnings issued. |
| @@ -130,12 +139,9 @@ ret_lim_data (void) | |||
| 130 | static void | 139 | static void |
| 131 | check_memory_limits (void) | 140 | check_memory_limits (void) |
| 132 | { | 141 | { |
| 133 | #ifdef REL_ALLOC | 142 | #ifndef REL_ALLOC |
| 134 | extern void *(*real_morecore) (ptrdiff_t); | ||
| 135 | #else | ||
| 136 | void *(*real_morecore) (ptrdiff_t) = 0; | 143 | void *(*real_morecore) (ptrdiff_t) = 0; |
| 137 | #endif | 144 | #endif |
| 138 | extern void *(*__morecore) (ptrdiff_t); | ||
| 139 | 145 | ||
| 140 | char *cp; | 146 | char *cp; |
| 141 | size_t five_percent; | 147 | size_t five_percent; |
| @@ -203,8 +209,6 @@ check_memory_limits (void) | |||
| 203 | void | 209 | void |
| 204 | memory_warnings (void *start, void (*warnfun) (const char *)) | 210 | memory_warnings (void *start, void (*warnfun) (const char *)) |
| 205 | { | 211 | { |
| 206 | extern void (* __after_morecore_hook) (void); /* From gmalloc.c */ | ||
| 207 | |||
| 208 | data_space_start = start ? start : data_start; | 212 | data_space_start = start ? start : data_start; |
| 209 | 213 | ||
| 210 | warn_function = warnfun; | 214 | warn_function = warnfun; |