minor cleanups in is_dynamic_type
authorTom Tromey <tromey@redhat.com>
Thu, 8 May 2014 16:10:43 +0000 (10:10 -0600)
committerTom Tromey <tromey@redhat.com>
Wed, 4 Jun 2014 20:28:20 +0000 (14:28 -0600)
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-06-04  Tom Tromey  <tromey@redhat.com>

* gdbtypes.c (is_dynamic_type): Remove unneeded "break"s.

gdb/ChangeLog
gdb/gdbtypes.c

index 8e48f1f..ba04857 100644 (file)
@@ -1,5 +1,9 @@
 2014-06-04  Tom Tromey  <tromey@redhat.com>
 
+       * gdbtypes.c (is_dynamic_type): Remove unneeded "break"s.
+
+2014-06-04  Tom Tromey  <tromey@redhat.com>
+
        * procfs.c (procfs_attach): Make "args" const.
        * windows-nat.c (windows_attach): Make "args" const.
        * nto-procfs.c (procfs_attach): Make "args" const.
index 0d7b793..ba35883 100644 (file)
@@ -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 *