This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 08/13] make {logical,physical}_input_file const


From: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>

gas/ChangeLog:

2016-02-21  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>

	* input-scrub.c (logical_input_file): change type to const char *.
	(physical_input_file): Likewise.
       	(struct input_save): Adjust.
	(input_scrub_push): Adjust.
	(input_scrub_begin): Adjust.
	(as_where): Adjust.
---
 gas/input-scrub.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gas/input-scrub.c b/gas/input-scrub.c
index ac71622..75388d3 100644
--- a/gas/input-scrub.c
+++ b/gas/input-scrub.c
@@ -95,8 +95,8 @@ int macro_nest;
    source line numbers.  Whenever we open a file we must fill in
    physical_input_file. So if it is NULL we have not opened any files yet.  */
 
-static char *physical_input_file;
-static char *logical_input_file;
+static const char *physical_input_file;
+static const char *logical_input_file;
 
 /* 1-origin line number in a source file.  */
 /* A line ends in '\n' or eof.  */
@@ -110,8 +110,8 @@ struct input_save {
   int                 partial_size;
   char                save_source[AFTER_SIZE];
   size_t              buffer_length;
-  char *              physical_input_file;
-  char *              logical_input_file;
+  const char *              physical_input_file;
+  const char *              logical_input_file;
   unsigned int        physical_input_line;
   int                 logical_input_line;
   size_t              sb_index;
@@ -159,7 +159,7 @@ input_scrub_push (char *saved_position)
 
   input_file_begin ();		/* Reinitialize! */
   logical_input_line = -1;
-  logical_input_file = (char *) NULL;
+  logical_input_file = NULL;
   buffer_length = input_file_buffer_size ();
   sb_index = -1;
 
@@ -214,7 +214,7 @@ input_scrub_begin (void)
 
   /* Line number things.  */
   logical_input_line = -1;
-  logical_input_file = (char *) NULL;
+  logical_input_file = NULL;
   physical_input_file = NULL;	/* No file read yet.  */
   next_saved_file = NULL;	/* At EOF, don't pop to any other file */
   do_scrub_begin (flag_m68k_mri);
@@ -492,13 +492,13 @@ as_where (unsigned int *linep)
     {
       if (linep != NULL)
 	*linep = logical_input_line;
-      return logical_input_file;
+      return (char *) logical_input_file;
     }
   else if (physical_input_file != NULL)
     {
       if (linep != NULL)
 	*linep = physical_input_line;
-      return physical_input_file;
+      return (char *) physical_input_file;
     }
   else
     {
-- 
2.7.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]