[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] trunk r117792: Clean up extern decls a bit.
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] trunk r117792: Clean up extern decls a bit. |
Date: |
Mon, 01 Sep 2014 02:37:28 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117792
revision-id: address@hidden
parent: address@hidden
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sun 2014-08-31 19:37:22 -0700
message:
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.
modified:
ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1538
configure.ac
configure.in-20091113204419-o5vbwnq5f7feedwu-783
src/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1438
src/bytecode.c bytecode.c-20091113204419-o5vbwnq5f7feedwu-257
src/emacs.c emacs.c-20091113204419-o5vbwnq5f7feedwu-241
src/lastfile.c lastfile.c-20091113204419-o5vbwnq5f7feedwu-414
src/lisp.h lisp.h-20091113204419-o5vbwnq5f7feedwu-253
src/regex.h regex.h-20091113204419-o5vbwnq5f7feedwu-517
src/unexcw.c unexcw.c-20091113204419-o5vbwnq5f7feedwu-3010
src/unexmacosx.c
unexmacosx.c-20091113204419-o5vbwnq5f7feedwu-2413
src/unexw32.c unexw32.c-20091113204419-o5vbwnq5f7feedwu-887
src/vm-limit.c vmlimit.c-20091113204419-o5vbwnq5f7feedwu-488
=== modified file 'ChangeLog'
--- a/ChangeLog 2014-08-31 02:50:10 +0000
+++ b/ChangeLog 2014-09-01 02:37:22 +0000
@@ -1,3 +1,9 @@
+2014-09-01 Paul Eggert <address@hidden>
+
+ 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.
+
2014-08-31 Paul Eggert <address@hidden>
* configure.ac (MAKE): Export it, for config.status.
=== modified file 'configure.ac'
--- a/configure.ac 2014-08-31 02:50:10 +0000
+++ b/configure.ac 2014-09-01 02:37:22 +0000
@@ -844,10 +844,8 @@
nw="$nw -Wsystem-headers" # Don't let system headers trigger warnings
nw="$nw -Woverlength-strings" # Not a problem these days
- nw="$nw -Wlogical-op" # any use of fwrite provokes this
nw="$nw -Wformat-nonliteral" # we do this a lot
- nw="$nw -Wvla" # warnings in gettext.h
- nw="$nw -Wnested-externs" # use of XARGMATCH/verify_function__
+ nw="$nw -Wvla" # Emacs uses <vla.h>.
nw="$nw -Wswitch-default" # Too many warnings for now
nw="$nw -Winline" # OK to ignore 'inline'
nw="$nw -Wjump-misses-init" # We sometimes safely jump over init.
@@ -864,7 +862,8 @@
# Emacs's use of alloca inhibits protecting the stack.
nw="$nw -Wstack-protector"
- # The following line should be removable at some point.
+ # Emacs's use of partly-pure functions such as CHECK_TYPE make this
+ # option problematic.
nw="$nw -Wsuggest-attribute=pure"
# This part is merely for shortening the command line,
@@ -891,10 +890,6 @@
gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
gl_WARN_ADD([-Wno-format-nonliteral])
- # In spite of excluding -Wlogical-op above, it is enabled, as of
- # gcc 4.5.0 20090517.
- gl_WARN_ADD([-Wno-logical-op])
-
# More things that clang is unduly picky about.
if test $emacs_cv_clang = yes; then
gl_WARN_ADD([-Wno-format-extra-args])
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog 2014-08-31 15:46:47 +0000
+++ b/src/ChangeLog 2014-09-01 02:37:22 +0000
@@ -1,3 +1,19 @@
+2014-09-01 Paul Eggert <address@hidden>
+
+ Clean up extern decls a bit.
+ * bytecode.c: Include blockinput.h and keyboard.h rather
+ than rolling their APIs by hand.
+ * emacs.c: Include regex.h and rely on its and lisp.h's API
+ rather than rolling them by hand.
+ * lastfile.c: Include lisp.h, to check this file's API.
+ * lisp.h (lisp_eval_depth, my_edata, my_endbss, my_endbss_static):
+ New decls.
+ * regex.h (re_max_failures): New decl.
+ * unexcw.c, unexmacosx.c, unexw32.c:
+ Rely on lisp.h's API rather than rolling it by hand.
+ * vm-limit.c (__after_morecore_hook, __morecore, real_morecore):
+ Declare at top level, to pacify GCC -Wnested-externs.
+
2014-08-31 Eli Zaretskii <address@hidden>
* xdisp.c (get_glyph_string_clip_rects): Don't let the width of a
=== modified file 'src/bytecode.c'
--- a/src/bytecode.c 2014-05-27 23:48:35 +0000
+++ b/src/bytecode.c 2014-09-01 02:37:22 +0000
@@ -36,8 +36,10 @@
#include <config.h>
#include "lisp.h"
+#include "blockinput.h"
#include "character.h"
#include "buffer.h"
+#include "keyboard.h"
#include "syntax.h"
#include "window.h"
@@ -1106,9 +1108,6 @@
goto pushhandler;
CASE (Bpushconditioncase): /* New in 24.4. */
{
- extern EMACS_INT lisp_eval_depth;
- extern int poll_suppress_count;
- extern int interrupt_input_blocked;
struct handler *c;
Lisp_Object tag;
int dest;
=== modified file 'src/emacs.c'
--- a/src/emacs.c 2014-08-28 14:48:02 +0000
+++ b/src/emacs.c 2014-09-01 02:37:22 +0000
@@ -83,6 +83,7 @@
#include "charset.h"
#include "composite.h"
#include "dispextern.h"
+#include "regex.h"
#include "syntax.h"
#include "sysselect.h"
#include "systime.h"
@@ -741,9 +742,6 @@
#ifdef GNU_LINUX
if (!initialized)
{
- extern char my_endbss[];
- extern char *my_endbss_static;
-
if (my_heap_start == 0)
my_heap_start = sbrk (0);
@@ -872,7 +870,6 @@
&& !getrlimit (RLIMIT_STACK, &rlim))
{
long newlim;
- extern size_t re_max_failures;
/* Approximate the amount regex.c needs per unit of re_max_failures. */
int ratio = 20 * sizeof (char *);
/* Then add 33% to cover the size of the smaller stacks that regex.c
@@ -2136,10 +2133,7 @@
#ifndef WINDOWSNT
/* On Windows, this was done before dumping, and that once suffices.
Meanwhile, my_edata is not valid on Windows. */
- {
- extern char my_edata[];
- memory_warnings (my_edata, malloc_warning);
- }
+ memory_warnings (my_edata, malloc_warning);
#endif /* not WINDOWSNT */
#endif /* not SYSTEM_MALLOC and not HYBRID_MALLOC */
#ifdef DOUG_LEA_MALLOC
=== modified file 'src/lastfile.c'
--- a/src/lastfile.c 2014-01-01 07:43:34 +0000
+++ b/src/lastfile.c 2014-09-01 02:37:22 +0000
@@ -36,6 +36,8 @@
#include <config.h>
+#include <lisp.h>
+
char my_edata[] = "End of Emacs initialized data";
/* Help unexec locate the end of the .bss area used by Emacs (which
=== modified file 'src/lisp.h'
--- a/src/lisp.h 2014-08-29 17:57:36 +0000
+++ b/src/lisp.h 2014-09-01 02:37:22 +0000
@@ -3885,6 +3885,7 @@
}
/* Defined in eval.c. */
+extern EMACS_INT lisp_eval_depth;
extern Lisp_Object Qexit, Qinteractive, Qcommandp, Qmacro;
extern Lisp_Object Qinhibit_quit, Qinternal_interpreter_environment, Qclosure;
extern Lisp_Object Qand_rest;
@@ -4419,6 +4420,11 @@
extern char *emacs_root_dir (void);
#endif /* DOS_NT */
+/* Defined in lastfile.c. */
+extern char my_edata[];
+extern char my_endbss[];
+extern char *my_endbss_static;
+
/* True means ^G can quit instantly. */
extern bool immediate_quit;
=== modified file 'src/regex.h'
--- a/src/regex.h 2014-01-01 07:43:34 +0000
+++ b/src/regex.h 2014-09-01 02:37:22 +0000
@@ -172,6 +172,9 @@
extern Lisp_Object re_match_object;
#endif
+/* Roughly the maximum number of failure points on the stack. */
+extern size_t re_max_failures;
+
/* Define combinations of the above bits for the standard possibilities.
(The [[[ comments delimit what gets put into the Texinfo file, so
=== modified file 'src/unexcw.c'
--- a/src/unexcw.c 2014-08-28 14:48:02 +0000
+++ b/src/unexcw.c 2014-09-01 02:37:22 +0000
@@ -34,10 +34,6 @@
extern int bss_sbrk_did_unexec;
-/* emacs symbols that indicate where bss and data end for emacs internals */
-extern char my_endbss[];
-extern char my_edata[];
-
/*
** header for Windows executable files
*/
=== modified file 'src/unexmacosx.c'
--- a/src/unexmacosx.c 2014-01-01 07:43:34 +0000
+++ b/src/unexmacosx.c 2014-09-01 02:37:22 +0000
@@ -826,7 +826,6 @@
file. */
if (strncmp (sectp->sectname, SECT_DATA, 16) == 0)
{
- extern char my_edata[];
unsigned long my_size;
/* The __data section is basically dumped from memory. But
@@ -857,7 +856,6 @@
}
else if (strncmp (sectp->sectname, SECT_BSS, 16) == 0)
{
- extern char *my_endbss_static;
unsigned long my_size;
sectp->flags = S_REGULAR;
=== modified file 'src/unexw32.c'
--- a/src/unexw32.c 2014-05-29 15:21:08 +0000
+++ b/src/unexw32.c 2014-09-01 02:37:22 +0000
@@ -43,11 +43,8 @@
extern BOOL ctrl_c_handler (unsigned long type);
extern char my_begdata[];
-extern char my_edata[];
extern char my_begbss[];
-extern char my_endbss[];
extern char *my_begbss_static;
-extern char *my_endbss_static;
#include "w32heap.h"
=== modified file 'src/vm-limit.c'
--- a/src/vm-limit.c 2014-07-11 10:09:51 +0000
+++ b/src/vm-limit.c 2014-09-01 02:37:22 +0000
@@ -51,6 +51,15 @@
# endif
#endif
+/* From gmalloc.c. */
+extern void (* __after_morecore_hook) (void);
+extern void *(*__morecore) (ptrdiff_t);
+
+/* From ralloc.c. */
+#ifdef REL_ALLOC
+extern void *(*real_morecore) (ptrdiff_t);
+#endif
+
/*
Level number of warnings already issued.
0 -- no warnings issued.
@@ -130,12 +139,9 @@
static void
check_memory_limits (void)
{
-#ifdef REL_ALLOC
- extern void *(*real_morecore) (ptrdiff_t);
-#else
+#ifndef REL_ALLOC
void *(*real_morecore) (ptrdiff_t) = 0;
#endif
- extern void *(*__morecore) (ptrdiff_t);
char *cp;
size_t five_percent;
@@ -203,8 +209,6 @@
void
memory_warnings (void *start, void (*warnfun) (const char *))
{
- extern void (* __after_morecore_hook) (void); /* From gmalloc.c */
-
data_space_start = start ? start : data_start;
warn_function = warnfun;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] trunk r117792: Clean up extern decls a bit.,
Paul Eggert <=