Lint fixes from Paul Eggert (eggert@twinsun.com):
[deliverable/binutils-gdb.git] / gdb / gdbtypes.h
index 9c7bf1174dba7477783d7a89aa94b6223b7a6730..da4fdffc4000bae145a78b84676174ac59dfb5a1 100644 (file)
@@ -56,13 +56,22 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #define FT_NUM_MEMBERS         28      /* Highest FT_* above, plus one. */
 
+/* Some macros for char-based bitfields.  */
+
+#define B_SET(a,x)     ((a)[(x)>>3] |= (1 << ((x)&7)))
+#define B_CLR(a,x)     ((a)[(x)>>3] &= ~(1 << ((x)&7)))
+#define B_TST(a,x)     ((a)[(x)>>3] & (1 << ((x)&7)))
+#define B_TYPE         unsigned char
+#define        B_BYTES(x)      ( 1 + ((x)>>3) )
+#define        B_CLRALL(a,x)   memset ((a), 0, B_BYTES(x))
+
 /* Different kinds of data types are distinguished by the `code' field.  */
 
 enum type_code
 {
   TYPE_CODE_UNDEF,             /* Not used; catches errors */
   TYPE_CODE_PTR,               /* Pointer type */
-  TYPE_CODE_ARRAY,             /* Array type, lower bound zero */
+  TYPE_CODE_ARRAY,             /* Array type with lower & upper bounds. */
   TYPE_CODE_STRUCT,            /* C struct or Pascal record */
   TYPE_CODE_UNION,             /* C union or Pascal variant part */
   TYPE_CODE_ENUM,              /* Enumeration type */
@@ -72,7 +81,8 @@ enum type_code
   TYPE_CODE_VOID,              /* Void type (values zero length) */
   TYPE_CODE_SET,               /* Pascal sets */
   TYPE_CODE_RANGE,             /* Range (integers within spec'd bounds) */
-  TYPE_CODE_PASCAL_ARRAY,      /* Array with explicit type of index */
+  TYPE_CODE_STRING,            /* String types, distinct from array of char */
+  TYPE_CODE_BITSTRING,         /* String of bits, distinct from bool array */
   TYPE_CODE_ERROR,              /* Unknown type */
 
   /* C++ */
@@ -195,6 +205,7 @@ struct type
         containing structure.  For a function type, this is the
         position in the argument list of this argument.
         For a range bound or enum value, this is the value itself.
+        (FIXME:  What about ranges larger than host int size?)
         For BITS_BIG_ENDIAN=1 targets, it is the bit offset to the MSB.
         For BITS_BIG_ENDIAN=0 targets, it is the bit offset to the LSB. */
 
@@ -474,6 +485,7 @@ extern struct type *builtin_type_double;
 extern struct type *builtin_type_long_double;
 extern struct type *builtin_type_complex;
 extern struct type *builtin_type_double_complex;
+extern struct type *builtin_type_string;
 
 /* This type represents a type that was unrecognized in symbol
    read-in.  */
@@ -491,7 +503,7 @@ extern struct type *builtin_type_m2_card;
 extern struct type *builtin_type_m2_real;
 extern struct type *builtin_type_m2_bool;
 
-/* start-sanitize-chill
+/* start-sanitize-chill */
 /* Chill types */
 
 extern struct type *builtin_type_chill_bool;
@@ -499,7 +511,7 @@ extern struct type *builtin_type_chill_char;
 extern struct type *builtin_type_chill_long;
 extern struct type *builtin_type_chill_ulong;
 extern struct type *builtin_type_chill_real;
-/* end-sanitize-chill
+/* end-sanitize-chill */
 
 /* LONG_LONG is defined if the host has "long long".  */
 
@@ -583,7 +595,13 @@ extern struct type *
 lookup_function_type PARAMS ((struct type *));
 
 extern struct type *
-create_array_type PARAMS ((struct type *, int));
+create_range_type PARAMS ((struct type *, struct type *, int, int));
+
+extern struct type *
+create_array_type PARAMS ((struct type *, struct type *, struct type *));
+
+extern struct type *
+create_string_type PARAMS ((struct type *, struct type *));
 
 extern struct type *
 lookup_unsigned_typename PARAMS ((char *));
This page took 0.02493 seconds and 4 git commands to generate.