Mon Nov 9 18:22:55 1998 Dave Brolley <brolley@cygnus.com>
[deliverable/binutils-gdb.git] / gdb / gdbtypes.c
index 7027cc9f22ed966c621e4980d68dc79d56bc054c..6601d9dcdf4ee9a954968607f44aeb8cf070acb6 100644 (file)
@@ -1,5 +1,5 @@
 /* Support routines for manipulating internal types for GDB.
-   Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+   Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc.
    Contributed by Cygnus Support, using pieces from other GDB modules.
 
 This file is part of GDB.
@@ -78,6 +78,8 @@ static void print_arg_types PARAMS ((struct type **, int));
 static void dump_fn_fieldlists PARAMS ((struct type *, int));
 static void print_cplus_stuff PARAMS ((struct type *, int));
 
+void _initialize_gdbtypes PARAMS ((void));
+
 /* Alloc a new type structure and fill it with some defaults.  If
    OBJFILE is non-NULL, then allocate the space for the type structure
    in that objfile's type_obstack. */
@@ -127,13 +129,15 @@ make_pointer_type (type, typeptr)
   ntype = TYPE_POINTER_TYPE (type);
 
   if (ntype) 
-    if (typeptr == 0)          
-      return ntype;    /* Don't care about alloc, and have new type.  */
-    else if (*typeptr == 0)
-      {
-       *typeptr = ntype;       /* Tracking alloc, and we have new type.  */
-       return ntype;
-      }
+    {
+      if (typeptr == 0)                
+        return ntype;  /* Don't care about alloc, and have new type.  */
+      else if (*typeptr == 0)
+        {
+         *typeptr = ntype;     /* Tracking alloc, and we have new type.  */
+         return ntype;
+        }
+    }
 
   if (typeptr == 0 || *typeptr == 0)   /* We'll need to allocate one.  */
     {
@@ -192,13 +196,15 @@ make_reference_type (type, typeptr)
   ntype = TYPE_REFERENCE_TYPE (type);
 
   if (ntype) 
-    if (typeptr == 0)          
-      return ntype;    /* Don't care about alloc, and have new type.  */
-    else if (*typeptr == 0)
-      {
-       *typeptr = ntype;       /* Tracking alloc, and we have new type.  */
-       return ntype;
-      }
+    {
+      if (typeptr == 0)                
+        return ntype;  /* Don't care about alloc, and have new type.  */
+      else if (*typeptr == 0)
+        {
+         *typeptr = ntype;     /* Tracking alloc, and we have new type.  */
+         return ntype;
+        }
+    }
 
   if (typeptr == 0 || *typeptr == 0)   /* We'll need to allocate one.  */
     {
@@ -395,6 +401,12 @@ get_discrete_bounds (type, lowp, highp)
              if (TYPE_FIELD_BITPOS (type, i) > *highp)
                *highp = TYPE_FIELD_BITPOS (type, i);
            }
+
+         /* Set unsigned indicator if warranted. */
+         if(*lowp >= 0)
+           {
+             TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED;
+           }
        }
       else
        {
@@ -519,6 +531,10 @@ create_set_type (result_type, domain_type)
        = (bit_length + TARGET_CHAR_BIT - 1) / TARGET_CHAR_BIT;
     }
   TYPE_FIELD_TYPE (result_type, 0) = domain_type;
+
+  if(low_bound >= 0)
+    TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED;
+
   return (result_type);
 }
 
This page took 0.024038 seconds and 4 git commands to generate.