Constify argument to make_tempname and make_tempdir

This constifies the argument to make_tempname and make_tempdir,
removing some casts.

I initially thought that this obsoleted the allocation in
write_archive, but write_archive closes the BFD before using the name,
so this appears not to be the case.

binutils/ChangeLog
2019-09-11  Tom Tromey  <tom@tromey.com>

	* objcopy.c (copy_archive): Update.
	* bucomm.h (make_tempname, make_tempdir): Make argument const.
	* bucomm.c (make_tempname, make_tempdir): Make argument const.
This commit is contained in:
Tom Tromey
2019-09-08 09:53:43 -06:00
parent 0a4632b563
commit 1ff5d5c463
4 changed files with 11 additions and 5 deletions

View File

@@ -532,7 +532,7 @@ template_in_dir (const char *path)
as FILENAME. */
char *
make_tempname (char *filename)
make_tempname (const char *filename)
{
char *tmpname = template_in_dir (filename);
int fd;
@@ -558,7 +558,7 @@ make_tempname (char *filename)
directory containing FILENAME. */
char *
make_tempdir (char *filename)
make_tempdir (const char *filename)
{
char *tmpname = template_in_dir (filename);