aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-09-17 15:24:01 +0930
committerAlan Modra <amodra@gmail.com>2019-09-18 22:20:13 +0930
commit01c2b26160575ad4add68da8a043b3fa30defae4 (patch)
tree0cb1856133adabca1bd72dc27e73ccf978f0be99 /bfd
parent1d38e9d14cc793bca9124d5ed7dc2a6e3122f2e5 (diff)
downloadfsf-binutils-gdb-01c2b26160575ad4add68da8a043b3fa30defae4.zip
fsf-binutils-gdb-01c2b26160575ad4add68da8a043b3fa30defae4.tar.gz
fsf-binutils-gdb-01c2b26160575ad4add68da8a043b3fa30defae4.tar.bz2
Constify bfd_octets_per_byte and related functions
* archures.c (bfd_get_arch): Make param const. (bfd_get_mach, bfd_arch_bits_per_byte): Likewise. (bfd_arch_bits_per_address, bfd_octets_per_byte): Likewise. * bfd-in2.h: Regenerate.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog7
-rw-r--r--bfd/archures.c20
-rw-r--r--bfd/bfd-in2.h10
3 files changed, 22 insertions, 15 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 8c5ce8b..820c3bd 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,5 +1,12 @@
2019-09-18 Alan Modra <amodra@gmail.com>
+ * archures.c (bfd_get_arch): Make param const.
+ (bfd_get_mach, bfd_arch_bits_per_byte): Likewise.
+ (bfd_arch_bits_per_address, bfd_octets_per_byte): Likewise.
+ * bfd-in2.h: Regenerate.
+
+2019-09-18 Alan Modra <amodra@gmail.com>
+
* bfd-in.h (carsym.name): Make const.
* reloc.c (struct reloc_howto_struct.name): Likewise.
* targets.c (bfd_target.name): Likewise.!
diff --git a/bfd/archures.c b/bfd/archures.c
index 02c8e4e..1e6a0e1 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -999,7 +999,7 @@ FUNCTION
bfd_get_arch
SYNOPSIS
- enum bfd_architecture bfd_get_arch (bfd *abfd);
+ enum bfd_architecture bfd_get_arch (const bfd *abfd);
DESCRIPTION
Return the enumerated type which describes the BFD @var{abfd}'s
@@ -1007,7 +1007,7 @@ DESCRIPTION
*/
enum bfd_architecture
-bfd_get_arch (bfd *abfd)
+bfd_get_arch (const bfd *abfd)
{
return abfd->arch_info->arch;
}
@@ -1017,7 +1017,7 @@ FUNCTION
bfd_get_mach
SYNOPSIS
- unsigned long bfd_get_mach (bfd *abfd);
+ unsigned long bfd_get_mach (const bfd *abfd);
DESCRIPTION
Return the long type which describes the BFD @var{abfd}'s
@@ -1025,7 +1025,7 @@ DESCRIPTION
*/
unsigned long
-bfd_get_mach (bfd *abfd)
+bfd_get_mach (const bfd *abfd)
{
return abfd->arch_info->mach;
}
@@ -1035,7 +1035,7 @@ FUNCTION
bfd_arch_bits_per_byte
SYNOPSIS
- unsigned int bfd_arch_bits_per_byte (bfd *abfd);
+ unsigned int bfd_arch_bits_per_byte (const bfd *abfd);
DESCRIPTION
Return the number of bits in one of the BFD @var{abfd}'s
@@ -1043,7 +1043,7 @@ DESCRIPTION
*/
unsigned int
-bfd_arch_bits_per_byte (bfd *abfd)
+bfd_arch_bits_per_byte (const bfd *abfd)
{
return abfd->arch_info->bits_per_byte;
}
@@ -1053,7 +1053,7 @@ FUNCTION
bfd_arch_bits_per_address
SYNOPSIS
- unsigned int bfd_arch_bits_per_address (bfd *abfd);
+ unsigned int bfd_arch_bits_per_address (const bfd *abfd);
DESCRIPTION
Return the number of bits in one of the BFD @var{abfd}'s
@@ -1061,7 +1061,7 @@ DESCRIPTION
*/
unsigned int
-bfd_arch_bits_per_address (bfd *abfd)
+bfd_arch_bits_per_address (const bfd *abfd)
{
return abfd->arch_info->bits_per_address;
}
@@ -1383,7 +1383,7 @@ FUNCTION
bfd_octets_per_byte
SYNOPSIS
- unsigned int bfd_octets_per_byte (bfd *abfd);
+ unsigned int bfd_octets_per_byte (const bfd *abfd);
DESCRIPTION
Return the number of octets (8-bit quantities) per target byte
@@ -1392,7 +1392,7 @@ DESCRIPTION
*/
unsigned int
-bfd_octets_per_byte (bfd *abfd)
+bfd_octets_per_byte (const bfd *abfd)
{
return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd),
bfd_get_mach (abfd));
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index 135c1e5..aec2143 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -2545,13 +2545,13 @@ void bfd_set_arch_info (bfd *abfd, const bfd_arch_info_type *arg);
bfd_boolean bfd_default_set_arch_mach
(bfd *abfd, enum bfd_architecture arch, unsigned long mach);
-enum bfd_architecture bfd_get_arch (bfd *abfd);
+enum bfd_architecture bfd_get_arch (const bfd *abfd);
-unsigned long bfd_get_mach (bfd *abfd);
+unsigned long bfd_get_mach (const bfd *abfd);
-unsigned int bfd_arch_bits_per_byte (bfd *abfd);
+unsigned int bfd_arch_bits_per_byte (const bfd *abfd);
-unsigned int bfd_arch_bits_per_address (bfd *abfd);
+unsigned int bfd_arch_bits_per_address (const bfd *abfd);
const bfd_arch_info_type *bfd_get_arch_info (bfd *abfd);
@@ -2561,7 +2561,7 @@ const bfd_arch_info_type *bfd_lookup_arch
const char *bfd_printable_arch_mach
(enum bfd_architecture arch, unsigned long machine);
-unsigned int bfd_octets_per_byte (bfd *abfd);
+unsigned int bfd_octets_per_byte (const bfd *abfd);
unsigned int bfd_arch_mach_octets_per_byte
(enum bfd_architecture arch, unsigned long machine);