2 |
7u83 |
1 |
/*
|
|
|
2 |
Crown Copyright (c) 1997
|
|
|
3 |
|
|
|
4 |
This TenDRA(r) Computer Program is subject to Copyright
|
|
|
5 |
owned by the United Kingdom Secretary of State for Defence
|
|
|
6 |
acting through the Defence Evaluation and Research Agency
|
|
|
7 |
(DERA). It is made available to Recipients with a
|
|
|
8 |
royalty-free licence for its use, reproduction, transfer
|
|
|
9 |
to other parties and amendment for any purpose not excluding
|
|
|
10 |
product development provided that any such use et cetera
|
|
|
11 |
shall be deemed to be acceptance of the following conditions:-
|
|
|
12 |
|
|
|
13 |
(1) Its Recipients shall ensure that this Notice is
|
|
|
14 |
reproduced upon any copies or amended versions of it;
|
|
|
15 |
|
|
|
16 |
(2) Any amended version of it shall be clearly marked to
|
|
|
17 |
show both the nature of and the organisation responsible
|
|
|
18 |
for the relevant amendment or amendments;
|
|
|
19 |
|
|
|
20 |
(3) Its onward transfer from a recipient to another
|
|
|
21 |
party shall be deemed to be that party's acceptance of
|
|
|
22 |
these conditions;
|
|
|
23 |
|
|
|
24 |
(4) DERA gives no warranty or assurance as to its
|
|
|
25 |
quality or suitability for any purpose and DERA accepts
|
|
|
26 |
no liability whatsoever in relation to any use to which
|
|
|
27 |
it may be put.
|
|
|
28 |
*/
|
|
|
29 |
|
|
|
30 |
|
|
|
31 |
#ifndef CHKTYPE_INCLUDED
|
|
|
32 |
#define CHKTYPE_INCLUDED
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
/*
|
|
|
36 |
TYPE CHECKING DECLARATIONS
|
|
|
37 |
|
|
|
38 |
The routines in this module are concerned with type checking and type
|
|
|
39 |
consistency.
|
|
|
40 |
*/
|
|
|
41 |
|
|
|
42 |
extern ERROR check_object PROTO_S ( ( TYPE ) ) ;
|
|
|
43 |
extern ERROR check_abstract PROTO_S ( ( TYPE ) ) ;
|
|
|
44 |
extern ERROR check_complete PROTO_S ( ( TYPE ) ) ;
|
|
|
45 |
extern ERROR check_incomplete PROTO_S ( ( TYPE ) ) ;
|
|
|
46 |
extern ERROR check_modifiable PROTO_S ( ( TYPE, EXP ) ) ;
|
|
|
47 |
extern TYPE check_pointer PROTO_S ( ( TYPE, ERROR * ) ) ;
|
|
|
48 |
extern TYPE check_compatible PROTO_S ( ( TYPE, TYPE, int, ERROR *, int ) ) ;
|
|
|
49 |
extern TYPE type_composite PROTO_S ( ( TYPE, TYPE, int, int, ERROR *, int ) ) ;
|
|
|
50 |
extern int is_global_type PROTO_S ( ( TYPE ) ) ;
|
|
|
51 |
extern int unify_type PROTO_S ( ( TYPE, TYPE, CV_SPEC, int ) ) ;
|
|
|
52 |
extern unsigned type_category PROTO_S ( ( TYPE * ) ) ;
|
|
|
53 |
extern unsigned type_tag PROTO_S ( ( TYPE ) ) ;
|
|
|
54 |
|
|
|
55 |
extern int eq_func_type PROTO_S ( ( TYPE, TYPE, int, int ) ) ;
|
|
|
56 |
extern int eq_type_qual PROTO_S ( ( TYPE, TYPE, int ) ) ;
|
|
|
57 |
extern int eq_type_offset PROTO_S ( ( TYPE, TYPE ) ) ;
|
|
|
58 |
extern int eq_itype PROTO_S ( ( INT_TYPE, INT_TYPE ) ) ;
|
|
|
59 |
extern int eq_ftype PROTO_S ( ( FLOAT_TYPE, FLOAT_TYPE ) ) ;
|
|
|
60 |
extern int eq_ctype PROTO_S ( ( CLASS_TYPE, CLASS_TYPE ) ) ;
|
|
|
61 |
extern int eq_etype PROTO_S ( ( ENUM_TYPE, ENUM_TYPE ) ) ;
|
|
|
62 |
extern CV_SPEC cv_compare PROTO_S ( ( TYPE, TYPE ) ) ;
|
|
|
63 |
extern CV_SPEC find_cv_qual PROTO_S ( ( TYPE ) ) ;
|
|
|
64 |
|
|
|
65 |
#define eq_type( A, B ) eq_type_qual ( ( A ), ( B ), 0 )
|
|
|
66 |
#define eq_type_unqual( A, B ) eq_type_qual ( ( A ), ( B ), 1 )
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
/*
|
|
|
70 |
TYPE CATEGORIES
|
|
|
71 |
|
|
|
72 |
These macros are used to describe the various categories of types. The
|
|
|
73 |
class value associated with a type can be found using type_category.
|
|
|
74 |
There are categories for each of the basic kinds of type - integral
|
|
|
75 |
types, pointer types etc. plus a category for lvalues. Other categories
|
|
|
76 |
are unions of existing categories, for example:
|
|
|
77 |
|
|
|
78 |
INT = INTEGER u BITF u ENUM ;
|
|
|
79 |
ARITH = INTEGER u FLOAT u BITF u ENUM ;
|
|
|
80 |
OVERLOAD = CLASS u ENUM ;
|
|
|
81 |
*/
|
|
|
82 |
|
|
|
83 |
#define CTYPE_NONE ( ( unsigned ) 0x0000 )
|
|
|
84 |
#define CTYPE_INTEGER ( ( unsigned ) 0x0001 )
|
|
|
85 |
#define CTYPE_FLOAT ( ( unsigned ) 0x0002 )
|
|
|
86 |
#define CTYPE_PTR ( ( unsigned ) 0x0004 )
|
|
|
87 |
#define CTYPE_PTR_MEM ( ( unsigned ) 0x0008 )
|
|
|
88 |
#define CTYPE_BITF ( ( unsigned ) 0x0010 )
|
|
|
89 |
#define CTYPE_CLASS ( ( unsigned ) 0x0020 )
|
|
|
90 |
#define CTYPE_ENUM ( ( unsigned ) 0x0040 )
|
|
|
91 |
#define CTYPE_VOID ( ( unsigned ) 0x0080 )
|
|
|
92 |
#define CTYPE_ERROR ( ( unsigned ) 0x0100 )
|
|
|
93 |
#define CTYPE_TOKEN ( ( unsigned ) 0x0200 )
|
|
|
94 |
#define CTYPE_TEMPL ( ( unsigned ) 0x0400 )
|
|
|
95 |
#define CTYPE_LVALUE ( ( unsigned ) 0x0800 )
|
|
|
96 |
|
|
|
97 |
#define CTYPE_INT ( ( unsigned ) 0x0051 )
|
|
|
98 |
#define CTYPE_ARITH ( ( unsigned ) 0x0053 )
|
|
|
99 |
#define CTYPE_SCALAR ( ( unsigned ) 0x0057 )
|
|
|
100 |
#define CTYPE_OVERLOAD ( ( unsigned ) 0x0460 )
|
|
|
101 |
#define CTYPE_ADDRESS ( ( unsigned ) 0x082c )
|
|
|
102 |
|
|
|
103 |
#define IS_TYPE_INTEGER( C ) ( ( C ) & CTYPE_INTEGER )
|
|
|
104 |
#define IS_TYPE_FLOAT( C ) ( ( C ) & CTYPE_FLOAT )
|
|
|
105 |
#define IS_TYPE_PTR( C ) ( ( C ) & CTYPE_PTR )
|
|
|
106 |
#define IS_TYPE_PTR_MEM( C ) ( ( C ) & CTYPE_PTR_MEM )
|
|
|
107 |
#define IS_TYPE_BITF( C ) ( ( C ) & CTYPE_BITF )
|
|
|
108 |
#define IS_TYPE_CLASS( C ) ( ( C ) & CTYPE_CLASS )
|
|
|
109 |
#define IS_TYPE_ENUM( C ) ( ( C ) & CTYPE_ENUM )
|
|
|
110 |
#define IS_TYPE_VOID( C ) ( ( C ) & CTYPE_VOID )
|
|
|
111 |
#define IS_TYPE_ERROR( C ) ( ( C ) & CTYPE_ERROR )
|
|
|
112 |
#define IS_TYPE_TOKEN( C ) ( ( C ) & CTYPE_TOKEN )
|
|
|
113 |
#define IS_TYPE_TEMPL( C ) ( ( C ) & CTYPE_TEMPL )
|
|
|
114 |
#define IS_TYPE_LVALUE( C ) ( ( C ) & CTYPE_LVALUE )
|
|
|
115 |
|
|
|
116 |
#define IS_TYPE_INT( C ) ( ( C ) & CTYPE_INT )
|
|
|
117 |
#define IS_TYPE_ARITH( C ) ( ( C ) & CTYPE_ARITH )
|
|
|
118 |
#define IS_TYPE_SCALAR( C ) ( ( C ) & CTYPE_SCALAR )
|
|
|
119 |
#define IS_TYPE_OVERLOAD( C ) ( ( C ) & CTYPE_OVERLOAD )
|
|
|
120 |
#define IS_TYPE_ADDRESS( C ) ( ( C ) & CTYPE_ADDRESS )
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
#endif
|