]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove unnecessary braces in recursive_dump_type
authorTankut Baris Aktemur <tankutbaris.aktemur@amd.com>
Thu, 23 Jul 2026 10:04:43 +0000 (05:04 -0500)
committerTankut Baris Aktemur <tankutbaris.aktemur@amd.com>
Thu, 23 Jul 2026 10:10:06 +0000 (05:10 -0500)
Following the refactoring patches, remove unnecessary branches in
recursive_dump_type to comply with the GNU code style.

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

index f9764fb1da317ca6ef2c56f5e9b82caf26ca9531..9098727959ebe1ea4c266e11c4e74e39d48df35d 100644 (file)
@@ -5011,9 +5011,8 @@ recursive_dump_type (struct type *type, int spaces)
   gdb_printf ("%*starget_type %s\n", spaces, "",
              host_address_to_string (type->target_type ()));
   if (type->target_type () != NULL)
-    {
-      recursive_dump_type (type->target_type (), spaces + 2);
-    }
+    recursive_dump_type (type->target_type (), spaces + 2);
+
   gdb_printf ("%*spointer_type %s\n", spaces, "",
              host_address_to_string (type->pointer_type));
   gdb_printf ("%*sreference_type %s\n", spaces, "",
@@ -5039,44 +5038,27 @@ recursive_dump_type (struct type *type, int spaces)
 
   gdb_printf ("%*sflags", spaces, "");
   if (type->is_unsigned ())
-    {
-      gdb_puts (" TYPE_UNSIGNED");
-    }
+    gdb_puts (" TYPE_UNSIGNED");
   if (type->has_no_signedness ())
-    {
-      gdb_puts (" TYPE_NOSIGN");
-    }
+    gdb_puts (" TYPE_NOSIGN");
   if (type->endianity_is_not_default ())
-    {
-      gdb_puts (" TYPE_ENDIANITY_NOT_DEFAULT");
-    }
+    gdb_puts (" TYPE_ENDIANITY_NOT_DEFAULT");
   if (type->is_stub ())
-    {
-      gdb_puts (" TYPE_STUB");
-    }
+    gdb_puts (" TYPE_STUB");
   if (type->target_is_stub ())
-    {
-      gdb_puts (" TYPE_TARGET_STUB");
-    }
+    gdb_puts (" TYPE_TARGET_STUB");
   if (type->is_prototyped ())
-    {
-      gdb_puts (" TYPE_PROTOTYPED");
-    }
+    gdb_puts (" TYPE_PROTOTYPED");
   if (type->has_varargs ())
-    {
-      gdb_puts (" TYPE_VARARGS");
-    }
+    gdb_puts (" TYPE_VARARGS");
+
   /* This is used for things like AltiVec registers on ppc.  Gcc emits
      an attribute for the array type, which tells whether or not we
      have a vector, instead of a regular array.  */
   if (type->is_vector ())
-    {
-      gdb_puts (" TYPE_VECTOR");
-    }
+    gdb_puts (" TYPE_VECTOR");
   if (type->is_fixed_instance ())
-    {
-      gdb_puts (" TYPE_FIXED_INSTANCE");
-    }
+    gdb_puts (" TYPE_FIXED_INSTANCE");
   if (type->is_nottext ())
     gdb_puts (" TYPE_NOTTEXT");
   gdb_puts ("\n");
@@ -5128,9 +5110,7 @@ recursive_dump_type (struct type *type, int spaces)
 
       gdb_printf ("\n");
       if (fld.type () != NULL)
-       {
-         recursive_dump_type (fld.type (), spaces + 4);
-       }
+       recursive_dump_type (fld.type (), spaces + 4);
     }
   if (type->code () == TYPE_CODE_RANGE)
     {