diff options
author | Tom Tromey <tromey@redhat.com> | 2014-07-21 16:54:06 -0600 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2014-07-24 11:30:02 -0600 |
commit | fc4baa5e1f016c27eab4b2593a1ba9db60e11bee (patch) | |
tree | 4d095e5b1b3c82f8f63bf8ea8c7b113765771469 /gdb | |
parent | 0d5f0dbeb03bab0ce02bf9a4e61d298ad7f1c9bb (diff) | |
download | gdb-fc4baa5e1f016c27eab4b2593a1ba9db60e11bee.zip gdb-fc4baa5e1f016c27eab4b2593a1ba9db60e11bee.tar.gz gdb-fc4baa5e1f016c27eab4b2593a1ba9db60e11bee.tar.bz2 |
constify maint.c
This does a bit of constification in maint.c, making
print_bfd_section_info a bit cleaner in the process.
2014-07-24 Tom Tromey <tromey@redhat.com>
* maint.c (match_bfd_flags): Make "string" const.
(print_bfd_section_info): Remove casts.
(print_objfile_section_info): Make "string" const.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/maint.c | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3f8d055..aaa3307 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2014-07-24 Tom Tromey <tromey@redhat.com> + * maint.c (match_bfd_flags): Make "string" const. + (print_bfd_section_info): Remove casts. + (print_objfile_section_info): Make "string" const. + +2014-07-24 Tom Tromey <tromey@redhat.com> + * inf-child.c (inf_child_open_target): Make "arg" const. * inf-child.h (inf_child_open_target): Update. diff --git a/gdb/maint.c b/gdb/maint.c index c7a937c..99c7f9e 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -236,7 +236,7 @@ match_substring (const char *string, const char *substr) } static int -match_bfd_flags (char *string, flagword flags) +match_bfd_flags (const char *string, flagword flags) { if (flags & SEC_ALLOC) if (match_substring (string, "ALLOC")) @@ -324,14 +324,15 @@ maint_print_section_info (const char *name, flagword flags, static void print_bfd_section_info (bfd *abfd, asection *asect, - void *arg) + void *datum) { flagword flags = bfd_get_section_flags (abfd, asect); const char *name = bfd_section_name (abfd, asect); + const char *arg = datum; - if (arg == NULL || *((char *) arg) == '\0' - || match_substring ((char *) arg, name) - || match_bfd_flags ((char *) arg, flags)) + if (arg == NULL || *arg == '\0' + || match_substring (arg, name) + || match_bfd_flags (arg, flags)) { struct gdbarch *gdbarch = gdbarch_from_bfd (abfd); int addr_size = gdbarch_addr_bit (gdbarch) / 8; @@ -348,7 +349,7 @@ print_bfd_section_info (bfd *abfd, static void print_objfile_section_info (bfd *abfd, struct obj_section *asect, - char *string) + const char *string) { flagword flags = bfd_get_section_flags (abfd, asect->the_bfd_section); const char *name = bfd_section_name (abfd, asect->the_bfd_section); |