]> code.delx.au - gnu-emacs/commitdiff
Fix extern symbols defined and not used
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 30 Jan 2016 22:20:57 +0000 (14:20 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 30 Jan 2016 23:26:08 +0000 (15:26 -0800)
* src/alloc.c: Always include <signal.h>.
(malloc_warning) [!SIGDANGER && (SYSTEM_MALLOC || HYBRID_MALLOC)]:
Do not define; unused.
* src/emacs.c, src/lisp.h (might_dump) [!DOUG_LEA_MALLOC]: Now static.
* src/gmalloc.c (gdefault_morecore): Rename from __default_morecore,
to avoid collision with glibc.  Now static.  All uses changed.
* src/lastfile.c (my_edata): Define only if
((!defined SYSTEM_MALLOC && !defined HYBRID_MALLOC && !defined
WINDOWSNT) \ || defined CYGWIN || defined DARWIN_OS).
(Bug#22086)

src/alloc.c
src/emacs.c
src/gmalloc.c
src/lastfile.c
src/lisp.h

index b1d3f2e651165f59238dd2fd639620d21b73d656..57ef4c5deab20d7d0745fafa87a6f9ac5fc246df 100644 (file)
@@ -22,10 +22,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include <stdio.h>
 #include <limits.h>            /* For CHAR_BIT.  */
-
-#ifdef ENABLE_CHECKING
-#include <signal.h>            /* For SIGABRT.  */
-#endif
+#include <signal.h>            /* For SIGABRT, SIGDANGER.  */
 
 #ifdef HAVE_PTHREAD
 #include <pthread.h>
@@ -565,6 +562,8 @@ static struct Lisp_Finalizer doomed_finalizers;
                                Malloc
  ************************************************************************/
 
+#if defined SIGDANGER || (!defined SYSTEM_MALLOC && !defined HYBRID_MALLOC)
+
 /* Function malloc calls this if it finds we are near exhausting storage.  */
 
 void
@@ -573,6 +572,7 @@ malloc_warning (const char *str)
   pending_malloc_warning = str;
 }
 
+#endif
 
 /* Display an already-pending malloc warning.  */
 
index de770a6d7f54efbb55db58c412e92e0be2aa9317..540bf736feca39e627c680a666d56bb0e50b75d6 100644 (file)
@@ -128,6 +128,9 @@ Lisp_Object Vlibrary_cache;
 bool initialized;
 
 /* Set to true if this instance of Emacs might dump.  */
+#ifndef DOUG_LEA_MALLOC
+static
+#endif
 bool might_dump;
 
 #ifdef DARWIN_OS
index ca862767bb2abed84fda598e2bb08c6db8f4dba6..282216a947bdea1da9f63f253d93788c14c92269 100644 (file)
@@ -56,7 +56,6 @@ License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 extern void (*__MALLOC_HOOK_VOLATILE __after_morecore_hook) (void);
 extern void (*__MALLOC_HOOK_VOLATILE __malloc_initialize_hook) (void);
 extern void *(*__morecore) (ptrdiff_t);
-extern void *__default_morecore (ptrdiff_t);
 #endif
 
 /* If HYBRID_MALLOC is defined, then temacs will use malloc,
@@ -1512,8 +1511,8 @@ extern void *__sbrk (ptrdiff_t increment);
 /* Allocate INCREMENT more bytes of data space,
    and return the start of data space, or NULL on errors.
    If INCREMENT is negative, shrink data space.  */
-void *
-__default_morecore (ptrdiff_t increment)
+static void *
+gdefault_morecore (ptrdiff_t increment)
 {
   void *result;
 #ifdef HYBRID_MALLOC
@@ -1528,7 +1527,7 @@ __default_morecore (ptrdiff_t increment)
   return result;
 }
 
-void *(*__morecore) (ptrdiff_t) = __default_morecore;
+void *(*__morecore) (ptrdiff_t) = gdefault_morecore;
 
 /* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
 
index 2d0bcc76b8f37031c963615a1f9a8f902e57af10..9c73fb44700eeee7c0cf5d42a01d70c3694801a7 100644 (file)
@@ -38,7 +38,10 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "lisp.h"
 
+#if ((!defined SYSTEM_MALLOC && !defined HYBRID_MALLOC && !defined WINDOWSNT) \
+     || defined CYGWIN || defined DARWIN_OS)
 char my_edata[] = "End of Emacs initialized data";
+#endif
 
 /* Help unexec locate the end of the .bss area used by Emacs (which
    isn't always a separate section in NT executables).  */
index cafcfdef438248573ac4f38fdb6c1c4c0350e8c2..ef86c4fc9583bbe7dfbe3b86e1caaeb65487742c 100644 (file)
@@ -619,7 +619,9 @@ extern _Noreturn Lisp_Object wrong_type_argument (Lisp_Object, Lisp_Object);
 extern _Noreturn void wrong_choice (Lisp_Object, Lisp_Object);
 
 /* Defined in emacs.c.  */
+#ifdef DOUG_LEA_MALLOC
 extern bool might_dump;
+#endif
 /* True means Emacs has already been initialized.
    Used during startup to detect startup of dumped Emacs.  */
 extern bool initialized;