on master help sign in
Namespace the ClosureType enums.

Some had generic names like INT and FLOAT that caused collisions.

commit23df314702418be7bbe71943c2dbace491874130 authorNiklas Larsson <niklas@mm.st> dateThu 17 Mar 2016, 19:34 (11 years ago) parent06914a6
6 files changed+181−181
rts/idris_bitstring.c+86−86 rts/idris_gc.c+18−18 rts/idris_gmp.c+18−18 rts/idris_heap.c+4−4 rts/idris_rts.c+46−46 rts/idris_rts.h+9−9
rts/idris_bitstring.c+86−86
@@ -5,7 +5,7 @@
55VAL idris_b8CopyForGC(VM *vm, VAL a) {
66 uint8_t A = a->info.bits8;
77 VAL cl = allocate(sizeof(Closure), 1);
8− SETTY(cl, BITS8);
8+ SETTY(cl, CT_BITS8);
99 cl->info.bits8 = A;
1010 return cl;
1111}
@@ -13,7 +13,7 @@ VAL idris_b8CopyForGC(VM *vm, VAL a) {
1313VAL idris_b16CopyForGC(VM *vm, VAL a) {
1414 uint16_t A = a->info.bits16;
1515 VAL cl = allocate(sizeof(Closure), 1);
16− SETTY(cl, BITS16);
16+ SETTY(cl, CT_BITS16);
1717 cl->info.bits16 = A;
1818 return cl;
1919}
@@ -21,7 +21,7 @@ VAL idris_b16CopyForGC(VM *vm, VAL a) {
2121VAL idris_b32CopyForGC(VM *vm, VAL a) {
2222 uint32_t A = a->info.bits32;
2323 VAL cl = allocate(sizeof(Closure), 1);
24− SETTY(cl, BITS32);
24+ SETTY(cl, CT_BITS32);
2525 cl->info.bits32 = A;
2626 return cl;
2727}
@@ -29,7 +29,7 @@ VAL idris_b32CopyForGC(VM *vm, VAL a) {
2929VAL idris_b64CopyForGC(VM *vm, VAL a) {
3030 uint64_t A = a->info.bits64;
3131 VAL cl = allocate(sizeof(Closure), 1);
32− SETTY(cl, BITS64);
32+ SETTY(cl, CT_BITS64);
3333 cl->info.bits64 = A;
3434 return cl;
3535}
@@ -37,7 +37,7 @@ VAL idris_b64CopyForGC(VM *vm, VAL a) {
3737VAL idris_b8(VM *vm, VAL a) {
3838 uint8_t A = GETINT(a);
3939 VAL cl = allocate(sizeof(Closure), 0);
40− SETTY(cl, BITS8);
40+ SETTY(cl, CT_BITS8);
4141 cl->info.bits8 = (uint8_t) A;
4242 return cl;
4343}
@@ -45,7 +45,7 @@ VAL idris_b8(VM *vm, VAL a) {
4545VAL idris_b16(VM *vm, VAL a) {
4646 uint16_t A = GETINT(a);
4747 VAL cl = allocate(sizeof(Closure), 0);
48− SETTY(cl, BITS16);
48+ SETTY(cl, CT_BITS16);
4949 cl->info.bits16 = (uint16_t) A;
5050 return cl;
5151}
@@ -53,7 +53,7 @@ VAL idris_b16(VM *vm, VAL a) {
5353VAL idris_b32(VM *vm, VAL a) {
5454 uint32_t A = GETINT(a);
5555 VAL cl = allocate(sizeof(Closure), 0);
56− SETTY(cl, BITS32);
56+ SETTY(cl, CT_BITS32);
5757 cl->info.bits32 = (uint32_t) A;
5858 return cl;
5959}
@@ -61,7 +61,7 @@ VAL idris_b32(VM *vm, VAL a) {
6161VAL idris_b64(VM *vm, VAL a) {
6262 uint64_t A = GETINT(a);
6363 VAL cl = allocate(sizeof(Closure), 0);
64− SETTY(cl, BITS64);
64+ SETTY(cl, CT_BITS64);
6565 cl->info.bits64 = (uint64_t) A;
6666 return cl;
6767}
@@ -72,28 +72,28 @@ VAL idris_castB32Int(VM *vm, VAL a) {
7272
7373VAL idris_b8const(VM *vm, uint8_t a) {
7474 VAL cl = allocate(sizeof(Closure), 0);
75− SETTY(cl, BITS8);
75+ SETTY(cl, CT_BITS8);
7676 cl->info.bits8 = a;
7777 return cl;
7878}
7979
8080VAL idris_b16const(VM *vm, uint16_t a) {
8181 VAL cl = allocate(sizeof(Closure), 0);
82− SETTY(cl, BITS16);
82+ SETTY(cl, CT_BITS16);
8383 cl->info.bits16 = a;
8484 return cl;
8585}
8686
8787VAL idris_b32const(VM *vm, uint32_t a) {
8888 VAL cl = allocate(sizeof(Closure), 0);
89− SETTY(cl, BITS32);
89+ SETTY(cl, CT_BITS32);
9090 cl->info.bits32 = a;
9191 return cl;
9292}
9393
9494VAL idris_b64const(VM *vm, uint64_t a) {
9595 VAL cl = allocate(sizeof(Closure), 0);
96− SETTY(cl, BITS64);
96+ SETTY(cl, CT_BITS64);
9797 cl->info.bits64 = a;
9898 return cl;
9999}
@@ -102,7 +102,7 @@ VAL idris_b8Plus(VM *vm, VAL a, VAL b) {
102102 uint8_t A = a->info.bits8;
103103 uint8_t B = b->info.bits8;
104104 VAL cl = allocate(sizeof(Closure), 0);
105− SETTY(cl, BITS8);
105+ SETTY(cl, CT_BITS8);
106106 cl->info.bits8 = A + B;
107107 return cl;
108108}
@@ -111,7 +111,7 @@ VAL idris_b8Minus(VM *vm, VAL a, VAL b) {
111111 uint8_t A = a->info.bits8;
112112 uint8_t B = b->info.bits8;
113113 VAL cl = allocate(sizeof(Closure), 0);
114− SETTY(cl, BITS8);
114+ SETTY(cl, CT_BITS8);
115115 cl->info.bits8 = A - B;
116116 return cl;
117117}
@@ -120,7 +120,7 @@ VAL idris_b8Times(VM *vm, VAL a, VAL b) {
120120 uint8_t A = a->info.bits8;
121121 uint8_t B = b->info.bits8;
122122 VAL cl = allocate(sizeof(Closure), 0);
123− SETTY(cl, BITS8);
123+ SETTY(cl, CT_BITS8);
124124 cl->info.bits8 = A * B;
125125 return cl;
126126}
@@ -129,7 +129,7 @@ VAL idris_b8UDiv(VM *vm, VAL a, VAL b) {
129129 uint8_t A = a->info.bits8;
130130 uint8_t B = b->info.bits8;
131131 VAL cl = allocate(sizeof(Closure), 0);
132− SETTY(cl, BITS8);
132+ SETTY(cl, CT_BITS8);
133133 cl->info.bits8 = A / B;
134134 return cl;
135135}
@@ -138,7 +138,7 @@ VAL idris_b8SDiv(VM *vm, VAL a, VAL b) {
138138 uint8_t A = a->info.bits8;
139139 uint8_t B = b->info.bits8;
140140 VAL cl = allocate(sizeof(Closure), 0);
141− SETTY(cl, BITS8);
141+ SETTY(cl, CT_BITS8);
142142 cl->info.bits8 = (uint8_t) (((int8_t) A) / ((int8_t) B));
143143 return cl;
144144}
@@ -147,7 +147,7 @@ VAL idris_b8URem(VM *vm, VAL a, VAL b) {
147147 uint8_t A = a->info.bits8;
148148 uint8_t B = b->info.bits8;
149149 VAL cl = allocate(sizeof(Closure), 0);
150− SETTY(cl, BITS8);
150+ SETTY(cl, CT_BITS8);
151151 cl->info.bits8 = A % B;
152152 return cl;
153153}
@@ -156,7 +156,7 @@ VAL idris_b8SRem(VM *vm, VAL a, VAL b) {
156156 uint8_t A = a->info.bits8;
157157 uint8_t B = b->info.bits8;
158158 VAL cl = allocate(sizeof(Closure), 0);
159− SETTY(cl, BITS8);
159+ SETTY(cl, CT_BITS8);
160160 cl->info.bits8 = (uint8_t) (((int8_t) A) % ((int8_t) B));
161161 return cl;
162162}
@@ -184,7 +184,7 @@ VAL idris_b8Gte(VM *vm, VAL a, VAL b) {
184184VAL idris_b8Compl(VM *vm, VAL a) {
185185 uint8_t A = a->info.bits8;
186186 VAL cl = allocate(sizeof(Closure), 0);
187− SETTY(cl, BITS8);
187+ SETTY(cl, CT_BITS8);
188188 cl->info.bits8 = ~ A;
189189 return cl;
190190}
@@ -193,7 +193,7 @@ VAL idris_b8And(VM *vm, VAL a, VAL b) {
193193 uint8_t A = a->info.bits8;
194194 uint8_t B = b->info.bits8;
195195 VAL cl = allocate(sizeof(Closure), 0);
196− SETTY(cl, BITS8);
196+ SETTY(cl, CT_BITS8);
197197 cl->info.bits8 = A & B;
198198 return cl;
199199}
@@ -202,7 +202,7 @@ VAL idris_b8Or(VM *vm, VAL a, VAL b) {
202202 uint8_t A = a->info.bits8;
203203 uint8_t B = b->info.bits8;
204204 VAL cl = allocate(sizeof(Closure), 0);
205− SETTY(cl, BITS8);
205+ SETTY(cl, CT_BITS8);
206206 cl->info.bits8 = A | B;
207207 return cl;
208208}
@@ -211,7 +211,7 @@ VAL idris_b8Xor(VM *vm, VAL a, VAL b) {
211211 uint8_t A = a->info.bits8;
212212 uint8_t B = b->info.bits8;
213213 VAL cl = allocate(sizeof(Closure), 0);
214− SETTY(cl, BITS8);
214+ SETTY(cl, CT_BITS8);
215215 cl->info.bits8 = A ^ B;
216216 return cl;
217217}
@@ -220,7 +220,7 @@ VAL idris_b8Shl(VM *vm, VAL a, VAL b) {
220220 uint8_t A = a->info.bits8;
221221 uint8_t B = b->info.bits8;
222222 VAL cl = allocate(sizeof(Closure), 0);
223− SETTY(cl, BITS8);
223+ SETTY(cl, CT_BITS8);
224224 cl->info.bits8 = A << B;
225225 return cl;
226226}
@@ -229,7 +229,7 @@ VAL idris_b8LShr(VM *vm, VAL a, VAL b) {
229229 uint8_t A = a->info.bits8;
230230 uint8_t B = b->info.bits8;
231231 VAL cl = allocate(sizeof(Closure), 0);
232− SETTY(cl, BITS8);
232+ SETTY(cl, CT_BITS8);
233233 cl->info.bits8 = A >> B;
234234 return cl;
235235}
@@ -238,7 +238,7 @@ VAL idris_b8AShr(VM *vm, VAL a, VAL b) {
238238 uint8_t A = a->info.bits8;
239239 uint8_t B = b->info.bits8;
240240 VAL cl = allocate(sizeof(Closure), 0);
241− SETTY(cl, BITS8);
241+ SETTY(cl, CT_BITS8);
242242 cl->info.bits8 = (uint8_t) (((int8_t) A) >> ((int8_t) B));
243243 return cl;
244244}
@@ -247,7 +247,7 @@ VAL idris_b16Plus(VM *vm, VAL a, VAL b) {
247247 uint16_t A = a->info.bits16;
248248 uint16_t B = b->info.bits16;
249249 VAL cl = allocate(sizeof(Closure), 0);
250− SETTY(cl, BITS16);
250+ SETTY(cl, CT_BITS16);
251251 cl->info.bits16 = A + B;
252252 return cl;
253253}
@@ -256,7 +256,7 @@ VAL idris_b16Minus(VM *vm, VAL a, VAL b) {
256256 uint16_t A = a->info.bits16;
257257 uint16_t B = b->info.bits16;
258258 VAL cl = allocate(sizeof(Closure), 0);
259− SETTY(cl, BITS16);
259+ SETTY(cl, CT_BITS16);
260260 cl->info.bits16 = A - B;
261261 return cl;
262262}
@@ -265,7 +265,7 @@ VAL idris_b16Times(VM *vm, VAL a, VAL b) {
265265 uint16_t A = a->info.bits16;
266266 uint16_t B = b->info.bits16;
267267 VAL cl = allocate(sizeof(Closure), 0);
268− SETTY(cl, BITS16);
268+ SETTY(cl, CT_BITS16);
269269 cl->info.bits16 = A * B;
270270 return cl;
271271}
@@ -274,7 +274,7 @@ VAL idris_b16UDiv(VM *vm, VAL a, VAL b) {
274274 uint16_t A = a->info.bits16;
275275 uint16_t B = b->info.bits16;
276276 VAL cl = allocate(sizeof(Closure), 0);
277− SETTY(cl, BITS16);
277+ SETTY(cl, CT_BITS16);
278278 cl->info.bits16 = A / B;
279279 return cl;
280280}
@@ -283,7 +283,7 @@ VAL idris_b16SDiv(VM *vm, VAL a, VAL b) {
283283 uint16_t A = a->info.bits16;
284284 uint16_t B = b->info.bits16;
285285 VAL cl = allocate(sizeof(Closure), 0);
286− SETTY(cl, BITS16);
286+ SETTY(cl, CT_BITS16);
287287 cl->info.bits16 = (uint16_t) (((int16_t) A) / ((int16_t) B));
288288 return cl;
289289}
@@ -292,7 +292,7 @@ VAL idris_b16URem(VM *vm, VAL a, VAL b) {
292292 uint16_t A = a->info.bits16;
293293 uint16_t B = b->info.bits16;
294294 VAL cl = allocate(sizeof(Closure), 0);
295− SETTY(cl, BITS16);
295+ SETTY(cl, CT_BITS16);
296296 cl->info.bits16 = A % B;
297297 return cl;
298298}
@@ -301,7 +301,7 @@ VAL idris_b16SRem(VM *vm, VAL a, VAL b) {
301301 uint16_t A = a->info.bits16;
302302 uint16_t B = b->info.bits16;
303303 VAL cl = allocate(sizeof(Closure), 0);
304− SETTY(cl, BITS16);
304+ SETTY(cl, CT_BITS16);
305305 cl->info.bits16 = (uint16_t) (((int16_t) A) % ((int16_t) B));
306306 return cl;
307307}
@@ -329,7 +329,7 @@ VAL idris_b16Gte(VM *vm, VAL a, VAL b) {
329329VAL idris_b16Compl(VM *vm, VAL a) {
330330 uint16_t A = a->info.bits16;
331331 VAL cl = allocate(sizeof(Closure), 0);
332− SETTY(cl, BITS16);
332+ SETTY(cl, CT_BITS16);
333333 cl->info.bits16 = ~ A;
334334 return cl;
335335}
@@ -338,7 +338,7 @@ VAL idris_b16And(VM *vm, VAL a, VAL b) {
338338 uint16_t A = a->info.bits16;
339339 uint16_t B = b->info.bits16;
340340 VAL cl = allocate(sizeof(Closure), 0);
341− SETTY(cl, BITS16);
341+ SETTY(cl, CT_BITS16);
342342 cl->info.bits16 = A & B;
343343 return cl;
344344}
@@ -347,7 +347,7 @@ VAL idris_b16Or(VM *vm, VAL a, VAL b) {
347347 uint16_t A = a->info.bits16;
348348 uint16_t B = b->info.bits16;
349349 VAL cl = allocate(sizeof(Closure), 0);
350− SETTY(cl, BITS16);
350+ SETTY(cl, CT_BITS16);
351351 cl->info.bits16 = A | B;
352352 return cl;
353353}
@@ -356,7 +356,7 @@ VAL idris_b16Xor(VM *vm, VAL a, VAL b) {
356356 uint16_t A = a->info.bits16;
357357 uint16_t B = b->info.bits16;
358358 VAL cl = allocate(sizeof(Closure), 0);
359− SETTY(cl, BITS16);
359+ SETTY(cl, CT_BITS16);
360360 cl->info.bits16 = A ^ B;
361361 return cl;
362362}
@@ -365,7 +365,7 @@ VAL idris_b16Shl(VM *vm, VAL a, VAL b) {
365365 uint16_t A = a->info.bits16;
366366 uint16_t B = b->info.bits16;
367367 VAL cl = allocate(sizeof(Closure), 0);
368− SETTY(cl, BITS16);
368+ SETTY(cl, CT_BITS16);
369369 cl->info.bits16 = A << B;
370370 return cl;
371371}
@@ -374,7 +374,7 @@ VAL idris_b16LShr(VM *vm, VAL a, VAL b) {
374374 uint16_t A = a->info.bits16;
375375 uint16_t B = b->info.bits16;
376376 VAL cl = allocate(sizeof(Closure), 0);
377− SETTY(cl, BITS16);
377+ SETTY(cl, CT_BITS16);
378378 cl->info.bits16 = A >> B;
379379 return cl;
380380}
@@ -383,7 +383,7 @@ VAL idris_b16AShr(VM *vm, VAL a, VAL b) {
383383 uint16_t A = a->info.bits16;
384384 uint16_t B = b->info.bits16;
385385 VAL cl = allocate(sizeof(Closure), 0);
386− SETTY(cl, BITS16);
386+ SETTY(cl, CT_BITS16);
387387 cl->info.bits16 = (uint16_t) (((int16_t) A) >> ((int16_t) B));
388388 return cl;
389389}
@@ -392,7 +392,7 @@ VAL idris_b32Plus(VM *vm, VAL a, VAL b) {
392392 uint32_t A = a->info.bits32;
393393 uint32_t B = b->info.bits32;
394394 VAL cl = allocate(sizeof(Closure), 0);
395− SETTY(cl, BITS32);
395+ SETTY(cl, CT_BITS32);
396396 cl->info.bits32 = A + B;
397397 return cl;
398398}
@@ -401,7 +401,7 @@ VAL idris_b32Minus(VM *vm, VAL a, VAL b) {
401401 uint32_t A = a->info.bits32;
402402 uint32_t B = b->info.bits32;
403403 VAL cl = allocate(sizeof(Closure), 0);
404− SETTY(cl, BITS32);
404+ SETTY(cl, CT_BITS32);
405405 cl->info.bits32 = A - B;
406406 return cl;
407407}
@@ -410,7 +410,7 @@ VAL idris_b32Times(VM *vm, VAL a, VAL b) {
410410 uint32_t A = a->info.bits32;
411411 uint32_t B = b->info.bits32;
412412 VAL cl = allocate(sizeof(Closure), 0);
413− SETTY(cl, BITS32);
413+ SETTY(cl, CT_BITS32);
414414 cl->info.bits32 = A * B;
415415 return cl;
416416}
@@ -419,7 +419,7 @@ VAL idris_b32UDiv(VM *vm, VAL a, VAL b) {
419419 uint32_t A = a->info.bits32;
420420 uint32_t B = b->info.bits32;
421421 VAL cl = allocate(sizeof(Closure), 0);
422− SETTY(cl, BITS32);
422+ SETTY(cl, CT_BITS32);
423423 cl->info.bits32 = A / B;
424424 return cl;
425425}
@@ -428,7 +428,7 @@ VAL idris_b32SDiv(VM *vm, VAL a, VAL b) {
428428 uint32_t A = a->info.bits32;
429429 uint32_t B = b->info.bits32;
430430 VAL cl = allocate(sizeof(Closure), 0);
431− SETTY(cl, BITS32);
431+ SETTY(cl, CT_BITS32);
432432 cl->info.bits32 = (uint32_t) (((int32_t) A) / ((int32_t) B));
433433 return cl;
434434}
@@ -437,7 +437,7 @@ VAL idris_b32URem(VM *vm, VAL a, VAL b) {
437437 uint32_t A = a->info.bits32;
438438 uint32_t B = b->info.bits32;
439439 VAL cl = allocate(sizeof(Closure), 0);
440− SETTY(cl, BITS32);
440+ SETTY(cl, CT_BITS32);
441441 cl->info.bits32 = A % B;
442442 return cl;
443443}
@@ -446,7 +446,7 @@ VAL idris_b32SRem(VM *vm, VAL a, VAL b) {
446446 uint32_t A = a->info.bits32;
447447 uint32_t B = b->info.bits32;
448448 VAL cl = allocate(sizeof(Closure), 0);
449− SETTY(cl, BITS32);
449+ SETTY(cl, CT_BITS32);
450450 cl->info.bits32 = (uint32_t) (((int32_t) A) % ((int32_t) B));
451451 return cl;
452452}
@@ -474,7 +474,7 @@ VAL idris_b32Gte(VM *vm, VAL a, VAL b) {
474474VAL idris_b32Compl(VM *vm, VAL a) {
475475 uint32_t A = a->info.bits32;
476476 VAL cl = allocate(sizeof(Closure), 0);
477− SETTY(cl, BITS32);
477+ SETTY(cl, CT_BITS32);
478478 cl->info.bits32 = ~ A;
479479 return cl;
480480}
@@ -483,7 +483,7 @@ VAL idris_b32And(VM *vm, VAL a, VAL b) {
483483 uint32_t A = a->info.bits32;
484484 uint32_t B = b->info.bits32;
485485 VAL cl = allocate(sizeof(Closure), 0);
486− SETTY(cl, BITS32);
486+ SETTY(cl, CT_BITS32);
487487 cl->info.bits32 = A & B;
488488 return cl;
489489}
@@ -492,7 +492,7 @@ VAL idris_b32Or(VM *vm, VAL a, VAL b) {
492492 uint32_t A = a->info.bits32;
493493 uint32_t B = b->info.bits32;
494494 VAL cl = allocate(sizeof(Closure), 0);
495− SETTY(cl, BITS32);
495+ SETTY(cl, CT_BITS32);
496496 cl->info.bits32 = A | B;
497497 return cl;
498498}
@@ -501,7 +501,7 @@ VAL idris_b32Xor(VM *vm, VAL a, VAL b) {
501501 uint32_t A = a->info.bits32;
502502 uint32_t B = b->info.bits32;
503503 VAL cl = allocate(sizeof(Closure), 0);
504− SETTY(cl, BITS32);
504+ SETTY(cl, CT_BITS32);
505505 cl->info.bits32 = A ^ B;
506506 return cl;
507507}
@@ -510,7 +510,7 @@ VAL idris_b32Shl(VM *vm, VAL a, VAL b) {
510510 uint32_t A = a->info.bits32;
511511 uint32_t B = b->info.bits32;
512512 VAL cl = allocate(sizeof(Closure), 0);
513− SETTY(cl, BITS32);
513+ SETTY(cl, CT_BITS32);
514514 cl->info.bits32 = A << B;
515515 return cl;
516516}
@@ -519,7 +519,7 @@ VAL idris_b32LShr(VM *vm, VAL a, VAL b) {
519519 uint32_t A = a->info.bits32;
520520 uint32_t B = b->info.bits32;
521521 VAL cl = allocate(sizeof(Closure), 0);
522− SETTY(cl, BITS32);
522+ SETTY(cl, CT_BITS32);
523523 cl->info.bits32 = A >> B;
524524 return cl;
525525}
@@ -528,7 +528,7 @@ VAL idris_b32AShr(VM *vm, VAL a, VAL b) {
528528 uint32_t A = a->info.bits32;
529529 uint32_t B = b->info.bits32;
530530 VAL cl = allocate(sizeof(Closure), 0);
531− SETTY(cl, BITS32);
531+ SETTY(cl, CT_BITS32);
532532 cl->info.bits32 = (uint32_t) (((int32_t)A) >> ((int32_t)B));
533533 return cl;
534534}
@@ -537,7 +537,7 @@ VAL idris_b64Plus(VM *vm, VAL a, VAL b) {
537537 uint64_t A = a->info.bits64;
538538 uint64_t B = b->info.bits64;
539539 VAL cl = allocate(sizeof(Closure), 0);
540− SETTY(cl, BITS64);
540+ SETTY(cl, CT_BITS64);
541541 cl->info.bits64 = A + B;
542542 return cl;
543543}
@@ -546,7 +546,7 @@ VAL idris_b64Minus(VM *vm, VAL a, VAL b) {
546546 uint64_t A = a->info.bits64;
547547 uint64_t B = b->info.bits64;
548548 VAL cl = allocate(sizeof(Closure), 0);
549− SETTY(cl, BITS64);
549+ SETTY(cl, CT_BITS64);
550550 cl->info.bits64 = A - B;
551551 return cl;
552552}
@@ -555,7 +555,7 @@ VAL idris_b64Times(VM *vm, VAL a, VAL b) {
555555 uint64_t A = a->info.bits64;
556556 uint64_t B = b->info.bits64;
557557 VAL cl = allocate(sizeof(Closure), 0);
558− SETTY(cl, BITS64);
558+ SETTY(cl, CT_BITS64);
559559 cl->info.bits64 = A * B;
560560 return cl;
561561}
@@ -564,7 +564,7 @@ VAL idris_b64UDiv(VM *vm, VAL a, VAL b) {
564564 uint64_t A = a->info.bits64;
565565 uint64_t B = b->info.bits64;
566566 VAL cl = allocate(sizeof(Closure), 0);
567− SETTY(cl, BITS64);
567+ SETTY(cl, CT_BITS64);
568568 cl->info.bits64 = A / B;
569569 return cl;
570570}
@@ -573,7 +573,7 @@ VAL idris_b64SDiv(VM *vm, VAL a, VAL b) {
573573 uint64_t A = a->info.bits64;
574574 uint64_t B = b->info.bits64;
575575 VAL cl = allocate(sizeof(Closure), 0);
576− SETTY(cl, BITS64);
576+ SETTY(cl, CT_BITS64);
577577 cl->info.bits64 = (uint64_t) (((int64_t) A) / ((int64_t) B));
578578 return cl;
579579}
@@ -582,7 +582,7 @@ VAL idris_b64URem(VM *vm, VAL a, VAL b) {
582582 uint64_t A = a->info.bits64;
583583 uint64_t B = b->info.bits64;
584584 VAL cl = allocate(sizeof(Closure), 0);
585− SETTY(cl, BITS64);
585+ SETTY(cl, CT_BITS64);
586586 cl->info.bits64 = A % B;
587587 return cl;
588588}
@@ -591,7 +591,7 @@ VAL idris_b64SRem(VM *vm, VAL a, VAL b) {
591591 uint64_t A = a->info.bits64;
592592 uint64_t B = b->info.bits64;
593593 VAL cl = allocate(sizeof(Closure), 0);
594− SETTY(cl, BITS64);
594+ SETTY(cl, CT_BITS64);
595595 cl->info.bits64 = (uint64_t) (((int64_t) A) % ((int64_t) B));
596596 return cl;
597597}
@@ -619,7 +619,7 @@ VAL idris_b64Gte(VM *vm, VAL a, VAL b) {
619619VAL idris_b64Compl(VM *vm, VAL a) {
620620 uint64_t A = a->info.bits64;
621621 VAL cl = allocate(sizeof(Closure), 0);
622− SETTY(cl, BITS64);
622+ SETTY(cl, CT_BITS64);
623623 cl->info.bits64 = ~ A;
624624 return cl;
625625}
@@ -628,7 +628,7 @@ VAL idris_b64And(VM *vm, VAL a, VAL b) {
628628 uint64_t A = a->info.bits64;
629629 uint64_t B = b->info.bits64;
630630 VAL cl = allocate(sizeof(Closure), 0);
631− SETTY(cl, BITS64);
631+ SETTY(cl, CT_BITS64);
632632 cl->info.bits64 = A & B;
633633 return cl;
634634}
@@ -637,7 +637,7 @@ VAL idris_b64Or(VM *vm, VAL a, VAL b) {
637637 uint64_t A = a->info.bits64;
638638 uint64_t B = b->info.bits64;
639639 VAL cl = allocate(sizeof(Closure), 0);
640− SETTY(cl, BITS64);
640+ SETTY(cl, CT_BITS64);
641641 cl->info.bits64 = A | B;
642642 return cl;
643643}
@@ -646,7 +646,7 @@ VAL idris_b64Xor(VM *vm, VAL a, VAL b) {
646646 uint64_t A = a->info.bits64;
647647 uint64_t B = b->info.bits64;
648648 VAL cl = allocate(sizeof(Closure), 0);
649− SETTY(cl, BITS64);
649+ SETTY(cl, CT_BITS64);
650650 cl->info.bits64 = A ^ B;
651651 return cl;
652652}
@@ -655,7 +655,7 @@ VAL idris_b64Shl(VM *vm, VAL a, VAL b) {
655655 uint64_t A = a->info.bits64;
656656 uint64_t B = b->info.bits64;
657657 VAL cl = allocate(sizeof(Closure), 0);
658− SETTY(cl, BITS64);
658+ SETTY(cl, CT_BITS64);
659659 cl->info.bits64 = A << B;
660660 return cl;
661661}
@@ -664,7 +664,7 @@ VAL idris_b64LShr(VM *vm, VAL a, VAL b) {
664664 uint64_t A = a->info.bits64;
665665 uint64_t B = b->info.bits64;
666666 VAL cl = allocate(sizeof(Closure), 0);
667− SETTY(cl, BITS64);
667+ SETTY(cl, CT_BITS64);
668668 cl->info.bits64 = A >> B;
669669 return cl;
670670}
@@ -673,7 +673,7 @@ VAL idris_b64AShr(VM *vm, VAL a, VAL b) {
673673 uint64_t A = a->info.bits64;
674674 uint64_t B = b->info.bits64;
675675 VAL cl = allocate(sizeof(Closure), 0);
676− SETTY(cl, BITS64);
676+ SETTY(cl, CT_BITS64);
677677 cl->info.bits64 = (uint64_t) (((int64_t) A) >> ((int64_t) B));
678678 return cl;
679679}
@@ -681,7 +681,7 @@ VAL idris_b64AShr(VM *vm, VAL a, VAL b) {
681681VAL idris_b8Z16(VM *vm, VAL a) {
682682 uint8_t A = a->info.bits8;
683683 VAL cl = allocate(sizeof(Closure), 0);
684− SETTY(cl, BITS16);
684+ SETTY(cl, CT_BITS16);
685685 cl->info.bits16 = (uint16_t) A;
686686 return cl;
687687}
@@ -689,7 +689,7 @@ VAL idris_b8Z16(VM *vm, VAL a) {
689689VAL idris_b8Z32(VM *vm, VAL a) {
690690 uint8_t A = a->info.bits8;
691691 VAL cl = allocate(sizeof(Closure), 0);
692− SETTY(cl, BITS32);
692+ SETTY(cl, CT_BITS32);
693693 cl->info.bits32 = (uint32_t) A;
694694 return cl;
695695}
@@ -697,7 +697,7 @@ VAL idris_b8Z32(VM *vm, VAL a) {
697697VAL idris_b8Z64(VM *vm, VAL a) {
698698 uint8_t A = a->info.bits8;
699699 VAL cl = allocate(sizeof(Closure), 0);
700− SETTY(cl, BITS64);
700+ SETTY(cl, CT_BITS64);
701701 cl->info.bits64 = (uint64_t) A;
702702 return cl;
703703}
@@ -705,7 +705,7 @@ VAL idris_b8Z64(VM *vm, VAL a) {
705705VAL idris_b8S16(VM *vm, VAL a) {
706706 uint8_t A = a->info.bits8;
707707 VAL cl = allocate(sizeof(Closure), 0);
708− SETTY(cl, BITS16);
708+ SETTY(cl, CT_BITS16);
709709 cl->info.bits16 = (uint16_t) (int16_t) (int8_t) A;
710710 return cl;
711711}
@@ -713,7 +713,7 @@ VAL idris_b8S16(VM *vm, VAL a) {
713713VAL idris_b8S32(VM *vm, VAL a) {
714714 uint8_t A = a->info.bits8;
715715 VAL cl = allocate(sizeof(Closure), 0);
716− SETTY(cl, BITS32);
716+ SETTY(cl, CT_BITS32);
717717 cl->info.bits32 = (uint32_t) (int32_t) (int8_t) A;
718718 return cl;
719719}
@@ -721,7 +721,7 @@ VAL idris_b8S32(VM *vm, VAL a) {
721721VAL idris_b8S64(VM *vm, VAL a) {
722722 uint8_t A = a->info.bits8;
723723 VAL cl = allocate(sizeof(Closure), 0);
724− SETTY(cl, BITS64);
724+ SETTY(cl, CT_BITS64);
725725 cl->info.bits64 = (uint64_t) (int64_t) (int8_t) A;
726726 return cl;
727727}
@@ -729,7 +729,7 @@ VAL idris_b8S64(VM *vm, VAL a) {
729729VAL idris_b16Z32(VM *vm, VAL a) {
730730 uint16_t A = a->info.bits16;
731731 VAL cl = allocate(sizeof(Closure), 0);
732− SETTY(cl, BITS32);
732+ SETTY(cl, CT_BITS32);
733733 cl->info.bits32 = (uint32_t) A;
734734 return cl;
735735}
@@ -737,7 +737,7 @@ VAL idris_b16Z32(VM *vm, VAL a) {
737737VAL idris_b16Z64(VM *vm, VAL a) {
738738 uint16_t A = a->info.bits16;
739739 VAL cl = allocate(sizeof(Closure), 0);
740− SETTY(cl, BITS64);
740+ SETTY(cl, CT_BITS64);
741741 cl->info.bits64 = (uint64_t) A;
742742 return cl;
743743}
@@ -745,7 +745,7 @@ VAL idris_b16Z64(VM *vm, VAL a) {
745745VAL idris_b16S32(VM *vm, VAL a) {
746746 uint16_t A = a->info.bits16;
747747 VAL cl = allocate(sizeof(Closure), 0);
748− SETTY(cl, BITS32);
748+ SETTY(cl, CT_BITS32);
749749 cl->info.bits32 = (uint32_t) (int32_t) (int16_t) A;
750750 return cl;
751751}
@@ -753,7 +753,7 @@ VAL idris_b16S32(VM *vm, VAL a) {
753753VAL idris_b16S64(VM *vm, VAL a) {
754754 uint16_t A = a->info.bits16;
755755 VAL cl = allocate(sizeof(Closure), 0);
756− SETTY(cl, BITS64);
756+ SETTY(cl, CT_BITS64);
757757 cl->info.bits64 = (uint64_t) (int64_t) (int16_t) A;
758758 return cl;
759759}
@@ -761,7 +761,7 @@ VAL idris_b16S64(VM *vm, VAL a) {
761761VAL idris_b16T8(VM *vm, VAL a) {
762762 uint16_t A = a->info.bits16;
763763 VAL cl = allocate(sizeof(Closure), 0);
764− SETTY(cl, BITS8);
764+ SETTY(cl, CT_BITS8);
765765 cl->info.bits8 = (uint8_t) A;
766766 return cl;
767767}
@@ -769,7 +769,7 @@ VAL idris_b16T8(VM *vm, VAL a) {
769769VAL idris_b32Z64(VM *vm, VAL a) {
770770 uint32_t A = a->info.bits32;
771771 VAL cl = allocate(sizeof(Closure), 0);
772− SETTY(cl, BITS64);
772+ SETTY(cl, CT_BITS64);
773773 cl->info.bits64 = (uint64_t) A;
774774 return cl;
775775}
@@ -777,7 +777,7 @@ VAL idris_b32Z64(VM *vm, VAL a) {
777777VAL idris_b32S64(VM *vm, VAL a) {
778778 uint32_t A = a->info.bits32;
779779 VAL cl = allocate(sizeof(Closure), 0);
780− SETTY(cl, BITS64);
780+ SETTY(cl, CT_BITS64);
781781 cl->info.bits64 = (uint64_t) (int64_t) (int32_t) A;
782782 return cl;
783783}
@@ -785,7 +785,7 @@ VAL idris_b32S64(VM *vm, VAL a) {
785785VAL idris_b32T8(VM *vm, VAL a) {
786786 uint32_t A = a->info.bits32;
787787 VAL cl = allocate(sizeof(Closure), 0);
788− SETTY(cl, BITS8);
788+ SETTY(cl, CT_BITS8);
789789 cl->info.bits8 = (uint8_t) A;
790790 return cl;
791791}
@@ -793,7 +793,7 @@ VAL idris_b32T8(VM *vm, VAL a) {
793793VAL idris_b32T16(VM *vm, VAL a) {
794794 uint32_t A = a->info.bits32;
795795 VAL cl = allocate(sizeof(Closure), 0);
796− SETTY(cl, BITS16);
796+ SETTY(cl, CT_BITS16);
797797 cl->info.bits16 = (uint16_t) A;
798798 return cl;
799799}
@@ -801,7 +801,7 @@ VAL idris_b32T16(VM *vm, VAL a) {
801801VAL idris_b64T8(VM *vm, VAL a) {
802802 uint64_t A = a->info.bits64;
803803 VAL cl = allocate(sizeof(Closure), 0);
804− SETTY(cl, BITS8);
804+ SETTY(cl, CT_BITS8);
805805 cl->info.bits8 = (uint8_t) A;
806806 return cl;
807807}
@@ -809,7 +809,7 @@ VAL idris_b64T8(VM *vm, VAL a) {
809809VAL idris_b64T16(VM *vm, VAL a) {
810810 uint64_t A = a->info.bits64;
811811 VAL cl = allocate(sizeof(Closure), 0);
812− SETTY(cl, BITS16);
812+ SETTY(cl, CT_BITS16);
813813 cl->info.bits16 = (uint16_t) A;
814814 return cl;
815815}
@@ -817,7 +817,7 @@ VAL idris_b64T16(VM *vm, VAL a) {
817817VAL idris_b64T32(VM *vm, VAL a) {
818818 uint64_t A = a->info.bits64;
819819 VAL cl = allocate(sizeof(Closure), 0);
820− SETTY(cl, BITS32);
820+ SETTY(cl, CT_BITS32);
821821 cl->info.bits32 = (uint32_t) A;
822822 return cl;
823823}
rts/idris_gc.c+18−18
@@ -10,7 +10,7 @@ VAL copy(VM* vm, VAL x) {
1010 return x;
1111 }
1212 switch(GETTY(x)) {
13− case CON:
13+ case CT_CON:
1414 ar = CARITY(x);
1515 if (ar == 0 && CTAG(x) < 256) {
1616 return x;
@@ -21,53 +21,53 @@ VAL copy(VM* vm, VAL x) {
2121 }
2222 }
2323 break;
24− case FLOAT:
24+ case CT_FLOAT:
2525 cl = MKFLOATc(vm, x->info.f);
2626 break;
27− case STRING:
27+ case CT_STRING:
2828 cl = MKSTRc(vm, x->info.str);
2929 break;
30− case STROFFSET:
30+ case CT_STROFFSET:
3131 cl = MKSTROFFc(vm, x->info.str_offset);
3232 break;
33− case BIGINT:
33+ case CT_BIGINT:
3434 cl = MKBIGMc(vm, x->info.ptr);
3535 break;
36− case PTR:
36+ case CT_PTR:
3737 cl = MKPTRc(vm, x->info.ptr);
3838 break;
39− case MANAGEDPTR:
39+ case CT_MANAGEDPTR:
4040 cl = MKMPTRc(vm, x->info.mptr->data, x->info.mptr->size);
4141 break;
42− case BITS8:
42+ case CT_BITS8:
4343 cl = idris_b8CopyForGC(vm, x);
4444 break;
45− case BITS16:
45+ case CT_BITS16:
4646 cl = idris_b16CopyForGC(vm, x);
4747 break;
48− case BITS32:
48+ case CT_BITS32:
4949 cl = idris_b32CopyForGC(vm, x);
5050 break;
51− case BITS64:
51+ case CT_BITS64:
5252 cl = idris_b64CopyForGC(vm, x);
5353 break;
54− case FWD:
54+ case CT_FWD:
5555 return x->info.ptr;
56− case RAWDATA:
56+ case CT_RAWDATA:
5757 {
5858 size_t size = x->info.size + sizeof(Closure);
5959 cl = allocate(size, 0);
6060 memcpy(cl, x, size);
6161 }
6262 break;
63− case CDATA:
63+ case CT_CDATA:
6464 cl = MKCDATAc(vm, x->info.c_heap_item);
6565 c_heap_mark_item(x->info.c_heap_item);
6666 break;
6767 default:
6868 break;
6969 }
70− SETTY(x, FWD);
70+ SETTY(x, CT_FWD);
7171 x->info.ptr = cl;
7272 return cl;
7373}
@@ -80,16 +80,16 @@ void cheney(VM *vm) {
8080 while(scan < vm->heap.next) {
8181 size_t inc = *((size_t*)scan);
8282 VAL heap_item = (VAL)(scan+sizeof(size_t));
83− // If it's a CON or STROFFSET, copy its arguments
83+ // If it's a CT_CON or CT_STROFFSET, copy its arguments
8484 switch(GETTY(heap_item)) {
85− case CON:
85+ case CT_CON:
8686 ar = ARITY(heap_item);
8787 for(i = 0; i < ar; ++i) {
8888 VAL newptr = copy(vm, heap_item->info.c.args[i]);
8989 heap_item->info.c.args[i] = newptr;
9090 }
9191 break;
92− case STROFFSET:
92+ case CT_STROFFSET:
9393 heap_item->info.str_offset->str
9494 = copy(vm, heap_item->info.str_offset->str);
9595 break;
rts/idris_gmp.c+18−18
@@ -33,7 +33,7 @@ VAL MKBIGC(VM* vm, char* val) {
3333 mpz_init(*bigint);
3434 mpz_set_str(*bigint, val, 10);
3535
36− SETTY(cl, BIGINT);
36+ SETTY(cl, CT_BIGINT);
3737 cl -> info.ptr = (void*)bigint;
3838
3939 return cl;
@@ -50,7 +50,7 @@ VAL MKBIGM(VM* vm, void* big) {
5050 mpz_init(*bigint);
5151 mpz_set(*bigint, *((mpz_t*)big));
5252
53− SETTY(cl, BIGINT);
53+ SETTY(cl, CT_BIGINT);
5454 cl -> info.ptr = (void*)bigint;
5555
5656 return cl;
@@ -66,7 +66,7 @@ VAL MKBIGMc(VM* vm, void* big) {
6666
6767 mpz_init_set(*bigint, *((mpz_t*)big));
6868
69− SETTY(cl, BIGINT);
69+ SETTY(cl, CT_BIGINT);
7070 cl -> info.ptr = (void*)bigint;
7171
7272 return cl;
@@ -82,7 +82,7 @@ VAL MKBIGUI(VM* vm, unsigned long val) {
8282
8383 mpz_init_set_ui(*bigint, val);
8484
85− SETTY(cl, BIGINT);
85+ SETTY(cl, CT_BIGINT);
8686 cl -> info.ptr = (void*)bigint;
8787
8888 return cl;
@@ -98,7 +98,7 @@ VAL MKBIGSI(VM* vm, signed long val) {
9898
9999 mpz_init_set_si(*bigint, val);
100100
101− SETTY(cl, BIGINT);
101+ SETTY(cl, CT_BIGINT);
102102 cl -> info.ptr = (void*)bigint;
103103
104104 return cl;
@@ -116,14 +116,14 @@ VAL GETBIG(VM * vm, VAL x) {
116116 mpz_init(*bigint);
117117 mpz_set_si(*bigint, GETINT(x));
118118
119− SETTY(cl, BIGINT);
119+ SETTY(cl, CT_BIGINT);
120120 cl -> info.ptr = (void*)bigint;
121121
122122 return cl;
123123 } else {
124124 idris_doneAlloc();
125125 switch(GETTY(x)) {
126− case FWD:
126+ case CT_FWD:
127127 return GETBIG(vm, x->info.ptr);
128128 default:
129129 return x;
@@ -139,7 +139,7 @@ VAL bigAdd(VM* vm, VAL x, VAL y) {
139139 idris_doneAlloc();
140140 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
141141 mpz_add(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
142− SETTY(cl, BIGINT);
142+ SETTY(cl, CT_BIGINT);
143143 cl -> info.ptr = (void*)bigint;
144144 return cl;
145145}
@@ -152,7 +152,7 @@ VAL bigSub(VM* vm, VAL x, VAL y) {
152152 idris_doneAlloc();
153153 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
154154 mpz_sub(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
155− SETTY(cl, BIGINT);
155+ SETTY(cl, CT_BIGINT);
156156 cl -> info.ptr = (void*)bigint;
157157 return cl;
158158}
@@ -165,7 +165,7 @@ VAL bigMul(VM* vm, VAL x, VAL y) {
165165 idris_doneAlloc();
166166 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
167167 mpz_mul(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
168− SETTY(cl, BIGINT);
168+ SETTY(cl, CT_BIGINT);
169169 cl -> info.ptr = (void*)bigint;
170170 return cl;
171171}
@@ -178,7 +178,7 @@ VAL bigDiv(VM* vm, VAL x, VAL y) {
178178 idris_doneAlloc();
179179 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
180180 mpz_tdiv_q(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
181− SETTY(cl, BIGINT);
181+ SETTY(cl, CT_BIGINT);
182182 cl -> info.ptr = (void*)bigint;
183183 return cl;
184184}
@@ -191,7 +191,7 @@ VAL bigMod(VM* vm, VAL x, VAL y) {
191191 idris_doneAlloc();
192192 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
193193 mpz_mod(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
194− SETTY(cl, BIGINT);
194+ SETTY(cl, CT_BIGINT);
195195 cl -> info.ptr = (void*)bigint;
196196 return cl;
197197}
@@ -204,7 +204,7 @@ VAL bigAnd(VM* vm, VAL x, VAL y) {
204204 idris_doneAlloc();
205205 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
206206 mpz_and(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
207− SETTY(cl, BIGINT);
207+ SETTY(cl, CT_BIGINT);
208208 cl -> info.ptr = (void*)bigint;
209209 return cl;
210210}
@@ -217,7 +217,7 @@ VAL bigOr(VM* vm, VAL x, VAL y) {
217217 idris_doneAlloc();
218218 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
219219 mpz_ior(*bigint, GETMPZ(GETBIG(vm,x)), GETMPZ(GETBIG(vm,y)));
220− SETTY(cl, BIGINT);
220+ SETTY(cl, CT_BIGINT);
221221 cl -> info.ptr = (void*)bigint;
222222 return cl;
223223}
@@ -230,7 +230,7 @@ VAL bigShiftLeft(VM* vm, VAL x, VAL y) {
230230 idris_doneAlloc();
231231 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
232232 mpz_mul_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
233− SETTY(cl, BIGINT);
233+ SETTY(cl, CT_BIGINT);
234234 cl -> info.ptr = (void*)bigint;
235235 return cl;
236236}
@@ -244,7 +244,7 @@ VAL bigLShiftRight(VM* vm, VAL x, VAL y) {
244244 idris_doneAlloc();
245245 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
246246 mpz_fdiv_q_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
247− SETTY(cl, BIGINT);
247+ SETTY(cl, CT_BIGINT);
248248 cl -> info.ptr = (void*)bigint;
249249 return cl;
250250}
@@ -257,7 +257,7 @@ VAL bigAShiftRight(VM* vm, VAL x, VAL y) {
257257 idris_doneAlloc();
258258 bigint = (mpz_t*)(((char*)cl) + sizeof(Closure));
259259 mpz_fdiv_q_2exp(*bigint, GETMPZ(GETBIG(vm,x)), GETINT(y));
260− SETTY(cl, BIGINT);
260+ SETTY(cl, CT_BIGINT);
261261 cl -> info.ptr = (void*)bigint;
262262 return cl;
263263}
@@ -473,7 +473,7 @@ VAL idris_castFloatBig(VM* vm, VAL f) {
473473
474474 mpz_init_set_d(*bigint, val);
475475
476− SETTY(cl, BIGINT);
476+ SETTY(cl, CT_BIGINT);
477477 cl -> info.ptr = (void*)bigint;
478478
479479 return cl;
rts/idris_heap.c+4−4
@@ -186,7 +186,7 @@ void heap_check_pointers(Heap * heap) {
186186 VAL heap_item = (VAL)(scan + sizeof(size_t));
187187
188188 switch(GETTY(heap_item)) {
189− case CON:
189+ case CT_CON:
190190 {
191191 int ar = ARITY(heap_item);
192192 int i = 0;
@@ -207,7 +207,7 @@ void heap_check_pointers(Heap * heap) {
207207 if (!(ptr < heap_item)) {
208208 fprintf(stderr,
209209 "RTS ERROR: heap unidirectionality broken:" \
210− "<CON %p> <FIELD %p>\n",
210+ "<CT_CON %p> <FIELD %p>\n",
211211 heap_item, ptr);
212212 exit(EXIT_FAILURE);
213213 }
@@ -216,9 +216,9 @@ void heap_check_pointers(Heap * heap) {
216216 }
217217 break;
218218 }
219− case FWD:
219+ case CT_FWD:
220220 // Check for artifacts after cheney gc.
221− fprintf(stderr, "RTS ERROR: FWD in working heap.\n");
221+ fprintf(stderr, "RTS ERROR: CT_FWD in working heap.\n");
222222 exit(EXIT_FAILURE);
223223 break;
224224 default:
rts/idris_rts.c+46−46
@@ -180,7 +180,7 @@ int space(VM* vm, size_t size) {
180180
181181void* idris_alloc(size_t size) {
182182 Closure* cl = (Closure*) allocate(sizeof(Closure)+size, 0);
183− SETTY(cl, RAWDATA);
183+ SETTY(cl, CT_RAWDATA);
184184 cl->info.size = size;
185185 return (void*)cl+sizeof(Closure);
186186}
@@ -245,7 +245,7 @@ void* allocate(size_t size, int outerlock) {
245245void* allocCon(VM* vm, int arity, int outer) {
246246 Closure* cl = allocate(vm, sizeof(Closure) + sizeof(VAL)*arity,
247247 outer);
248− SETTY(cl, CON);
248+ SETTY(cl, CT_CON);
249249
250250 cl -> info.c.arity = arity;
251251// cl -> info.c.tag = 42424242;
@@ -256,7 +256,7 @@ void* allocCon(VM* vm, int arity, int outer) {
256256
257257VAL MKFLOAT(VM* vm, double val) {
258258 Closure* cl = allocate(sizeof(Closure), 0);
259− SETTY(cl, FLOAT);
259+ SETTY(cl, CT_FLOAT);
260260 cl -> info.f = val;
261261 return cl;
262262}
@@ -270,7 +270,7 @@ VAL MKSTR(VM* vm, const char* str) {
270270 }
271271 Closure* cl = allocate(sizeof(Closure) + // Type) + sizeof(char*) +
272272 sizeof(char)*len, 0);
273− SETTY(cl, STRING);
273+ SETTY(cl, CT_STRING);
274274 cl -> info.str = (char*)cl + sizeof(Closure);
275275 if (str == NULL) {
276276 cl->info.str = NULL;
@@ -289,7 +289,7 @@ char* GETSTROFF(VAL stroff) {
289289VAL MKCDATA(VM* vm, CHeapItem * item) {
290290 c_heap_insert_if_needed(vm, &vm->c_heap, item);
291291 Closure* cl = allocate(sizeof(Closure), 0);
292− SETTY(cl, CDATA);
292+ SETTY(cl, CT_CDATA);
293293 cl->info.c_heap_item = item;
294294 return cl;
295295}
@@ -297,14 +297,14 @@ VAL MKCDATA(VM* vm, CHeapItem * item) {
297297VAL MKCDATAc(VM* vm, CHeapItem * item) {
298298 c_heap_insert_if_needed(vm, &vm->c_heap, item);
299299 Closure* cl = allocate(sizeof(Closure), 1);
300− SETTY(cl, CDATA);
300+ SETTY(cl, CT_CDATA);
301301 cl->info.c_heap_item = item;
302302 return cl;
303303}
304304
305305VAL MKPTR(VM* vm, void* ptr) {
306306 Closure* cl = allocate(sizeof(Closure), 0);
307− SETTY(cl, PTR);
307+ SETTY(cl, CT_PTR);
308308 cl -> info.ptr = ptr;
309309 return cl;
310310}
@@ -312,7 +312,7 @@ VAL MKPTR(VM* vm, void* ptr) {
312312VAL MKMPTR(VM* vm, void* ptr, size_t size) {
313313 Closure* cl = allocate(sizeof(Closure) +
314314 sizeof(ManagedPtr) + size, 0);
315− SETTY(cl, MANAGEDPTR);
315+ SETTY(cl, CT_MANAGEDPTR);
316316 cl->info.mptr = (ManagedPtr*)((char*)cl + sizeof(Closure));
317317 cl->info.mptr->data = (char*)cl + sizeof(Closure) + sizeof(ManagedPtr);
318318 memcpy(cl->info.mptr->data, ptr, size);
@@ -322,7 +322,7 @@ VAL MKMPTR(VM* vm, void* ptr, size_t size) {
322322
323323VAL MKFLOATc(VM* vm, double val) {
324324 Closure* cl = allocate(sizeof(Closure), 1);
325− SETTY(cl, FLOAT);
325+ SETTY(cl, CT_FLOAT);
326326 cl -> info.f = val;
327327 return cl;
328328}
@@ -330,7 +330,7 @@ VAL MKFLOATc(VM* vm, double val) {
330330VAL MKSTRc(VM* vm, char* str) {
331331 Closure* cl = allocate(sizeof(Closure) + // Type) + sizeof(char*) +
332332 sizeof(char)*strlen(str)+1, 1);
333− SETTY(cl, STRING);
333+ SETTY(cl, CT_STRING);
334334 cl -> info.str = (char*)cl + sizeof(Closure);
335335
336336 strcpy(cl -> info.str, str);
@@ -339,7 +339,7 @@ VAL MKSTRc(VM* vm, char* str) {
339339
340340VAL MKPTRc(VM* vm, void* ptr) {
341341 Closure* cl = allocate(sizeof(Closure), 1);
342− SETTY(cl, PTR);
342+ SETTY(cl, CT_PTR);
343343 cl -> info.ptr = ptr;
344344 return cl;
345345}
@@ -347,7 +347,7 @@ VAL MKPTRc(VM* vm, void* ptr) {
347347VAL MKMPTRc(VM* vm, void* ptr, size_t size) {
348348 Closure* cl = allocate(sizeof(Closure) +
349349 sizeof(ManagedPtr) + size, 1);
350− SETTY(cl, MANAGEDPTR);
350+ SETTY(cl, CT_MANAGEDPTR);
351351 cl->info.mptr = (ManagedPtr*)((char*)cl + sizeof(Closure));
352352 cl->info.mptr->data = (char*)cl + sizeof(Closure) + sizeof(ManagedPtr);
353353 memcpy(cl->info.mptr->data, ptr, size);
@@ -357,28 +357,28 @@ VAL MKMPTRc(VM* vm, void* ptr, size_t size) {
357357
358358VAL MKB8(VM* vm, uint8_t bits8) {
359359 Closure* cl = allocate(sizeof(Closure), 1);
360− SETTY(cl, BITS8);
360+ SETTY(cl, CT_BITS8);
361361 cl -> info.bits8 = bits8;
362362 return cl;
363363}
364364
365365VAL MKB16(VM* vm, uint16_t bits16) {
366366 Closure* cl = allocate(sizeof(Closure), 1);
367− SETTY(cl, BITS16);
367+ SETTY(cl, CT_BITS16);
368368 cl -> info.bits16 = bits16;
369369 return cl;
370370}
371371
372372VAL MKB32(VM* vm, uint32_t bits32) {
373373 Closure* cl = allocate(sizeof(Closure), 1);
374− SETTY(cl, BITS32);
374+ SETTY(cl, CT_BITS32);
375375 cl -> info.bits32 = bits32;
376376 return cl;
377377}
378378
379379VAL MKB64(VM* vm, uint64_t bits64) {
380380 Closure* cl = allocate(sizeof(Closure), 1);
381− SETTY(cl, BITS64);
381+ SETTY(cl, CT_BITS64);
382382 cl -> info.bits64 = bits64;
383383 return cl;
384384}
@@ -420,18 +420,18 @@ void dumpVal(VAL v) {
420420 return;
421421 }
422422 switch(GETTY(v)) {
423− case CON:
423+ case CT_CON:
424424 printf("%d[", TAG(v));
425425 for(i = 0; i < ARITY(v); ++i) {
426426 dumpVal(v->info.c.args[i]);
427427 }
428428 printf("] ");
429429 break;
430− case STRING:
430+ case CT_STRING:
431431 printf("STR[%s]", v->info.str);
432432 break;
433− case FWD:
434− printf("FWD ");
433+ case CT_FWD:
434+ printf("CT_FWD ");
435435 dumpVal((VAL)(v->info.ptr));
436436 break;
437437 default:
@@ -489,7 +489,7 @@ void idris_memmove(void* dest, void* src, i_int dest_offset, i_int src_offset, i
489489VAL idris_castIntStr(VM* vm, VAL i) {
490490 int x = (int) GETINT(i);
491491 Closure* cl = allocate(sizeof(Closure) + sizeof(char)*16, 0);
492− SETTY(cl, STRING);
492+ SETTY(cl, CT_STRING);
493493 cl -> info.str = (char*)cl + sizeof(Closure);
494494 sprintf(cl -> info.str, "%d", x);
495495 return cl;
@@ -500,25 +500,25 @@ VAL idris_castBitsStr(VM* vm, VAL i) {
500500 ClosureType ty = i->ty;
501501
502502 switch (ty) {
503− case BITS8:
503+ case CT_BITS8:
504504 // max length 8 bit unsigned int str 3 chars (256)
505505 cl = allocate(sizeof(Closure) + sizeof(char)*4, 0);
506506 cl->info.str = (char*)cl + sizeof(Closure);
507507 sprintf(cl->info.str, "%" PRIu8, (uint8_t)i->info.bits8);
508508 break;
509− case BITS16:
509+ case CT_BITS16:
510510 // max length 16 bit unsigned int str 5 chars (65,535)
511511 cl = allocate(sizeof(Closure) + sizeof(char)*6, 0);
512512 cl->info.str = (char*)cl + sizeof(Closure);
513513 sprintf(cl->info.str, "%" PRIu16, (uint16_t)i->info.bits16);
514514 break;
515− case BITS32:
515+ case CT_BITS32:
516516 // max length 32 bit unsigned int str 10 chars (4,294,967,295)
517517 cl = allocate(sizeof(Closure) + sizeof(char)*11, 0);
518518 cl->info.str = (char*)cl + sizeof(Closure);
519519 sprintf(cl->info.str, "%" PRIu32, (uint32_t)i->info.bits32);
520520 break;
521− case BITS64:
521+ case CT_BITS64:
522522 // max length 64 bit unsigned int str 20 chars (18,446,744,073,709,551,615)
523523 cl = allocate(sizeof(Closure) + sizeof(char)*21, 0);
524524 cl->info.str = (char*)cl + sizeof(Closure);
@@ -529,7 +529,7 @@ VAL idris_castBitsStr(VM* vm, VAL i) {
529529 exit(EXIT_FAILURE);
530530 }
531531
532− SETTY(cl, STRING);
532+ SETTY(cl, CT_STRING);
533533 return cl;
534534}
535535
@@ -544,7 +544,7 @@ VAL idris_castStrInt(VM* vm, VAL i) {
544544
545545VAL idris_castFloatStr(VM* vm, VAL i) {
546546 Closure* cl = allocate(sizeof(Closure) + sizeof(char)*32, 0);
547− SETTY(cl, STRING);
547+ SETTY(cl, CT_STRING);
548548 cl -> info.str = (char*)cl + sizeof(Closure);
549549 snprintf(cl -> info.str, 32, "%.16g", GETFLOAT(i));
550550 return cl;
@@ -560,7 +560,7 @@ VAL idris_concat(VM* vm, VAL l, VAL r) {
560560 // dumpVal(l);
561561 // printf("\n");
562562 Closure* cl = allocate(sizeof(Closure) + strlen(ls) + strlen(rs) + 1, 0);
563− SETTY(cl, STRING);
563+ SETTY(cl, CT_STRING);
564564 cl -> info.str = (char*)cl + sizeof(Closure);
565565 strcpy(cl -> info.str, ls);
566566 strcat(cl -> info.str, rs);
@@ -606,7 +606,7 @@ VAL idris_strHead(VM* vm, VAL str) {
606606
607607VAL MKSTROFFc(VM* vm, StrOffset* off) {
608608 Closure* cl = allocate(sizeof(Closure) + sizeof(StrOffset), 1);
609− SETTY(cl, STROFFSET);
609+ SETTY(cl, CT_STROFFSET);
610610 cl->info.str_offset = (StrOffset*)((char*)cl + sizeof(Closure));
611611
612612 cl->info.str_offset->str = off->str;
@@ -620,7 +620,7 @@ VAL idris_strTail(VM* vm, VAL str) {
620620 // gc moves str
621621 if (space(vm, sizeof(Closure) + sizeof(StrOffset))) {
622622 Closure* cl = allocate(sizeof(Closure) + sizeof(StrOffset), 0);
623− SETTY(cl, STROFFSET);
623+ SETTY(cl, CT_STROFFSET);
624624 cl->info.str_offset = (StrOffset*)((char*)cl + sizeof(Closure));
625625
626626 int offset = 0;
@@ -648,7 +648,7 @@ VAL idris_strCons(VM* vm, VAL x, VAL xs) {
648648 if ((xval & 0x80) == 0) { // ASCII char
649649 Closure* cl = allocate(sizeof(Closure) +
650650 strlen(xstr) + 2, 0);
651− SETTY(cl, STRING);
651+ SETTY(cl, CT_STRING);
652652 cl -> info.str = (char*)cl + sizeof(Closure);
653653 cl -> info.str[0] = (char)(GETINT(x));
654654 strcpy(cl -> info.str+1, xstr);
@@ -656,7 +656,7 @@ VAL idris_strCons(VM* vm, VAL x, VAL xs) {
656656 } else {
657657 char *init = idris_utf8_fromChar(xval);
658658 Closure* cl = allocate(sizeof(Closure) + strlen(init) + strlen(xstr) + 1, 0);
659− SETTY(cl, STRING);
659+ SETTY(cl, CT_STRING);
660660 cl -> info.str = (char*)cl + sizeof(Closure);
661661 strcpy(cl -> info.str, init);
662662 strcat(cl -> info.str, xstr);
@@ -674,7 +674,7 @@ VAL idris_substr(VM* vm, VAL offset, VAL length, VAL str) {
674674 char *start = idris_utf8_advance(GETSTR(str), GETINT(offset));
675675 char *end = idris_utf8_advance(start, GETINT(length));
676676 Closure* newstr = allocate(sizeof(Closure) + (end - start) +1, 0);
677− SETTY(newstr, STRING);
677+ SETTY(newstr, CT_STRING);
678678 newstr -> info.str = (char*)newstr + sizeof(Closure);
679679 memcpy(newstr -> info.str, start, end - start);
680680 *(newstr -> info.str + (end - start) + 1) = '\0';
@@ -685,7 +685,7 @@ VAL idris_strRev(VM* vm, VAL str) {
685685 char *xstr = GETSTR(str);
686686 Closure* cl = allocate(sizeof(Closure) +
687687 strlen(xstr) + 1, 0);
688− SETTY(cl, STRING);
688+ SETTY(cl, CT_STRING);
689689 cl->info.str = (char*)cl + sizeof(Closure);
690690 idris_utf8_rev(xstr, cl->info.str);
691691 return cl;
@@ -768,7 +768,7 @@ VAL doCopyTo(VM* vm, VAL x) {
768768 return x;
769769 }
770770 switch(GETTY(x)) {
771− case CON:
771+ case CT_CON:
772772 ar = CARITY(x);
773773 if (ar == 0 && CTAG(x) < 256) { // globally allocated
774774 cl = x;
@@ -782,34 +782,34 @@ VAL doCopyTo(VM* vm, VAL x) {
782782 }
783783 }
784784 break;
785− case FLOAT:
785+ case CT_FLOAT:
786786 cl = MKFLOATc(vm, x->info.f);
787787 break;
788− case STRING:
788+ case CT_STRING:
789789 cl = MKSTRc(vm, x->info.str);
790790 break;
791− case BIGINT:
791+ case CT_BIGINT:
792792 cl = MKBIGMc(vm, x->info.ptr);
793793 break;
794− case PTR:
794+ case CT_PTR:
795795 cl = MKPTRc(vm, x->info.ptr);
796796 break;
797− case MANAGEDPTR:
797+ case CT_MANAGEDPTR:
798798 cl = MKMPTRc(vm, x->info.mptr->data, x->info.mptr->size);
799799 break;
800− case BITS8:
800+ case CT_BITS8:
801801 cl = idris_b8CopyForGC(vm, x);
802802 break;
803− case BITS16:
803+ case CT_BITS16:
804804 cl = idris_b16CopyForGC(vm, x);
805805 break;
806− case BITS32:
806+ case CT_BITS32:
807807 cl = idris_b32CopyForGC(vm, x);
808808 break;
809− case BITS64:
809+ case CT_BITS64:
810810 cl = idris_b64CopyForGC(vm, x);
811811 break;
812− case RAWDATA:
812+ case CT_RAWDATA:
813813 {
814814 size_t size = x->info.size + sizeof(Closure);
815815 cl = allocate(size, 0);
@@ -1019,7 +1019,7 @@ void init_nullaries() {
10191019 nullary_cons = malloc(256 * sizeof(VAL));
10201020 for(i = 0; i < 256; ++i) {
10211021 cl = malloc(sizeof(Closure));
1022− SETTY(cl, CON);
1022+ SETTY(cl, CT_CON);
10231023 cl->info.c.tag_arity = i << 8;
10241024 nullary_cons[i] = cl;
10251025 }
rts/idris_rts.h+9−9
@@ -25,9 +25,9 @@
2525
2626// Closures
2727typedef enum {
28− CON, INT, BIGINT, FLOAT, STRING, STROFFSET,
29− BITS8, BITS16, BITS32, BITS64, UNIT, PTR, FWD,
30− MANAGEDPTR, RAWDATA, CDATA
28+ CT_CON, CT_INT, CT_BIGINT, CT_FLOAT, CT_STRING, CT_STROFFSET,
29+ CT_BITS8, CT_BITS16, CT_BITS32, CT_BITS64, CT_UNIT, CT_PTR, CT_FWD,
30+ CT_MANAGEDPTR, CT_RAWDATA, CT_CDATA
3131} ClosureType;
3232
3333typedef struct Closure *VAL;
@@ -189,10 +189,10 @@ typedef void(*func)(VM*, VAL*);
189189#define GETBITS32(x) (((VAL)(x))->info.bits32)
190190#define GETBITS64(x) (((VAL)(x))->info.bits64)
191191
192−#define TAG(x) (ISINT(x) || x == NULL ? (-1) : ( GETTY(x) == CON ? (x)->info.c.tag_arity >> 8 : (-1)) )
193−#define ARITY(x) (ISINT(x) || x == NULL ? (-1) : ( GETTY(x) == CON ? (x)->info.c.tag_arity & 0x000000ff : (-1)) )
192+#define TAG(x) (ISINT(x) || x == NULL ? (-1) : ( GETTY(x) == CT_CON ? (x)->info.c.tag_arity >> 8 : (-1)) )
193+#define ARITY(x) (ISINT(x) || x == NULL ? (-1) : ( GETTY(x) == CT_CON ? (x)->info.c.tag_arity & 0x000000ff : (-1)) )
194194
195−// Already checked it's a CON
195+// Already checked it's a CT_CON
196196#define CTAG(x) (((x)->info.c.tag_arity) >> 8)
197197#define CARITY(x) ((x)->info.c.tag_arity & 0x000000ff)
198198
@@ -212,7 +212,7 @@ typedef intptr_t i_int;
212212#define MKINT(x) ((void*)((x)<<1)+1)
213213#define GETINT(x) ((i_int)(x)>>1)
214214#define ISINT(x) ((((i_int)x)&1) == 1)
215−#define ISSTR(x) (GETTY(x) == STRING)
215+#define ISSTR(x) (GETTY(x) == CT_STRING)
216216
217217#define INTOP(op,x,y) MKINT((i_int)((((i_int)x)>>1) op (((i_int)y)>>1)))
218218#define UINTOP(op,x,y) MKINT((i_int)((((uintptr_t)x)>>1) op (((uintptr_t)y)>>1)))
@@ -283,12 +283,12 @@ void idris_free(void* ptr, size_t size);
283283
284284#define allocCon(cl, vm, t, a, o) \
285285 cl = allocate(sizeof(Closure) + sizeof(VAL)*a, o); \
286− SETTY(cl, CON); \
286+ SETTY(cl, CT_CON); \
287287 cl->info.c.tag_arity = ((t) << 8) | (a);
288288
289289#define updateCon(cl, old, t, a) \
290290 cl = old; \
291− SETTY(cl, CON); \
291+ SETTY(cl, CT_CON); \
292292 cl->info.c.tag_arity = ((t) << 8) | (a);
293293
294294#define NULL_CON(x) nullary_cons[x]