From: Trevor Saunders Date: Fri, 19 Feb 2016 12:13:08 +0000 (+0000) Subject: Change the return type of the rebuffer_line function to void. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d13c647015137e616267148a8d51194d13737bf;p=binutils-gdb.git Change the return type of the rebuffer_line function to void. * listing.c (rebuffer_line): Change return type to void. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 54a28939002..b1637a38ae7 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,5 +1,7 @@ 016-02-19 Trevor Saunders + * 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 ee878b92f8d..a346f376056 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;