2 /* Compiler implementation of the D programming language
3 * Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved
4 * written by Walter Bright
5 * http://www.digitalmars.com
6 * Distributed under the Boost Software License, Version 1.0.
7 * http://www.boost.org/LICENSE_1_0.txt
8 * https://github.com/D-Programming-Language/dmd/blob/master/src/impcnvgen.c
11 #include "root/dsystem.h"
15 TY impcnvResultTab
[TMAX
][TMAX
];
16 TY impcnvType1Tab
[TMAX
][TMAX
];
17 TY impcnvType2Tab
[TMAX
][TMAX
];
18 int impcnvWarnTab
[TMAX
][TMAX
];
20 int integral_promotion(int t
)
30 case Tuns16
: return Tint32
;
31 case Tdchar
: return Tuns32
;
39 // Set conversion tables
40 for (i
= 0; i
< TMAX
; i
++)
41 for (j
= 0; j
< TMAX
; j
++)
42 { impcnvResultTab
[i
][j
] = Terror
;
43 impcnvType1Tab
[i
][j
] = Terror
;
44 impcnvType2Tab
[i
][j
] = Terror
;
45 impcnvWarnTab
[i
][j
] = 0;
48 #define X(t1,t2, nt1,nt2, rt) \
49 impcnvResultTab[t1][t2] = rt; \
50 impcnvType1Tab[t1][t2] = nt1; \
51 impcnvType2Tab[t1][t2] = nt2;
54 /* ======================= */
56 X(Tbool
,Tbool
, Tbool
,Tbool
, Tbool
)
57 X(Tbool
,Tint8
, Tint32
,Tint32
, Tint32
)
58 X(Tbool
,Tuns8
, Tint32
,Tint32
, Tint32
)
59 X(Tbool
,Tint16
, Tint32
,Tint32
, Tint32
)
60 X(Tbool
,Tuns16
, Tint32
,Tint32
, Tint32
)
61 X(Tbool
,Tint32
, Tint32
,Tint32
, Tint32
)
62 X(Tbool
,Tuns32
, Tuns32
,Tuns32
, Tuns32
)
63 X(Tbool
,Tint64
, Tint64
,Tint64
, Tint64
)
64 X(Tbool
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
65 X(Tbool
,Tint128
, Tint128
,Tint128
, Tint128
)
66 X(Tbool
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
68 X(Tbool
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
69 X(Tbool
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
70 X(Tbool
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
71 X(Tbool
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
72 X(Tbool
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
73 X(Tbool
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
74 X(Tbool
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
75 X(Tbool
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
76 X(Tbool
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
78 /* ======================= */
80 X(Tint8
,Tint8
, Tint32
,Tint32
, Tint32
)
81 X(Tint8
,Tuns8
, Tint32
,Tint32
, Tint32
)
82 X(Tint8
,Tint16
, Tint32
,Tint32
, Tint32
)
83 X(Tint8
,Tuns16
, Tint32
,Tint32
, Tint32
)
84 X(Tint8
,Tint32
, Tint32
,Tint32
, Tint32
)
85 X(Tint8
,Tuns32
, Tuns32
,Tuns32
, Tuns32
)
86 X(Tint8
,Tint64
, Tint64
,Tint64
, Tint64
)
87 X(Tint8
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
88 X(Tint8
,Tint128
, Tint128
,Tint128
, Tint128
)
89 X(Tint8
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
91 X(Tint8
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
92 X(Tint8
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
93 X(Tint8
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
94 X(Tint8
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
95 X(Tint8
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
96 X(Tint8
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
97 X(Tint8
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
98 X(Tint8
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
99 X(Tint8
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
101 /* ======================= */
103 X(Tuns8
,Tuns8
, Tint32
,Tint32
, Tint32
)
104 X(Tuns8
,Tint16
, Tint32
,Tint32
, Tint32
)
105 X(Tuns8
,Tuns16
, Tint32
,Tint32
, Tint32
)
106 X(Tuns8
,Tint32
, Tint32
,Tint32
, Tint32
)
107 X(Tuns8
,Tuns32
, Tuns32
,Tuns32
, Tuns32
)
108 X(Tuns8
,Tint64
, Tint64
,Tint64
, Tint64
)
109 X(Tuns8
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
110 X(Tuns8
,Tint128
, Tint128
,Tint128
, Tint128
)
111 X(Tuns8
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
113 X(Tuns8
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
114 X(Tuns8
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
115 X(Tuns8
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
116 X(Tuns8
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
117 X(Tuns8
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
118 X(Tuns8
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
119 X(Tuns8
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
120 X(Tuns8
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
121 X(Tuns8
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
123 /* ======================= */
125 X(Tint16
,Tint16
, Tint32
,Tint32
, Tint32
)
126 X(Tint16
,Tuns16
, Tint32
,Tint32
, Tint32
)
127 X(Tint16
,Tint32
, Tint32
,Tint32
, Tint32
)
128 X(Tint16
,Tuns32
, Tuns32
,Tuns32
, Tuns32
)
129 X(Tint16
,Tint64
, Tint64
,Tint64
, Tint64
)
130 X(Tint16
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
131 X(Tint16
,Tint128
, Tint128
,Tint128
, Tint128
)
132 X(Tint16
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
134 X(Tint16
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
135 X(Tint16
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
136 X(Tint16
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
137 X(Tint16
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
138 X(Tint16
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
139 X(Tint16
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
140 X(Tint16
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
141 X(Tint16
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
142 X(Tint16
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
144 /* ======================= */
146 X(Tuns16
,Tuns16
, Tint32
,Tint32
, Tint32
)
147 X(Tuns16
,Tint32
, Tint32
,Tint32
, Tint32
)
148 X(Tuns16
,Tuns32
, Tuns32
,Tuns32
, Tuns32
)
149 X(Tuns16
,Tint64
, Tint64
,Tint64
, Tint64
)
150 X(Tuns16
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
151 X(Tuns16
,Tint128
, Tint128
,Tint128
, Tint128
)
152 X(Tuns16
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
154 X(Tuns16
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
155 X(Tuns16
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
156 X(Tuns16
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
157 X(Tuns16
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
158 X(Tuns16
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
159 X(Tuns16
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
160 X(Tuns16
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
161 X(Tuns16
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
162 X(Tuns16
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
164 /* ======================= */
166 X(Tint32
,Tint32
, Tint32
,Tint32
, Tint32
)
167 X(Tint32
,Tuns32
, Tuns32
,Tuns32
, Tuns32
)
168 X(Tint32
,Tint64
, Tint64
,Tint64
, Tint64
)
169 X(Tint32
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
170 X(Tint32
,Tint128
, Tint128
,Tint128
, Tint128
)
171 X(Tint32
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
173 X(Tint32
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
174 X(Tint32
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
175 X(Tint32
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
176 X(Tint32
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
177 X(Tint32
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
178 X(Tint32
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
179 X(Tint32
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
180 X(Tint32
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
181 X(Tint32
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
183 /* ======================= */
185 X(Tuns32
,Tuns32
, Tuns32
,Tuns32
, Tuns32
)
186 X(Tuns32
,Tint64
, Tint64
,Tint64
, Tint64
)
187 X(Tuns32
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
188 X(Tuns32
,Tint128
, Tint128
,Tint128
, Tint128
)
189 X(Tuns32
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
191 X(Tuns32
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
192 X(Tuns32
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
193 X(Tuns32
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
194 X(Tuns32
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
195 X(Tuns32
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
196 X(Tuns32
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
197 X(Tuns32
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
198 X(Tuns32
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
199 X(Tuns32
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
201 /* ======================= */
203 X(Tint64
,Tint64
, Tint64
,Tint64
, Tint64
)
204 X(Tint64
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
205 X(Tint64
,Tint128
, Tint128
,Tint128
, Tint128
)
206 X(Tint64
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
208 X(Tint64
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
209 X(Tint64
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
210 X(Tint64
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
211 X(Tint64
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
212 X(Tint64
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
213 X(Tint64
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
214 X(Tint64
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
215 X(Tint64
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
216 X(Tint64
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
218 /* ======================= */
220 X(Tuns64
,Tuns64
, Tuns64
,Tuns64
, Tuns64
)
221 X(Tuns64
,Tint128
, Tint128
,Tint128
, Tint128
)
222 X(Tuns64
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
224 X(Tuns64
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
225 X(Tuns64
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
226 X(Tuns64
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
227 X(Tuns64
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
228 X(Tuns64
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
229 X(Tuns64
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
230 X(Tuns64
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
231 X(Tuns64
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
232 X(Tuns64
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
234 /* ======================= */
236 X(Tint128
,Tint128
, Tint128
,Tint128
, Tint128
)
237 X(Tint128
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
239 X(Tint128
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
240 X(Tint128
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
241 X(Tint128
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
242 X(Tint128
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
243 X(Tint128
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
244 X(Tint128
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
245 X(Tint128
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
246 X(Tint128
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
247 X(Tint128
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
249 /* ======================= */
251 X(Tuns128
,Tuns128
, Tuns128
,Tuns128
, Tuns128
)
253 X(Tuns128
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
254 X(Tuns128
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
255 X(Tuns128
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
256 X(Tuns128
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
257 X(Tuns128
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
258 X(Tuns128
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
259 X(Tuns128
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
260 X(Tuns128
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
261 X(Tuns128
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
263 /* ======================= */
265 X(Tfloat32
,Tfloat32
, Tfloat32
,Tfloat32
, Tfloat32
)
266 X(Tfloat32
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
267 X(Tfloat32
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
269 X(Tfloat32
,Timaginary32
, Tfloat32
,Timaginary32
, Tfloat32
)
270 X(Tfloat32
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
271 X(Tfloat32
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
273 X(Tfloat32
,Tcomplex32
, Tfloat32
,Tcomplex32
, Tcomplex32
)
274 X(Tfloat32
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
275 X(Tfloat32
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
277 /* ======================= */
279 X(Tfloat64
,Tfloat64
, Tfloat64
,Tfloat64
, Tfloat64
)
280 X(Tfloat64
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
282 X(Tfloat64
,Timaginary32
, Tfloat64
,Timaginary64
, Tfloat64
)
283 X(Tfloat64
,Timaginary64
, Tfloat64
,Timaginary64
, Tfloat64
)
284 X(Tfloat64
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
286 X(Tfloat64
,Tcomplex32
, Tfloat64
,Tcomplex64
, Tcomplex64
)
287 X(Tfloat64
,Tcomplex64
, Tfloat64
,Tcomplex64
, Tcomplex64
)
288 X(Tfloat64
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
290 /* ======================= */
292 X(Tfloat80
,Tfloat80
, Tfloat80
,Tfloat80
, Tfloat80
)
294 X(Tfloat80
,Timaginary32
, Tfloat80
,Timaginary80
, Tfloat80
)
295 X(Tfloat80
,Timaginary64
, Tfloat80
,Timaginary80
, Tfloat80
)
296 X(Tfloat80
,Timaginary80
, Tfloat80
,Timaginary80
, Tfloat80
)
298 X(Tfloat80
,Tcomplex32
, Tfloat80
,Tcomplex80
, Tcomplex80
)
299 X(Tfloat80
,Tcomplex64
, Tfloat80
,Tcomplex80
, Tcomplex80
)
300 X(Tfloat80
,Tcomplex80
, Tfloat80
,Tcomplex80
, Tcomplex80
)
302 /* ======================= */
304 X(Timaginary32
,Timaginary32
, Timaginary32
,Timaginary32
, Timaginary32
)
305 X(Timaginary32
,Timaginary64
, Timaginary64
,Timaginary64
, Timaginary64
)
306 X(Timaginary32
,Timaginary80
, Timaginary80
,Timaginary80
, Timaginary80
)
308 X(Timaginary32
,Tcomplex32
, Timaginary32
,Tcomplex32
, Tcomplex32
)
309 X(Timaginary32
,Tcomplex64
, Timaginary64
,Tcomplex64
, Tcomplex64
)
310 X(Timaginary32
,Tcomplex80
, Timaginary80
,Tcomplex80
, Tcomplex80
)
312 /* ======================= */
314 X(Timaginary64
,Timaginary64
, Timaginary64
,Timaginary64
, Timaginary64
)
315 X(Timaginary64
,Timaginary80
, Timaginary80
,Timaginary80
, Timaginary80
)
317 X(Timaginary64
,Tcomplex32
, Timaginary64
,Tcomplex64
, Tcomplex64
)
318 X(Timaginary64
,Tcomplex64
, Timaginary64
,Tcomplex64
, Tcomplex64
)
319 X(Timaginary64
,Tcomplex80
, Timaginary80
,Tcomplex80
, Tcomplex80
)
321 /* ======================= */
323 X(Timaginary80
,Timaginary80
, Timaginary80
,Timaginary80
, Timaginary80
)
325 X(Timaginary80
,Tcomplex32
, Timaginary80
,Tcomplex80
, Tcomplex80
)
326 X(Timaginary80
,Tcomplex64
, Timaginary80
,Tcomplex80
, Tcomplex80
)
327 X(Timaginary80
,Tcomplex80
, Timaginary80
,Tcomplex80
, Tcomplex80
)
329 /* ======================= */
331 X(Tcomplex32
,Tcomplex32
, Tcomplex32
,Tcomplex32
, Tcomplex32
)
332 X(Tcomplex32
,Tcomplex64
, Tcomplex64
,Tcomplex64
, Tcomplex64
)
333 X(Tcomplex32
,Tcomplex80
, Tcomplex80
,Tcomplex80
, Tcomplex80
)
335 /* ======================= */
337 X(Tcomplex64
,Tcomplex64
, Tcomplex64
,Tcomplex64
, Tcomplex64
)
338 X(Tcomplex64
,Tcomplex80
, Tcomplex80
,Tcomplex80
, Tcomplex80
)
340 /* ======================= */
342 X(Tcomplex80
,Tcomplex80
, Tcomplex80
,Tcomplex80
, Tcomplex80
)
346 #define Y(t1,t2) impcnvWarnTab[t1][t2] = 1;
426 // Y(Tint128, Tuns128)
427 // Y(Tuns128, Tint128)
429 for (i
= 0; i
< TMAX
; i
++)
430 for (j
= 0; j
< TMAX
; j
++)
432 if (impcnvResultTab
[i
][j
] == Terror
)
434 impcnvResultTab
[i
][j
] = impcnvResultTab
[j
][i
];
435 impcnvType1Tab
[i
][j
] = impcnvType2Tab
[j
][i
];
436 impcnvType2Tab
[i
][j
] = impcnvType1Tab
[j
][i
];
449 FILE *fp
= fopen("impcnvtab.c","wb");
451 fprintf(fp
,"// This file is generated by impcnvgen.c\n");
452 fprintf(fp
,"#include \"mtype.h\"\n");
454 fprintf(fp
,"unsigned char impcnvResult[TMAX][TMAX] =\n{\n");
455 for (i
= 0; i
< TMAX
; i
++)
460 for (j
= 0; j
< TMAX
; j
++)
464 fprintf(fp
, "%d",impcnvResultTab
[i
][j
]);
470 fprintf(fp
,"unsigned char impcnvType1[TMAX][TMAX] =\n{\n");
471 for (i
= 0; i
< TMAX
; i
++)
476 for (j
= 0; j
< TMAX
; j
++)
480 fprintf(fp
, "%d",impcnvType1Tab
[i
][j
]);
486 fprintf(fp
,"unsigned char impcnvType2[TMAX][TMAX] =\n{\n");
487 for (i
= 0; i
< TMAX
; i
++)
492 for (j
= 0; j
< TMAX
; j
++)
496 fprintf(fp
, "%d",impcnvType2Tab
[i
][j
]);
502 fprintf(fp
,"unsigned char impcnvWarn[TMAX][TMAX] =\n{\n");
503 for (i
= 0; i
< TMAX
; i
++)
508 for (j
= 0; j
< TMAX
; j
++)
512 fprintf(fp
, "%d",impcnvWarnTab
[i
][j
]);
522 FILE *fp
= fopen("impcnvtab.d", "wb");
524 fprintf(fp
, "// This file is generated by impcnvgen.c\n");
525 fprintf(fp
, "module ddmd.impcnvtab;\n");
527 fprintf(fp
, "import ddmd.mtype;\n");
530 fprintf(fp
, "extern (C++) __gshared ubyte[TMAX][TMAX] impcnvResult =\n[\n");
531 for (i
= 0; i
< TMAX
; i
++)
536 for (j
= 0; j
< TMAX
; j
++)
540 fprintf(fp
, "%d", impcnvResultTab
[i
][j
]);
544 fprintf(fp
, "\n];\n");
546 fprintf(fp
, "extern (C++) __gshared ubyte[TMAX][TMAX] impcnvType1 =\n[\n");
547 for (i
= 0; i
< TMAX
; i
++)
552 for (j
= 0; j
< TMAX
; j
++)
556 fprintf(fp
, "%d", impcnvType1Tab
[i
][j
]);
560 fprintf(fp
, "\n];\n");
562 fprintf(fp
, "extern (C++) __gshared ubyte[TMAX][TMAX] impcnvType2 =\n[\n");
563 for (i
= 0; i
< TMAX
; i
++)
568 for (j
= 0; j
< TMAX
; j
++)
572 fprintf(fp
, "%d",impcnvType2Tab
[i
][j
]);
576 fprintf(fp
,"\n];\n");
578 fprintf(fp
,"extern (C++) __gshared ubyte[TMAX][TMAX] impcnvWarn =\n[\n");
579 for (i
= 0; i
< TMAX
; i
++)
584 for (j
= 0; j
< TMAX
; j
++)
588 fprintf(fp
, "%d", impcnvWarnTab
[i
][j
]);
592 fprintf(fp
, "\n];\n");