summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-03-04 02:23:06 +0000
committerAndrew Cagney <cagney@redhat.com>2000-03-04 02:23:06 +0000
commit082faf240ec27a125674eed0782a50cbb2aed512 (patch)
tree6b420ad3f3bf3e54f80ef914e764488a0715da44 /gdb
parente54a9244cd82c100032fb4443fb6e02d211f359f (diff)
downloadbinutils-gdb-082faf240ec27a125674eed0782a50cbb2aed512.tar.gz
Make mmalloc functions consistent. Some need ISO-C others need PTR :-(.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/defs.h5
-rw-r--r--gdb/utils.c19
3 files changed, 16 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index a8da805d8aa..0e130401691 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+Sat Mar 4 13:02:09 2000 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * utils.c (mcalloc), defs.h (mcalloc): Keep consistent with
+ "mmalloc.h" which means using PTRs.
+ (init_malloc, msavestring, mstrsave): Convert to PTR free ISO-C.
+
Sat Mar 4 11:49:21 2000 Andrew Cagney <cagney@b1.cygnus.com>
* defs.h (store_address, store_unsigned_integer, store_address):
diff --git a/gdb/defs.h b/gdb/defs.h
index 8a06f583dde..9248c761de3 100644
--- a/gdb/defs.h
+++ b/gdb/defs.h
@@ -341,7 +341,10 @@ extern int myread (int, char *, int);
extern int query (char *, ...) ATTR_FORMAT (printf, 1, 2);
#if !defined (USE_MMALLOC)
-extern PTR mcalloc (void *, size_t, size_t);
+/* NOTE: cagney/2000-03-04: The mmalloc functions need to use PTR
+ rather than void* so that they are consistent with
+ ../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);
diff --git a/gdb/utils.c b/gdb/utils.c
index a4686bb84dd..a752f714c55 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -919,8 +919,8 @@ request_quit (signo)
#if !defined (USE_MMALLOC)
-void *
-mcalloc (void *md, size_t number, size_t size)
+PTR
+mcalloc (PTR md, size_t number, size_t size)
{
return calloc (number, size);
}
@@ -958,8 +958,7 @@ mfree (md, ptr)
#if !defined (USE_MMALLOC) || defined (NO_MMCHECK)
void
-init_malloc (md)
- PTR md;
+init_malloc (void *md)
{
}
@@ -991,8 +990,7 @@ malloc_botch ()
#endif
void
-init_malloc (md)
- PTR md;
+init_malloc (void *md)
{
if (!mmcheckf (md, malloc_botch, MMCHECK_FORCE))
{
@@ -1149,10 +1147,7 @@ savestring (ptr, size)
}
char *
-msavestring (md, ptr, size)
- PTR md;
- const char *ptr;
- int size;
+msavestring (void *md, const char *ptr, int size)
{
register char *p = (char *) xmmalloc (md, size + 1);
memcpy (p, ptr, size);
@@ -1171,9 +1166,7 @@ strsave (ptr)
}
char *
-mstrsave (md, ptr)
- PTR md;
- const char *ptr;
+mstrsave (void *md, const char *ptr)
{
return (msavestring (md, ptr, strlen (ptr)));
}