Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [patch] Make source_file_name const char *.
@ 2010-04-06 19:48 Doug Evans
  2010-04-07  5:33 ` Joel Brobecker
  0 siblings, 1 reply; 3+ messages in thread
From: Doug Evans @ 2010-04-06 19:48 UTC (permalink / raw)
  To: gdb-patches

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);
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] Make source_file_name const char *.
  2010-04-06 19:48 [patch] Make source_file_name const char * Doug Evans
@ 2010-04-07  5:33 ` Joel Brobecker
  2010-04-07 16:56   ` Doug Evans
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Brobecker @ 2010-04-07  5:33 UTC (permalink / raw)
  To: Doug Evans; +Cc: gdb-patches

> I will check this patch in in a few days if there are no objections.
> It just adds const to source_file_name.

I'd say go ahead. I think your patch is an improvement, and at worst,
it's so easy to revert that it's not worth the pain of waiting
for potential objections (IMO).

-- 
Joel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] Make source_file_name const char *.
  2010-04-07  5:33 ` Joel Brobecker
@ 2010-04-07 16:56   ` Doug Evans
  0 siblings, 0 replies; 3+ messages in thread
From: Doug Evans @ 2010-04-07 16:56 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On Tue, Apr 6, 2010 at 10:33 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> I will check this patch in in a few days if there are no objections.
>> It just adds const to source_file_name.
>
> I'd say go ahead. I think your patch is an improvement, and at worst,
> it's so easy to revert that it's not worth the pain of waiting
> for potential objections (IMO).

"works for me"
Thanks, checked in.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-07 16:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-06 19:48 [patch] Make source_file_name const char * Doug Evans
2010-04-07  5:33 ` Joel Brobecker
2010-04-07 16:56   ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox