]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Eliminate global #include of "mmalloc.h".
authorAndrew Cagney <cagney@redhat.com>
Thu, 6 Dec 2001 20:59:11 +0000 (20:59 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 6 Dec 2001 20:59:11 +0000 (20:59 +0000)
gdb/ChangeLog
gdb/defs.h
gdb/objfiles.c
gdb/utils.c

index 4ba02574e72bf6a761903eca90556fd412d1ad9c..e61cebab5480b76d289aba90ae1f2bcf626bc6f6 100644 (file)
@@ -1,3 +1,12 @@
+2001-12-06  Andrew Cagney  <ac131313@redhat.com>
+
+       * defs.h: Do not include "mmalloc.h".
+       (mcalloc, mmalloc, mrealloc, mfree): Delete declaration.
+       * objfiles.c: Include "mmalloc.h".
+       * utils.c: Include "mmalloc.h".
+       (mmalloc, mfree, mrealloc, mmalloc): Make static, change PTR to
+       void pointer.
+       
 2001-12-06  Andrew Cagney  <ac131313@redhat.com>
 
        * regcache.c (store_register, fetch_register): Only use
index d75ecd35b221feec778d3576412360640843193c..b1512a2e39ce3213de60655e1b18470518fe8d76 100644 (file)
 
 #include "progress.h"
 
-#ifdef USE_MMALLOC
-#include "mmalloc.h"
-#endif
-
 /* For BFD64 and bfd_vma.  */
 #include "bfd.h"
 
@@ -1029,16 +1025,6 @@ extern char *msavestring (void *, const char *, size_t);
 
 extern char *mstrsave (void *, const char *);
 
-#if !defined (USE_MMALLOC)
-/* NOTE: cagney/2000-03-04: The mmalloc functions need to use PTR
-   rather than void* so that they are consistent with the delcaration
-   in ../mmalloc/mmalloc.h. */
-extern PTR mcalloc (PTR, size_t, size_t);
-extern PTR mmalloc (PTR, size_t);
-extern PTR mrealloc (PTR, PTR, size_t);
-extern void mfree (PTR, PTR);
-#endif
-
 /* Robust versions of same.  Throw an internal error when no memory,
    guard against stray NULL arguments. */
 extern void *xmmalloc (void *md, size_t size);
index e0a69ca75b1cb1b7e926545810939bbc6fe3401d..e2a6f8505546c311271ceabbd5faa01c94c5321c 100644 (file)
@@ -43,6 +43,8 @@
 
 #if defined(USE_MMALLOC) && defined(HAVE_MMAP)
 
+#include "mmalloc.h"
+
 static int open_existing_mapped_file (char *, long, int);
 
 static int open_mapped_file (char *filename, long mtime, int flags);
index ed1b2b7ba67c5e1bc5fa735e3d6e4acc1573cdd5..4d12c3998ceb388c108ce0232518168364871d28 100644 (file)
 
 #include <readline/readline.h>
 
+#ifdef USE_MMALLOC
+#include "mmalloc.h"
+#endif
+
 #ifndef MALLOC_INCOMPATIBLE
 #ifdef NEED_DECLARATION_MALLOC
 extern PTR malloc ();
@@ -893,14 +897,14 @@ request_quit (int signo)
 /* NOTE: These must use PTR so that their definition matches the
    declaration found in "mmalloc.h". */
 
-PTR
-mmalloc (PTR md, size_t size)
+static void *
+mmalloc (void *md, size_t size)
 {
   return malloc (size); /* NOTE: GDB's only call to malloc() */
 }
 
-PTR
-mrealloc (PTR md, PTR ptr, size_t size)
+static void *
+mrealloc (void *md, void *ptr, size_t size)
 {
   if (ptr == 0)                        /* Guard against old realloc's */
     return mmalloc (md, size);
@@ -908,14 +912,14 @@ mrealloc (PTR md, PTR ptr, size_t size)
     return realloc (ptr, size); /* NOTE: GDB's only call to ralloc() */
 }
 
-PTR
-mcalloc (PTR md, size_t number, size_t size)
+static void *
+mcalloc (void *md, size_t number, size_t size)
 {
   return calloc (number, size); /* NOTE: GDB's only call to calloc() */
 }
 
-void
-mfree (PTR md, PTR ptr)
+static void
+mfree (void *md, void *ptr)
 {
   free (ptr); /* NOTE: GDB's only call to free() */
 }