This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 1/2] minor cleanups in is_dynamic_type
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Thu, 8 May 2014 12:46:55 -0600
- Subject: [PATCH 1/2] minor cleanups in is_dynamic_type
- Authentication-results: sourceware.org; auth=none
- References: <1399574816-12845-1-git-send-email-tromey at redhat dot com>
I noticed that gdbtypes.c:is_dynamic_type has some unneeded "break"s.
This patch cleans up the function a bit, removing those and removing
the switch's default case so that the end of the function is a bit
clearer.
2014-05-08 Tom Tromey <tromey@redhat.com>
* gdbtypes.c (is_dynamic_type): Remove unneeded "break"s.
---
gdb/ChangeLog | 4 ++++
gdb/gdbtypes.c | 10 +++-------
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 8e6631a..95b861e 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1625,7 +1625,6 @@ is_dynamic_type (struct type *type)
{
case TYPE_CODE_RANGE:
return !has_static_range (TYPE_RANGE_DATA (type));
- break;
case TYPE_CODE_ARRAY:
{
@@ -1635,14 +1634,11 @@ is_dynamic_type (struct type *type)
or the elements it contains have a dynamic contents. */
if (is_dynamic_type (TYPE_INDEX_TYPE (type)))
return 1;
- else
- return is_dynamic_type (TYPE_TARGET_TYPE (type));
- break;
+ return is_dynamic_type (TYPE_TARGET_TYPE (type));
}
- default:
- return 0;
- break;
}
+
+ return 0;
}
static struct type *
--
1.9.0