From: dje@google.com (Doug Evans)
To: gdb-patches@sourceware.org
Subject: [patch] Make source_file_name const char *.
Date: Tue, 06 Apr 2010 19:48:00 -0000 [thread overview]
Message-ID: <20100406194845.F12F784397@ruffy.mtv.corp.google.com> (raw)
Hi.
I will check this patch in in a few days if there are no objections.
It just adds const to source_file_name.
[fyi, I have some other pending patches that use const char *'s for
file names that depend on this one. This one is standalone
so I've separated it out.]
2010-04-06 Doug Evans <dje@google.com>
* top.c (source_file_name): Make const char *.
* top.h (source_file_name): Update.
* cli/cli-script.c (source_cleanup_lines_args): Make old_file
const char *.
(script_from_file): Change FILE arg to const char *.
* cli/cli-script.h (script_from_file): Update.
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.177
diff -u -p -r1.177 top.c
--- top.c 19 Jan 2010 22:23:53 -0000 1.177
+++ top.c 6 Apr 2010 19:43:40 -0000
@@ -298,7 +298,7 @@ quit_cover (void *s)
/* NOTE 1999-04-29: This variable will be static again, once we modify
gdb to use the event loop as the default command loop and we merge
event-top.c into this file, top.c */
-/* static */ char *source_file_name;
+/* static */ const char *source_file_name;
/* Clean up on error during a "source" command (or execution of a
user-defined command). */
Index: top.h
===================================================================
RCS file: /cvs/src/src/gdb/top.h,v
retrieving revision 1.21
diff -u -p -r1.21 top.h
--- top.h 6 Apr 2010 16:51:18 -0000 1.21
+++ top.h 6 Apr 2010 19:43:40 -0000
@@ -68,7 +68,7 @@ extern void gdb_init (char *);
/* For use by event-top.c */
/* Variables from top.c. */
extern int source_line_number;
-extern char *source_file_name;
+extern const char *source_file_name;
extern int history_expansion_p;
extern int server_command;
extern char *lim_at_start;
Index: cli/cli-script.c
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-script.c,v
retrieving revision 1.60
diff -u -p -r1.60 cli-script.c
--- cli/cli-script.c 28 Mar 2010 18:00:56 -0000 1.60
+++ cli/cli-script.c 6 Apr 2010 19:43:40 -0000
@@ -1557,7 +1557,7 @@ document_command (char *comname, int fro
struct source_cleanup_lines_args
{
int old_line;
- char *old_file;
+ const char *old_file;
};
static void
@@ -1584,7 +1584,7 @@ wrapped_read_command_file (struct ui_out
/* Used to implement source_command */
void
-script_from_file (FILE *stream, char *file)
+script_from_file (FILE *stream, const char *file)
{
struct cleanup *old_cleanups;
struct source_cleanup_lines_args old_lines;
Index: cli/cli-script.h
===================================================================
RCS file: /cvs/src/src/gdb/cli/cli-script.h,v
retrieving revision 1.15
diff -u -p -r1.15 cli-script.h
--- cli/cli-script.h 1 Jan 2010 07:31:47 -0000 1.15
+++ cli/cli-script.h 6 Apr 2010 19:43:40 -0000
@@ -24,7 +24,7 @@ struct cmd_list_element;
/* Exported to cli/cli-cmds.c */
-extern void script_from_file (FILE *stream, char *file);
+extern void script_from_file (FILE *stream, const char *file);
extern void document_command (char *, int);
next reply other threads:[~2010-04-06 19:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-06 19:48 Doug Evans [this message]
2010-04-07 5:33 ` Joel Brobecker
2010-04-07 16:56 ` Doug Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100406194845.F12F784397@ruffy.mtv.corp.google.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox