* defs.h (msavestring, mstrsave): Remove prototypes.

* utils.c (msavestring, mstrsave): Remove functions.
* objfiles.c (allocate_objfile): Use xstrdup instead of mstrsave.
* solib-sunos.c (allocate_rt_common_objfile): Use xstrdup instead
of mstrsave.
* source.c (find_and_open_source): Use xstrdup instead of
mstrsave.
This commit is contained in:
Mark Kettenis 2004-09-30 19:57:54 +00:00
parent db8acf26ca
commit 982526a134
6 changed files with 14 additions and 23 deletions

View File

@ -1,3 +1,13 @@
2004-09-29 Mark Kettenis <kettenis@gnu.org>
* defs.h (msavestring, mstrsave): Remove prototypes.
* utils.c (msavestring, mstrsave): Remove functions.
* objfiles.c (allocate_objfile): Use xstrdup instead of mstrsave.
* solib-sunos.c (allocate_rt_common_objfile): Use xstrdup instead
of mstrsave.
* source.c (find_and_open_source): Use xstrdup instead of
mstrsave.
2004-09-30 Andrew Cagney <cagney@gnu.org>
* inf-ptrace.c (inf_ptrace_target): Do not set to_xfer_memory.

View File

@ -852,10 +852,6 @@ extern int longest_to_int (LONGEST);
extern char *savestring (const char *, size_t);
extern char *msavestring (void *, const char *, size_t);
extern char *mstrsave (void *, const char *);
/* xmalloc(), xrealloc() and xcalloc() have already been declared in
"libiberty.h". */
extern void xfree (void *);

View File

@ -184,7 +184,7 @@ allocate_objfile (bfd *abfd, int flags)
}
if (abfd != NULL)
{
objfile->name = mstrsave (objfile->md, bfd_get_filename (abfd));
objfile->name = xstrdup (bfd_get_filename (abfd));
objfile->mtime = bfd_get_mtime (abfd);
/* Build section table. */
@ -197,7 +197,7 @@ allocate_objfile (bfd *abfd, int flags)
}
else
{
objfile->name = mstrsave (objfile->md, "<<anonymous objfile>>");
objfile->name = xstrdup ("<<anonymous objfile>>");
}
/* Initialize the section indexes for this objfile, so that we can

View File

@ -146,7 +146,7 @@ allocate_rt_common_objfile (void)
objfile->psymbol_cache = bcache_xmalloc ();
objfile->macro_cache = bcache_xmalloc ();
obstack_init (&objfile->objfile_obstack);
objfile->name = mstrsave (objfile->md, "rt_common");
objfile->name = xstrdup ("rt_common");
/* Add this file onto the tail of the linked list of other such files. */

View File

@ -889,7 +889,7 @@ find_and_open_source (struct objfile *objfile,
{
char *tmp_fullname;
tmp_fullname = *fullname;
*fullname = mstrsave (objfile->md, *fullname);
*fullname = xstrdup (tmp_fullname);
xfree (tmp_fullname);
}
return result;

View File

@ -1168,21 +1168,6 @@ savestring (const char *ptr, size_t size)
return p;
}
char *
msavestring (void *md, const char *ptr, size_t size)
{
char *p = (char *) xmalloc (size + 1);
memcpy (p, ptr, size);
p[size] = 0;
return p;
}
char *
mstrsave (void *md, const char *ptr)
{
return (msavestring (md, ptr, strlen (ptr)));
}
void
print_spaces (int n, struct ui_file *file)
{