]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: int to bool in struct entry_info
authorAndrew Burgess <aburgess@redhat.com>
Wed, 15 Apr 2026 09:42:03 +0000 (10:42 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Fri, 17 Apr 2026 20:40:36 +0000 (21:40 +0100)
Convert 'struct entry_info' to use bool for flag fields.  The places
where these flags are set are updated too.  I have also removed the
bit width specifier ": 1" from the flag field definitions.  There is
one entry_info struct per BFD in GDB, which is not a huge number, so
forcing the bool fields to 1-bit doesn't seen necessary.

There should be no user visible changes after this commit.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/objfiles.h
gdb/symfile.c

index 76d6130f504866c361d8c079d52b0075f373e7dd..58c4ff810088dbcef6f206965b563a4afa5166b5 100644 (file)
@@ -115,11 +115,11 @@ struct entry_info
   /* The index of the section in which the entry point appears.  */
   int the_bfd_section_index;
 
-  /* Set to 1 iff ENTRY_POINT contains a valid value.  */
-  unsigned entry_point_p : 1;
+  /* Set to true iff ENTRY_POINT contains a valid value.  */
+  bool entry_point_p;
 
-  /* Set to 1 iff this object was initialized.  */
-  unsigned initialized : 1;
+  /* Set to true iff this object was initialized.  */
+  bool initialized;
 };
 
 #define SECT_OFF_DATA(objfile) \
index d0ea9506c63a4ae4e48c9336fafeabfa462b5b37..d583960d430b3bdab672124246fb82ecdb73a20f 100644 (file)
@@ -776,7 +776,7 @@ init_entry_point_info (struct objfile *objfile)
 
   if (ei->initialized)
     return;
-  ei->initialized = 1;
+  ei->initialized = true;
 
   /* Save startup file's range of PC addresses to help blockframe.c
      decide where the bottom of the stack is.  */
@@ -786,7 +786,7 @@ init_entry_point_info (struct objfile *objfile)
       /* Executable file -- record its entry point so we'll recognize
         the startup file because it contains the entry point.  */
       ei->entry_point = bfd_get_start_address (objfile->obfd.get ());
-      ei->entry_point_p = 1;
+      ei->entry_point_p = true;
     }
   else if (bfd_get_file_flags (objfile->obfd.get ()) & DYNAMIC
           && bfd_get_start_address (objfile->obfd.get ()) != 0)
@@ -795,12 +795,12 @@ init_entry_point_info (struct objfile *objfile)
         runnable.  There's no clear way to indicate this, so just check
         for values other than zero.  */
       ei->entry_point = bfd_get_start_address (objfile->obfd.get ());
-      ei->entry_point_p = 1;
+      ei->entry_point_p = true;
     }
   else
     {
       /* Examination of non-executable.o files.  Short-circuit this stuff.  */
-      ei->entry_point_p = 0;
+      ei->entry_point_p = false;
     }
 
   if (ei->entry_point_p)