* [FYI] Change get_filename_and_charpos to return void
@ 2018-11-19 22:45 Tom Tromey
0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2018-11-19 22:45 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
The return value from get_filename_and_charpos is never used, so this
patch changes it to return void.
gdb/ChangeLog
2018-11-19 Tom Tromey <tom@tromey.com>
* source.c (get_filename_and_charpos): Return void.
---
gdb/ChangeLog | 4 ++++
gdb/source.c | 14 ++------------
2 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/gdb/source.c b/gdb/source.c
index 59f00fc38f..b38eed5be6 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -49,10 +49,6 @@
#define OPEN_MODE (O_RDONLY | O_BINARY)
#define FDOPEN_MODE FOPEN_RB
-/* Prototypes for local functions. */
-
-static int get_filename_and_charpos (struct symtab *, char **);
-
/* Path of directories to search for source files.
Same format as the PATH environment variable's value. */
@@ -1209,29 +1205,23 @@ find_source_lines (struct symtab *s, int desc)
\f
/* Get full pathname and line number positions for a symtab.
- Return nonzero if line numbers may have changed.
Set *FULLNAME to actual name of the file as found by `openp',
or to 0 if the file is not found. */
-static int
+static void
get_filename_and_charpos (struct symtab *s, char **fullname)
{
- int linenums_changed = 0;
-
scoped_fd desc = open_source_file (s);
if (desc.get () < 0)
{
if (fullname)
*fullname = NULL;
- return 0;
+ return;
}
if (fullname)
*fullname = s->fullname;
if (s->line_charpos == 0)
- linenums_changed = 1;
- if (linenums_changed)
find_source_lines (s, desc.get ());
- return linenums_changed;
}
/* Print text describing the full name of the source file S
--
2.17.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-19 22:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 22:45 [FYI] Change get_filename_and_charpos to return void Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).