This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 5/9] minor cleanup, removing a goto


This is just a minor cleanup to avoid a goto.  This makes a subsequent
change easier.

Built and regtested on x86-64 F16.

	* c-typeprint.c (c_type_print_base) <TYPE_CODE_STRUCT,
	TYPE_CODE_UNION>: Unify, removing a goto.
---
 gdb/c-typeprint.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 22207bc..661ce09 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -774,18 +774,14 @@ c_type_print_base (struct type *type, struct ui_file *stream,
       break;
 
     case TYPE_CODE_STRUCT:
+    case TYPE_CODE_UNION:
       c_type_print_modifier (type, stream, 0, 1);
-      if (TYPE_DECLARED_CLASS (type))
+      if (TYPE_CODE (type) == TYPE_CODE_UNION)
+	fprintf_filtered (stream, "union ");
+      else if (TYPE_DECLARED_CLASS (type))
 	fprintf_filtered (stream, "class ");
       else
 	fprintf_filtered (stream, "struct ");
-      goto struct_union;
-
-    case TYPE_CODE_UNION:
-      c_type_print_modifier (type, stream, 0, 1);
-      fprintf_filtered (stream, "union ");
-
-    struct_union:
 
       /* Print the tag if it exists.  The HP aCC compiler emits a
          spurious "{unnamed struct}"/"{unnamed union}"/"{unnamed
-- 
1.7.7.6


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]