[rfa] make bfd_set_section_contents buffer param constant
Andrew Cagney
ac131313@redhat.com
Fri Oct 31 17:42:00 GMT 2003
> Hello,
>
> (almost obvious :-)
>
> This makes the buffer parameter passed into bfd_set_section_contents constant. The only effect is +ve - remove the need to cast away "const" when calling the method with a constant buffer.
>
> ok?
> Andrew
Oops, I lied. It affect anything in binutils. This one bit of code in
GDB will require a tweak.
xfer_fn = write ? bfd_set_section_contents : bfd_get_section_contents;
still ok?
Andrew
> 2003-10-31 Andrew Cagney <cagney@redhat.com>
>
> * section.c (bfd_set_section_contents): Make the "location" buffer
> constant.
> * bfd-in2.h: Re-generate.
>
> Index: bfd-in2.h
> ===================================================================
> RCS file: /cvs/src/src/bfd/bfd-in2.h,v
> retrieving revision 1.246
> diff -u -r1.246 bfd-in2.h
> --- bfd-in2.h 31 Oct 2003 05:32:45 -0000 1.246
> +++ bfd-in2.h 31 Oct 2003 17:19:06 -0000
> @@ -1483,8 +1483,8 @@
> (bfd *abfd, asection *sec, bfd_size_type val);
>
> bfd_boolean bfd_set_section_contents
> - (bfd *abfd, asection *section, void *data, file_ptr offset,
> - bfd_size_type count);
> + (bfd *abfd, asection *section, const void *data,
> + file_ptr offset, bfd_size_type count);
>
> bfd_boolean bfd_get_section_contents
> (bfd *abfd, asection *section, void *location, file_ptr offset,
> Index: section.c
> ===================================================================
> RCS file: /cvs/src/src/bfd/section.c,v
> retrieving revision 1.64
> diff -u -r1.64 section.c
> --- section.c 31 Oct 2003 05:32:46 -0000 1.64
> +++ section.c 31 Oct 2003 17:19:06 -0000
> @@ -1132,8 +1132,8 @@
>
> SYNOPSIS
> bfd_boolean bfd_set_section_contents
> - (bfd *abfd, asection *section, void *data, file_ptr offset,
> - bfd_size_type count);
> + (bfd *abfd, asection *section, const void *data,
> + file_ptr offset, bfd_size_type count);
>
> DESCRIPTION
> Sets the contents of the section @var{section} in BFD
> @@ -1161,7 +1161,7 @@
> bfd_boolean
> bfd_set_section_contents (bfd *abfd,
> sec_ptr section,
> - void *location,
> + const void *location,
> file_ptr offset,
> bfd_size_type count)
> {
More information about the Gdb-patches
mailing list