This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH 07/13] input-file: make some file name variables const
- From: tbsaunde+binutils at tbsaunde dot org
- To: binutils at sourceware dot org
- Date: Sun, 21 Feb 2016 21:02:07 -0500
- Subject: [PATCH 07/13] input-file: make some file name variables const
- Authentication-results: sourceware.org; auth=none
- References: <1456106533-19089-1-git-send-email-tbsaunde+binutils at tbsaunde dot org>
From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
gas/ChangeLog:
2016-02-21 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
* input-file.c (file_name): Change type to const char *.
(saved_file::file_name): Likewise.
(input_file_open): Change type of argument to const char *.
* input-file.h (input_file_open): Adjust.
---
gas/input-file.c | 8 +++++---
gas/input-file.h | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gas/input-file.c b/gas/input-file.c
index 08ffa46..a3dcd9d 100644
--- a/gas/input-file.c
+++ b/gas/input-file.c
@@ -42,13 +42,13 @@ int preprocess = 0;
/* We use static data: the data area is not sharable. */
static FILE *f_in;
-static char *file_name;
+static const char *file_name;
/* Struct for saving the state of this module for file includes. */
struct saved_file
{
FILE * f_in;
- char * file_name;
+ const char * file_name;
int preprocess;
char * app_save;
};
@@ -111,8 +111,10 @@ input_file_pop (char *arg)
free (arg);
}
+/* Open the specified file, "" means stdin. Filename must not be null. */
+
void
-input_file_open (char *filename, /* "" means use stdin. Must not be 0. */
+input_file_open (const char *filename,
int pre)
{
int c;
diff --git a/gas/input-file.h b/gas/input-file.h
index cedaa9b..3581046 100644
--- a/gas/input-file.h
+++ b/gas/input-file.h
@@ -61,5 +61,5 @@ size_t input_file_buffer_size (void);
void input_file_begin (void);
void input_file_close (void);
void input_file_end (void);
-void input_file_open (char *filename, int pre);
+void input_file_open (const char *filename, int pre);
void input_file_pop (char *arg);
--
2.7.0