[binutils-gdb] clean-up bfd/elf-attrs.c: change return type of uleb128_size to unsigned

Matthieu Longo mlongo@sourceware.org
Tue Mar 4 11:09:55 GMT 2025


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=434a7a6bc895774968f68fbe7913d3a753d74b37

commit 434a7a6bc895774968f68fbe7913d3a753d74b37
Author: Matthieu Longo <matthieu.longo@arm.com>
Date:   Mon Jan 20 10:23:21 2025 +0000

    clean-up bfd/elf-attrs.c: change return type of uleb128_size to unsigned

Diff:
---
 bfd/elf-attrs.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/bfd/elf-attrs.c b/bfd/elf-attrs.c
index f9fe0880264..4785f286792 100644
--- a/bfd/elf-attrs.c
+++ b/bfd/elf-attrs.c
@@ -25,11 +25,10 @@
 #include "elf-bfd.h"
 
 /* Return the number of bytes needed by I in uleb128 format.  */
-static int
-uleb128_size (unsigned int i)
+static uint32_t
+uleb128_size (uint32_t i)
 {
-  int size;
-  size = 1;
+  uint32_t size = 1;
   while (i >= 0x80)
     {
       i >>= 7;
@@ -127,7 +126,7 @@ bfd_elf_obj_attr_size (bfd *abfd)
 /* Write VAL in uleb128 format to P, returning a pointer to the
    following byte.  */
 static bfd_byte *
-write_uleb128 (bfd_byte *p, unsigned int val)
+write_uleb128 (bfd_byte *p, uint32_t val)
 {
   bfd_byte c;
   do


More information about the Binutils-cvs mailing list