14
14
//
15
15
16
16
// first parameter has interop type annotation
17
- extern void f1 (int * p : type (ptr < int > ), int y ) {
17
+ extern void f1 (int * p : itype (ptr < int > ), int y ) {
18
18
* p = y ;
19
19
}
20
20
21
- extern void f2 (int * p : type (array_ptr < int > ), int y ) {
21
+ extern void f2 (int * p : itype (array_ptr < int > ), int y ) {
22
22
}
23
23
24
- extern void f3 (int * * p : type (ptr < ptr < int >>), int y ) {
24
+ extern void f3 (int * * p : itype (ptr < ptr < int >>), int y ) {
25
25
* * p = y ;
26
26
}
27
27
28
- extern void f4 (int * * p : type (array_ptr < ptr < int >>), int y ) {
28
+ extern void f4 (int * * p : itype (array_ptr < ptr < int >>), int y ) {
29
29
}
30
30
31
31
// Second parameter has interop type annotation
32
- extern void g1 (int y , int * p : type (ptr < int > )) {
32
+ extern void g1 (int y , int * p : itype (ptr < int > )) {
33
33
* p = y ;
34
34
}
35
35
36
- extern void g2 (int y , int * p : type (array_ptr < int > )) {
36
+ extern void g2 (int y , int * p : itype (array_ptr < int > )) {
37
37
}
38
38
39
- extern void g3 (int y , int * * p : type (ptr < ptr < int >>)) {
39
+ extern void g3 (int y , int * * p : itype (ptr < ptr < int >>)) {
40
40
y = * * p ;
41
41
}
42
42
43
- extern void g4 (int y , int * * p : type (ptr < array_ptr < int >>)) {
43
+ extern void g4 (int y , int * * p : itype (ptr < array_ptr < int >>)) {
44
44
}
45
45
46
- extern void g5 (int y , int * * p : type (array_ptr < ptr < int >>)) {
46
+ extern void g5 (int y , int * * p : itype (array_ptr < ptr < int >>)) {
47
47
}
48
48
49
49
//
50
50
// returns an unchecked pointer type with an
51
51
// interop type annotation.
52
52
//
53
53
54
- extern int * h1 (int y , ptr < int > p ) : type (ptr < int > ) {
54
+ extern int * h1 (int y , ptr < int > p ) : itype (ptr < int > ) {
55
55
* p = y ;
56
56
return 0 ;
57
57
}
58
58
59
- extern int * h2 (int y , const ptr < int > p ) : type (array_ptr < int > ) {
59
+ extern int * h2 (int y , const ptr < int > p ) : itype (array_ptr < int > ) {
60
60
return 0 ;
61
61
}
62
62
63
- extern int * * h3 () : type (ptr < ptr < int >>) {
63
+ extern int * * h3 () : itype (ptr < ptr < int >>) {
64
64
return 0 ;
65
65
}
66
66
67
- extern int * * h4 () : type (array_ptr < ptr < int >>) {
67
+ extern int * * h4 () : itype (array_ptr < ptr < int >>) {
68
68
return 0 ;
69
69
}
70
70
71
71
//
72
72
// Global variables with interop type annotations
73
73
//
74
74
75
- int * a1 : type (ptr < int > ) = 0 ;
76
- int * a2 : type (array_ptr < int > ) = 0 ;
77
- int * * a3 : type (ptr < ptr < int >>) = 0 ;
78
- int * * a4 : type (ptr < array_ptr < int >>) = 0 ;
79
- int * * a5 : type (array_ptr < ptr < int >>) = 0 ;
80
- int * * a6 : type (array_ptr < array_ptr < int >>) = 0 ;
81
- int * * * a7 : type (ptr < ptr < ptr < int >>> ) = 0 ;
75
+ int * a1 : itype (ptr < int > ) = 0 ;
76
+ int * a2 : itype (array_ptr < int > ) = 0 ;
77
+ int * * a3 : itype (ptr < ptr < int >>) = 0 ;
78
+ int * * a4 : itype (ptr < array_ptr < int >>) = 0 ;
79
+ int * * a5 : itype (array_ptr < ptr < int >>) = 0 ;
80
+ int * * a6 : itype (array_ptr < array_ptr < int >>) = 0 ;
81
+ int * * * a7 : itype (ptr < ptr < ptr < int >>> ) = 0 ;
82
82
83
83
//
84
84
// Structure members with interop pointer type annotations
85
85
//
86
86
87
87
struct S1 {
88
- float * data1 : type (ptr < float > );
89
- float * data2 : type (array_ptr < float > );
90
- float * * data3 : type (ptr < ptr < float >>);
91
- float * * data4 : type (ptr < array_ptr < float >>);
92
- float * * data5 : type (array_ptr < ptr < float >>);
93
- float * * * data6 : type (ptr < ptr < ptr < float >>> );
88
+ float * data1 : itype (ptr < float > );
89
+ float * data2 : itype (array_ptr < float > );
90
+ float * * data3 : itype (ptr < ptr < float >>);
91
+ float * * data4 : itype (ptr < array_ptr < float >>);
92
+ float * * data5 : itype (array_ptr < ptr < float >>);
93
+ float * * * data6 : itype (ptr < ptr < ptr < float >>> );
94
94
};
95
95
96
96
///
97
97
/// The interop type can have modifiers
98
98
///
99
- extern void f10 (const int * const x : type (const ptr < const int > )) {
99
+ extern void f10 (const int * const x : itype (const ptr < const int > )) {
100
100
}
101
101
102
- extern void f11 (const int * x : type (ptr < const int > )) {
102
+ extern void f11 (const int * x : itype (ptr < const int > )) {
103
103
}
104
104
105
- extern const int * f12 () : type (ptr < const int > ) {
105
+ extern const int * f12 () : itype (ptr < const int > ) {
106
106
return 0 ;
107
107
}
108
108
109
- const int * a10 : type (ptr < const int > ) = 0 ;
110
- int * const a11 : type (const ptr < int > ) = 0 ;
109
+ const int * a10 : itype (ptr < const int > ) = 0 ;
110
+ int * const a11 : itype (const ptr < int > ) = 0 ;
111
111
112
112
///
113
113
/// Typedef'ed names can be used as interop types
@@ -116,8 +116,8 @@ int *const a11 : type(const ptr<int>) = 0;
116
116
typedef ptr < int > pint ;
117
117
typedef ptr < const int > pcint ;
118
118
119
- extern void f20 (int * x : type (pint )) {
119
+ extern void f20 (int * x : itype (pint )) {
120
120
}
121
121
122
- extern void f21 (const int * x : type (pcint )) {
122
+ extern void f21 (const int * x : itype (pcint )) {
123
123
}
0 commit comments