* inftarg.c (child_create_inferior, child_attach,
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 820925bbf607caff45e6f0253947a80507e2a64d..2090edaf9646251dd43c75b60806be92f2925e57 100644 (file)
@@ -513,15 +513,6 @@ lookup_signed_typename (name)
   return lookup_typename (name, (struct block *) NULL, 0);
 }
 
-struct type *
-check_struct (type)
-     struct type *type;
-{
-  if (TYPE_CODE (type) != TYPE_CODE_STRUCT)
-    error ("This context has %s, not a struct or class.", TYPE_NAME (type));
-  return type;
-}
-
 /* Lookup a structure type named "struct NAME",
    visible in lexical block BLOCK.  */
 
@@ -539,16 +530,11 @@ lookup_struct (name, block)
     {
       error ("No struct type named %s.", name);
     }
-  return check_struct (SYMBOL_TYPE (sym));
-}
-
-struct type *
-check_union (type)
-     struct type *type;
-{
-  if (TYPE_CODE (type) != TYPE_CODE_UNION)
-    error ("This context has %s, not a union.", TYPE_NAME (type));
-  return type;
+  if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_STRUCT)
+    {
+      error ("This context has class, union or enum %s, not a struct.", name);
+    }
+  return (SYMBOL_TYPE (sym));
 }
 
 /* Lookup a union type named "union NAME",
@@ -568,16 +554,11 @@ lookup_union (name, block)
     {
       error ("No union type named %s.", name);
     }
-  return check_union (SYMBOL_TYPE (sym));
-}
-
-struct type *
-check_enum (type)
-     struct type *type;
-{
-  if (TYPE_CODE (type) != TYPE_CODE_ENUM)
-    error ("This context has %s, not an enum.", TYPE_NAME (type));
-  return type;
+  if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_UNION)
+    {
+      error ("This context has class, struct or enum %s, not a union.", name);
+    }
+  return (SYMBOL_TYPE (sym));
 }
 
 /* Lookup an enum type named "enum NAME",
@@ -596,7 +577,11 @@ lookup_enum (name, block)
     {
       error ("No enum type named %s.", name);
     }
-  return check_enum (SYMBOL_TYPE (sym));
+  if (TYPE_CODE (SYMBOL_TYPE (sym)) != TYPE_CODE_ENUM)
+    {
+      error ("This context has class, struct or union %s, not an enum.", name);
+    }
+  return (SYMBOL_TYPE (sym));
 }
 
 /* Lookup a template type named "template NAME<TYPE>",
This page took 0.023785 seconds and 4 git commands to generate.