* 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-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.
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 *);
}
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. */
}
else
{
- objfile->name = mstrsave (objfile->md, "<<anonymous objfile>>");
+ objfile->name = xstrdup ("<<anonymous objfile>>");
}
/* Initialize the section indexes for this objfile, so that we can
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. */
{
char *tmp_fullname;
tmp_fullname = *fullname;
- *fullname = mstrsave (objfile->md, *fullname);
+ *fullname = xstrdup (tmp_fullname);
xfree (tmp_fullname);
}
return result;
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)
{