Fix struct, union, and enum nesting in C++
[deliverable/binutils-gdb.git] / gdb / value.c
index 06da269e4204296c673bbc9c072b1281d1bde685..b9a45efa1922c3f2d47e9378df1315d398431dbc 100644 (file)
@@ -1891,6 +1891,66 @@ show_values (char *num_exp, int from_tty)
     }
 }
 \f
+enum internalvar_kind
+{
+  /* The internal variable is empty.  */
+  INTERNALVAR_VOID,
+
+  /* The value of the internal variable is provided directly as
+     a GDB value object.  */
+  INTERNALVAR_VALUE,
+
+  /* A fresh value is computed via a call-back routine on every
+     access to the internal variable.  */
+  INTERNALVAR_MAKE_VALUE,
+
+  /* The internal variable holds a GDB internal convenience function.  */
+  INTERNALVAR_FUNCTION,
+
+  /* The variable holds an integer value.  */
+  INTERNALVAR_INTEGER,
+
+  /* The variable holds a GDB-provided string.  */
+  INTERNALVAR_STRING,
+};
+
+union internalvar_data
+{
+  /* A value object used with INTERNALVAR_VALUE.  */
+  struct value *value;
+
+  /* The call-back routine used with INTERNALVAR_MAKE_VALUE.  */
+  struct
+  {
+    /* The functions to call.  */
+    const struct internalvar_funcs *functions;
+
+    /* The function's user-data.  */
+    void *data;
+  } make_value;
+
+  /* The internal function used with INTERNALVAR_FUNCTION.  */
+  struct
+  {
+    struct internal_function *function;
+    /* True if this is the canonical name for the function.  */
+    int canonical;
+  } fn;
+
+  /* An integer value used with INTERNALVAR_INTEGER.  */
+  struct
+  {
+    /* If type is non-NULL, it will be used as the type to generate
+       a value for this internal variable.  If type is NULL, a default
+       integer type for the architecture is used.  */
+    struct type *type;
+    LONGEST val;
+  } integer;
+
+  /* A string value used with INTERNALVAR_STRING.  */
+  char *string;
+};
+
 /* Internal variables.  These are variables within the debugger
    that hold values assigned by debugger commands.
    The user refers to them with a '$' prefix
@@ -1905,66 +1965,9 @@ struct internalvar
      enum internalvar_kind specifies the kind, and union internalvar_data
      provides the data associated with this particular kind.  */
 
-  enum internalvar_kind
-    {
-      /* The internal variable is empty.  */
-      INTERNALVAR_VOID,
-
-      /* The value of the internal variable is provided directly as
-        a GDB value object.  */
-      INTERNALVAR_VALUE,
-
-      /* A fresh value is computed via a call-back routine on every
-        access to the internal variable.  */
-      INTERNALVAR_MAKE_VALUE,
-
-      /* The internal variable holds a GDB internal convenience function.  */
-      INTERNALVAR_FUNCTION,
-
-      /* The variable holds an integer value.  */
-      INTERNALVAR_INTEGER,
-
-      /* The variable holds a GDB-provided string.  */
-      INTERNALVAR_STRING,
-
-    } kind;
+  enum internalvar_kind kind;
 
-  union internalvar_data
-    {
-      /* A value object used with INTERNALVAR_VALUE.  */
-      struct value *value;
-
-      /* The call-back routine used with INTERNALVAR_MAKE_VALUE.  */
-      struct
-        {
-         /* The functions to call.  */
-         const struct internalvar_funcs *functions;
-
-         /* The function's user-data.  */
-         void *data;
-        } make_value;
-
-      /* The internal function used with INTERNALVAR_FUNCTION.  */
-      struct
-       {
-         struct internal_function *function;
-         /* True if this is the canonical name for the function.  */
-         int canonical;
-       } fn;
-
-      /* An integer value used with INTERNALVAR_INTEGER.  */
-      struct
-        {
-         /* If type is non-NULL, it will be used as the type to generate
-            a value for this internal variable.  If type is NULL, a default
-            integer type for the architecture is used.  */
-         struct type *type;
-         LONGEST val;
-        } integer;
-
-      /* A string value used with INTERNALVAR_STRING.  */
-      char *string;
-    } u;
+  union internalvar_data u;
 };
 
 static struct internalvar *internalvars;
This page took 0.038766 seconds and 4 git commands to generate.