aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2005-01-27 20:34:51 +0000
committerAndrew Cagney <cagney@redhat.com>2005-01-27 20:34:51 +0000
commitc26b8e3b42c143d9262b52f43d6f204f305f0276 (patch)
treea7260374a4aad57c7bce68bfb839eac75b1fc2ed /gdb/cli
parent10e2d419a3084f5ed32c340cd27a94a911f694b9 (diff)
downloadgdb-c26b8e3b42c143d9262b52f43d6f204f305f0276.zip
gdb-c26b8e3b42c143d9262b52f43d6f204f305f0276.tar.gz
gdb-c26b8e3b42c143d9262b52f43d6f204f305f0276.tar.bz2
2005-01-27 Andrew Cagney <cagney@gnu.org>
* cli/cli-dump.h (fopen_with_cleanup): Make "filename" const. * cli/cli-dump.c (dump_binary_file, dump_bfd_file): Make string parameters const, change buf to a const bfd_byte. (fopen_with_cleanup, bfd_openw_with_cleanup): Make all string parameters const.
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-dump.c17
-rw-r--r--gdb/cli/cli-dump.h4
2 files changed, 11 insertions, 10 deletions
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 09bbf12..5622f5f 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -1,6 +1,6 @@
/* Dump-to-file commands, for GDB, the GNU debugger.
- Copyright 2002 Free Software Foundation, Inc.
+ Copyright 2002, 2005 Free Software Foundation, Inc.
Contributed by Red Hat.
@@ -118,7 +118,7 @@ scan_filename_with_cleanup (char **cmd, const char *defname)
}
FILE *
-fopen_with_cleanup (char *filename, const char *mode)
+fopen_with_cleanup (const char *filename, const char *mode)
{
FILE *file = fopen (filename, mode);
if (file == NULL)
@@ -145,7 +145,8 @@ bfd_openr_with_cleanup (const char *filename, const char *target)
}
static bfd *
-bfd_openw_with_cleanup (char *filename, const char *target, char *mode)
+bfd_openw_with_cleanup (const char *filename, const char *target,
+ const char *mode)
{
bfd *obfd;
@@ -192,8 +193,8 @@ append_command (char *cmd, int from_tty)
}
static void
-dump_binary_file (char *filename, char *mode,
- char *buf, int len)
+dump_binary_file (const char *filename, const char *mode,
+ const bfd_byte *buf, int len)
{
FILE *file;
int status;
@@ -205,9 +206,9 @@ dump_binary_file (char *filename, char *mode,
}
static void
-dump_bfd_file (char *filename, char *mode,
- char *target, CORE_ADDR vaddr,
- char *buf, int len)
+dump_bfd_file (const char *filename, const char *mode,
+ const char *target, CORE_ADDR vaddr,
+ const bfd_byte *buf, int len)
{
bfd *obfd;
asection *osection;
diff --git a/gdb/cli/cli-dump.h b/gdb/cli/cli-dump.h
index 187e0e0..91c9cfb 100644
--- a/gdb/cli/cli-dump.h
+++ b/gdb/cli/cli-dump.h
@@ -1,6 +1,6 @@
/* Dump-to-file commands, for GDB, the GNU debugger.
- Copyright 2001 Free Software Foundation, Inc.
+ Copyright 2001, 2005 Free Software Foundation, Inc.
This file is part of GDB.
@@ -31,7 +31,7 @@ extern char *scan_filename_with_cleanup (char **cmd, const char *defname);
extern char *scan_expression_with_cleanup (char **cmd, const char *defname);
-extern FILE *fopen_with_cleanup (char *filename, const char *mode);
+extern FILE *fopen_with_cleanup (const char *filename, const char *mode);
extern char *skip_spaces (char *inp);