This is the mail archive of the binutils-cvs@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]

[binutils-gdb] Change the return type of the rebuffer_line function to void.


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=3d13c647015137e616267148a8d51194d13737bf

commit 3d13c647015137e616267148a8d51194d13737bf
Author: Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
Date:   Fri Feb 19 12:13:08 2016 +0000

    Change the return type of the rebuffer_line function to void.
    
    	* listing.c (rebuffer_line): Change return type to void.

Diff:
---
 gas/ChangeLog |  2 ++
 gas/listing.c | 15 ++++++---------
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 54a2893..b1637a3 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,7 @@
 016-02-19  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
 
+	* listing.c (rebuffer_line): Change return type to void.
+
 	* symbols.c (decode_local_label_name): Make type a const char *.
 	* listing.c (print_source): Make type of p const char *.
 	(print_line): Make type of string const	char *.
diff --git a/gas/listing.c b/gas/listing.c
index ee878b9..a346f37 100644
--- a/gas/listing.c
+++ b/gas/listing.c
@@ -551,10 +551,9 @@ buffer_line (file_info_type *file, char *line, unsigned int size)
 
 /* This function rewinds the requested file back to the line requested,
    reads it in again into the buffer provided and then restores the file
-   back to its original location.  Returns the buffer pointer upon success
-   or an empty string if an error occurs.  */
+   back to its original location.  */
 
-static char *
+static void
 rebuffer_line (file_info_type *  file,
 	       unsigned int      linenum,
 	       char *            buffer,
@@ -570,7 +569,7 @@ rebuffer_line (file_info_type *  file,
 
   /* Sanity checks.  */
   if (file == NULL || buffer == NULL || size <= 1 || file->linenum <= linenum)
-    return "";
+    return;
 
   /* Check the cache and see if we last used this file.  */
   if (last_open_file_info == NULL || file != last_open_file_info)
@@ -588,7 +587,7 @@ rebuffer_line (file_info_type *  file,
       if (last_open_file == NULL)
 	{
 	  file->at_end = 1;
-	  return "";
+	  return;
 	}
 
       /* Seek to where we were last time this file was open.  */
@@ -599,7 +598,7 @@ rebuffer_line (file_info_type *  file,
   /* Remember where we are in the current file.  */
   pos2 = pos = ftell (last_open_file);
   if (pos < 3)
-    return "";
+    return;
   current_line = file->linenum;
 
   /* Leave room for the nul at the end of the buffer.  */
@@ -624,7 +623,7 @@ rebuffer_line (file_info_type *  file,
       if (fread (buffer, 1, size, last_open_file) != size)
 	{
 	  as_warn (_("unable to rebuffer file: %s\n"), file->filename);
-	  return "";
+	  return;
 	}
 
       for (ptr = buffer + size; ptr >= buffer; -- ptr)
@@ -691,8 +690,6 @@ rebuffer_line (file_info_type *  file,
 
   /* Reset the file position.  */
   fseek (last_open_file, pos, SEEK_SET);
-
-  return buffer;
 }
 
 static const char *fn;


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