libsframe: use uint8_t instead of unsigned char for abi_arch
authorIndu Bhagat <indu.bhagat@oracle.com>
Tue, 27 Jun 2023 18:55:59 +0000 (11:55 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Tue, 27 Jun 2023 19:01:56 +0000 (12:01 -0700)
Use uint8_t consistently for identifying ABI/arch in SFrame format.

bfd/
* elf-sframe.c (_bfd_elf_merge_section_sframe):
libsframe/
* sframe-dump.c (is_sframe_abi_arch_aarch64): Use uint8_t for
local variable.
* sframe.c (sframe_decoder_get_abi_arch): Update return type to
uint8_t.
(sframe_encoder_get_abi_arch): Likewise.
include/
* sframe-api.h (sframe_decoder_get_abi_arch): Likewise.
(sframe_encoder_get_abi_arch): Likewise.

bfd/elf-sframe.c
include/sframe-api.h
libsframe/sframe-dump.c
libsframe/sframe.c

index 57d67989bf9fac4e7cd3393b46d35b5120490ecf..069f7564fb45793d007782a1dce1918a35683327 100644 (file)
@@ -325,7 +325,7 @@ _bfd_elf_merge_section_sframe (bfd *abfd,
   struct sframe_enc_info *sfe_info;
   sframe_decoder_ctx *sfd_ctx;
   sframe_encoder_ctx *sfe_ctx;
-  unsigned char sfd_ctx_abi_arch;
+  uint8_t sfd_ctx_abi_arch;
   int8_t sfd_ctx_fixed_fp_offset;
   int8_t sfd_ctx_fixed_ra_offset;
   int encerr = 0;
index 70829ec87cba8f39b70f5b7f2692e5735b414076..e62a7a38285f968edb7b59b64152320b34ac8e33 100644 (file)
@@ -117,7 +117,7 @@ extern unsigned int
 sframe_decoder_get_hdr_size (sframe_decoder_ctx *dctx);
 
 /* Get the SFrame's abi/arch info.  */
-extern unsigned char
+extern uint8_t
 sframe_decoder_get_abi_arch (sframe_decoder_ctx *dctx);
 
 /* Return the number of function descriptor entries in the SFrame decoder
@@ -214,7 +214,7 @@ extern unsigned int
 sframe_encoder_get_hdr_size (sframe_encoder_ctx *encoder);
 
 /* Get the abi/arch info from the SFrame encoder context CTX.  */
-extern unsigned char
+extern uint8_t
 sframe_encoder_get_abi_arch (sframe_encoder_ctx *encoder);
 
 /* Return the number of function descriptor entries in the SFrame encoder
index 2491b4391f3bca28abd308aee028231cede09592..37ce9d70eb3726d9915dd2e375ce51619b4279a0 100644 (file)
@@ -32,9 +32,9 @@ is_sframe_abi_arch_aarch64 (sframe_decoder_ctx *sfd_ctx)
 {
   bool aarch64_p = false;
 
-  unsigned char abi_arch = sframe_decoder_get_abi_arch (sfd_ctx);
-  if ((abi_arch == SFRAME_ABI_AARCH64_ENDIAN_BIG)
-      || (abi_arch == SFRAME_ABI_AARCH64_ENDIAN_LITTLE))
+  uint8_t abi_arch = sframe_decoder_get_abi_arch (sfd_ctx);
+  if (abi_arch == SFRAME_ABI_AARCH64_ENDIAN_BIG
+      || abi_arch == SFRAME_ABI_AARCH64_ENDIAN_LITTLE)
     aarch64_p = true;
 
   return aarch64_p;
index 8e9dc0a9d2c762bede495073e4015d7cf100ca28..2d7e4a4a46264279df3b54052f77e0c3da2caf15 100644 (file)
@@ -931,13 +931,13 @@ sframe_decoder_get_hdr_size (sframe_decoder_ctx *ctx)
   return sframe_get_hdr_size (dhp);
 }
 
-/* Get the SFrame's abi/arch info given the decoder context CTX.  */
+/* Get the SFrame's abi/arch info given the decoder context DCTX.  */
 
-unsigned char
-sframe_decoder_get_abi_arch (sframe_decoder_ctx *ctx)
+uint8_t
+sframe_decoder_get_abi_arch (sframe_decoder_ctx *dctx)
 {
   sframe_header *sframe_header;
-  sframe_header = sframe_decoder_get_header (ctx);
+  sframe_header = sframe_decoder_get_header (dctx);
   return sframe_header->sfh_abi_arch;
 }
 
@@ -1322,10 +1322,10 @@ sframe_encoder_get_hdr_size (sframe_encoder_ctx *encoder)
 
 /* Get the abi/arch info from the SFrame encoder context ENCODER.  */
 
-unsigned char
+uint8_t
 sframe_encoder_get_abi_arch (sframe_encoder_ctx *encoder)
 {
-  unsigned char abi_arch = 0;
+  uint8_t abi_arch = 0;
   sframe_header *ehp;
   ehp = sframe_encoder_get_header (encoder);
   if (ehp)