Make mmalloc functions consistent. Some need ISO-C others need PTR :-(.

This commit is contained in:
Andrew Cagney 2000-03-04 02:23:06 +00:00
parent e54a9244cd
commit 082faf240e
3 changed files with 16 additions and 14 deletions

View File

@ -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):

View File

@ -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);

View File

@ -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)));
}