From c6388006b987d57b19114986712b115700bd55fe Mon Sep 17 00:00:00 2001 From: David Brown Date: Mon, 19 Dec 2016 16:12:09 +0000 Subject: [PATCH] Update bootstrap C source. --- bootstrap/unix-44/Compiler.c | 2 +- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Files.c | 2 +- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 117 ++++++++++++------------ bootstrap/unix-44/Heap.h | 2 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 2 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 2 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 2 +- bootstrap/unix-44/OPT.h | 2 +- bootstrap/unix-44/OPV.c | 2 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Out.c | 2 +- bootstrap/unix-44/Out.h | 2 +- bootstrap/unix-44/Platform.c | 2 +- bootstrap/unix-44/Platform.h | 2 +- bootstrap/unix-44/Reals.c | 2 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/VT100.c | 2 +- bootstrap/unix-44/VT100.h | 2 +- bootstrap/unix-44/extTools.c | 6 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-48/Compiler.c | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Files.c | 2 +- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 117 ++++++++++++------------ bootstrap/unix-48/Heap.h | 2 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 2 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 2 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 2 +- bootstrap/unix-48/OPT.h | 2 +- bootstrap/unix-48/OPV.c | 2 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Out.c | 2 +- bootstrap/unix-48/Out.h | 2 +- bootstrap/unix-48/Platform.c | 2 +- bootstrap/unix-48/Platform.h | 2 +- bootstrap/unix-48/Reals.c | 2 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/VT100.c | 2 +- bootstrap/unix-48/VT100.h | 2 +- bootstrap/unix-48/extTools.c | 6 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-88/Compiler.c | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Files.c | 2 +- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 131 +++++++++++++-------------- bootstrap/unix-88/Heap.h | 2 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 2 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 2 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 2 +- bootstrap/unix-88/OPT.h | 2 +- bootstrap/unix-88/OPV.c | 2 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Out.c | 2 +- bootstrap/unix-88/Out.h | 2 +- bootstrap/unix-88/Platform.c | 2 +- bootstrap/unix-88/Platform.h | 2 +- bootstrap/unix-88/Reals.c | 2 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/VT100.c | 2 +- bootstrap/unix-88/VT100.h | 2 +- bootstrap/unix-88/extTools.c | 6 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/windows-48/Compiler.c | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Files.c | 2 +- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 117 ++++++++++++------------ bootstrap/windows-48/Heap.h | 2 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 2 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 2 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 2 +- bootstrap/windows-48/OPT.h | 2 +- bootstrap/windows-48/OPV.c | 2 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Out.c | 2 +- bootstrap/windows-48/Out.h | 2 +- bootstrap/windows-48/Platform.c | 2 +- bootstrap/windows-48/Platform.h | 2 +- bootstrap/windows-48/Reals.c | 2 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/VT100.c | 2 +- bootstrap/windows-48/VT100.h | 2 +- bootstrap/windows-48/extTools.c | 6 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-88/Compiler.c | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Files.c | 2 +- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 131 +++++++++++++-------------- bootstrap/windows-88/Heap.h | 2 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 2 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 2 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 2 +- bootstrap/windows-88/OPT.h | 2 +- bootstrap/windows-88/OPV.c | 2 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Out.c | 2 +- bootstrap/windows-88/Out.h | 2 +- bootstrap/windows-88/Platform.c | 2 +- bootstrap/windows-88/Platform.h | 2 +- bootstrap/windows-88/Reals.c | 2 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/VT100.c | 2 +- bootstrap/windows-88/VT100.h | 2 +- bootstrap/windows-88/extTools.c | 6 +- bootstrap/windows-88/extTools.h | 2 +- 185 files changed, 499 insertions(+), 504 deletions(-) diff --git a/bootstrap/unix-44/Compiler.c b/bootstrap/unix-44/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/unix-44/Compiler.c +++ b/bootstrap/unix-44/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 9d302c54..94faa2a1 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index dd99850c..d0b6716f 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index a5b7cd03..d6b6560d 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; export INT32 Heap_heap; -static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT32 Heap_NewChunk (INT32 blksz) __PUT(blk + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 4; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 4; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 4, Heap_heapMin)) { + Heap_heapMin = blk + 4; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (blksz > 160000) { + if (Heap_uLT(160000, blksz)) { size = blksz; } else { size = 160000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT32); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } } __GET(adr + 4, t, INT32); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(end + 4, blksz, INT32); __PUT(end + 8, -4, INT32); __PUT(end, end + 4, INT32); - if (restsize > 144) { + if (Heap_uLT(144, restsize)) { __PUT(adr + 4, restsize, INT32); } else { __GET(adr + 12, next, INT32); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } else { __PUT(prev + 12, next, INT32); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, INT32); __PUT(adr + 12, Heap_freeList[di], INT32); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -492,16 +485,17 @@ static void Heap_Scan (void) static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { - INT32 i, j, x; + INT32 i, j; + INT32 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -511,7 +505,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { - INT32 l, r, x; + INT32 l, r; + INT32 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -529,35 +524,40 @@ static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { - INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT32 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 4, end, INT32); adr = chnk + 12; - __GET(chnk + 4, lim1, INT32); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); adr += size; + ptr = adr + 4; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == n) { + return; + } + } } else { __GET(tag, size, INT32); ptr = adr + 4; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT32); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT32 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT32 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,12 +633,12 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT32); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 2147483647; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-2147483647-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 8a81aea1..87732bb9 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 881bee5a..c498f106 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 9e1502d5..f52b30af 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 5ec11c6f..0fd45dec 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 3199e877..c3e79413 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index fb5288f9..7bfd4abc 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index adffc7a4..e44854e3 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Out.c b/bootstrap/unix-44/Out.c index 5f70ffca..fc487d97 100644 --- a/bootstrap/unix-44/Out.c +++ b/bootstrap/unix-44/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Out.h b/bootstrap/unix-44/Out.h index 4f49bfa7..cbb4de1a 100644 --- a/bootstrap/unix-44/Out.h +++ b/bootstrap/unix-44/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 5900abf5..b646e8b7 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index c628a89b..957af90d 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index c6e6c87a..bb00d7d0 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index f3849ea7..cab12269 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/VT100.c b/bootstrap/unix-44/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/unix-44/VT100.c +++ b/bootstrap/unix-44/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-44/VT100.h b/bootstrap/unix-44/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/unix-44/VT100.h +++ b/bootstrap/unix-44/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/Compiler.c b/bootstrap/unix-48/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/unix-48/Compiler.c +++ b/bootstrap/unix-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 9d302c54..94faa2a1 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index dd99850c..d0b6716f 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index a5b7cd03..d6b6560d 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; export INT32 Heap_heap; -static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT32 Heap_NewChunk (INT32 blksz) __PUT(blk + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 4; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 4; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 4, Heap_heapMin)) { + Heap_heapMin = blk + 4; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (blksz > 160000) { + if (Heap_uLT(160000, blksz)) { size = blksz; } else { size = 160000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT32); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } } __GET(adr + 4, t, INT32); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(end + 4, blksz, INT32); __PUT(end + 8, -4, INT32); __PUT(end, end + 4, INT32); - if (restsize > 144) { + if (Heap_uLT(144, restsize)) { __PUT(adr + 4, restsize, INT32); } else { __GET(adr + 12, next, INT32); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } else { __PUT(prev + 12, next, INT32); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, INT32); __PUT(adr + 12, Heap_freeList[di], INT32); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -492,16 +485,17 @@ static void Heap_Scan (void) static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { - INT32 i, j, x; + INT32 i, j; + INT32 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -511,7 +505,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { - INT32 l, r, x; + INT32 l, r; + INT32 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -529,35 +524,40 @@ static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { - INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT32 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 4, end, INT32); adr = chnk + 12; - __GET(chnk + 4, lim1, INT32); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); adr += size; + ptr = adr + 4; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == n) { + return; + } + } } else { __GET(tag, size, INT32); ptr = adr + 4; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT32); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT32 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT32 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,12 +633,12 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT32); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 2147483647; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-2147483647-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 8a81aea1..87732bb9 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 881bee5a..c498f106 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 9e1502d5..f52b30af 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 5ec11c6f..0fd45dec 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 3199e877..c3e79413 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 13794d5f..fc598571 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index adffc7a4..e44854e3 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Out.c b/bootstrap/unix-48/Out.c index 5f70ffca..fc487d97 100644 --- a/bootstrap/unix-48/Out.c +++ b/bootstrap/unix-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Out.h b/bootstrap/unix-48/Out.h index 4f49bfa7..cbb4de1a 100644 --- a/bootstrap/unix-48/Out.h +++ b/bootstrap/unix-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 5900abf5..b646e8b7 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index c628a89b..957af90d 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 2182dda5..96851302 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index fad4ca32..188b60fb 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/VT100.c b/bootstrap/unix-48/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/unix-48/VT100.c +++ b/bootstrap/unix-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-48/VT100.h b/bootstrap/unix-48/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/unix-48/VT100.h +++ b/bootstrap/unix-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/Compiler.c b/bootstrap/unix-88/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/unix-88/Compiler.c +++ b/bootstrap/unix-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 915b50ff..10fc58d0 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 90be7986..5b4a0859 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index c618f3ef..9f808e0f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; export INT64 Heap_heap; -static INT64 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT64 Heap_heapMin, Heap_heapMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -87,12 +87,12 @@ export void Heap_FINALL (void); static void Heap_Finalize (void); export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len); +static void Heap_HeapSort (INT32 n, INT64 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT64 q); -static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len); +static void Heap_MarkCandidates (INT32 n, INT64 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT64 size); @@ -103,7 +103,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len); +static void Heap_Sift (INT32 l, INT32 r, INT64 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT64 Heap_NewChunk (INT64 blksz) __PUT(blk + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 8; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 8; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 8, Heap_heapMin)) { + Heap_heapMin = blk + 8; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT64 Heap_NewChunk (INT64 blksz) static void Heap_ExtendHeap (INT64 blksz) { INT64 size, chnk, j, next; - if (blksz > 320000) { + if (Heap_uLT(320000, blksz)) { size = blksz; } else { size = 320000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT64); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT64); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT64); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __GET(tag, blksz, INT64); i0 = __ASHR(blksz, 5); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } } __GET(adr + 8, t, INT64); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __PUT(end + 8, blksz, INT64); __PUT(end + 16, -8, INT64); __PUT(end, end + 8, INT64); - if (restsize > 288) { + if (Heap_uLT(288, restsize)) { __PUT(adr + 8, restsize, INT64); } else { __GET(adr + 24, next, INT64); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } else { __PUT(prev + 24, next, INT64); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 5); __PUT(adr + 8, restsize, INT64); __PUT(adr + 24, Heap_freeList[di], INT64); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } i = adr + 32; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT64); __PUT(i + 8, 0, INT64); __PUT(i + 16, 0, INT64); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 24; __GET(chnk + 8, end, INT64); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT64); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { @@ -490,18 +483,19 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) +static void Heap_Sift (INT32 l, INT32 r, INT64 *a, ADDRESS a__len) { - INT64 i, j, x; + INT32 i, j; + INT64 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -509,9 +503,10 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) a[i] = x; } -static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) +static void Heap_HeapSort (INT32 n, INT64 *a, ADDRESS a__len) { - INT64 l, r, x; + INT32 l, r; + INT64 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -527,37 +522,42 @@ static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) } } -static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) +static void Heap_MarkCandidates (INT32 n, INT64 *cand, ADDRESS cand__len) { - INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT64 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 8, end, INT64); adr = chnk + 24; - __GET(chnk + 8, lim1, INT64); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT64); if (__ODD(tag)) { __GET(tag - 1, size, INT64); adr += size; + ptr = adr + 8; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == (INT64)n) { + return; + } + } } else { __GET(tag, size, INT64); ptr = adr + 8; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == (INT64)n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT64); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT64 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT64 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,13 +633,13 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT64); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { - if (nofcand == (INT64)cand__len) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { + if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 9223372036854775807LL; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-9223372036854775807LL-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index cd281d35..ac0c9a94 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 95117c1d..3d520568 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 98b2aa47..13be7215 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 4b66e7f1..dc8eecc1 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index 06c6a681..911d0bf7 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index cd38533c..68c085a5 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 327f244d..7340919d 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Out.c b/bootstrap/unix-88/Out.c index a5f08778..b5fb4689 100644 --- a/bootstrap/unix-88/Out.c +++ b/bootstrap/unix-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Out.h b/bootstrap/unix-88/Out.h index 26039116..fe405da3 100644 --- a/bootstrap/unix-88/Out.h +++ b/bootstrap/unix-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 3c0223f6..0cf3f0c3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 34af667e..38fee3de 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 09c54393..429d0665 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index cc880f07..ac6542ff 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/VT100.c b/bootstrap/unix-88/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/unix-88/VT100.c +++ b/bootstrap/unix-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/unix-88/VT100.h b/bootstrap/unix-88/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/unix-88/VT100.h +++ b/bootstrap/unix-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/Compiler.c b/bootstrap/windows-48/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/windows-48/Compiler.c +++ b/bootstrap/windows-48/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 6557a312..2922b3cd 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 8fbe56ca..b43aa306 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index a5b7cd03..d6b6560d 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT32 Heap_bigBlocks; export INT32 Heap_allocated; static BOOLEAN Heap_firstTry; export INT32 Heap_heap; -static INT32 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT32 Heap_heapMin, Heap_heapMax; export INT32 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT32 Heap_NewChunk (INT32 blksz) __PUT(blk + 12, Heap_bigBlocks, INT32); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 4; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 4; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 4, Heap_heapMin)) { + Heap_heapMin = blk + 4; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT32 Heap_NewChunk (INT32 blksz) static void Heap_ExtendHeap (INT32 blksz) { INT32 size, chnk, j, next; - if (blksz > 160000) { + if (Heap_uLT(160000, blksz)) { size = blksz; } else { size = 160000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT32); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT32); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT32); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __GET(tag, blksz, INT32); i0 = __ASHR(blksz, 4); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 12, next, INT32); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 16; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 48), 6) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } } __GET(adr + 4, t, INT32); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) __PUT(end + 4, blksz, INT32); __PUT(end + 8, -4, INT32); __PUT(end, end + 4, INT32); - if (restsize > 144) { + if (Heap_uLT(144, restsize)) { __PUT(adr + 4, restsize, INT32); } else { __GET(adr + 12, next, INT32); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } else { __PUT(prev + 12, next, INT32); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 4); __PUT(adr + 4, restsize, INT32); __PUT(adr + 12, Heap_freeList[di], INT32); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT32 tag) } i = adr + 16; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT32); __PUT(i + 4, 0, INT32); __PUT(i + 8, 0, INT32); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 12; __GET(chnk + 4, end, INT32); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 4, INT32); __PUT(start + 4, freesize, INT32); __PUT(start + 8, -4, INT32); i = __ASHR(freesize, 4); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 12, Heap_freeList[i], INT32); Heap_freeList[i] = start; } else { @@ -492,16 +485,17 @@ static void Heap_Scan (void) static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) { - INT32 i, j, x; + INT32 i, j; + INT32 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -511,7 +505,8 @@ static void Heap_Sift (INT32 l, INT32 r, INT32 *a, ADDRESS a__len) static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) { - INT32 l, r, x; + INT32 l, r; + INT32 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -529,35 +524,40 @@ static void Heap_HeapSort (INT32 n, INT32 *a, ADDRESS a__len) static void Heap_MarkCandidates (INT32 n, INT32 *cand, ADDRESS cand__len) { - INT32 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT32 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 4, end, INT32); adr = chnk + 12; - __GET(chnk + 4, lim1, INT32); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT32); if (__ODD(tag)) { __GET(tag - 1, size, INT32); adr += size; + ptr = adr + 4; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == n) { + return; + } + } } else { __GET(tag, size, INT32); ptr = adr + 4; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT32); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT32 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT32 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,12 +633,12 @@ static void Heap_MarkStack (INT32 n, INT32 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT32); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 2147483647; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-2147483647-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(128000); __PUT(Heap_heap, 0, INT32); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 8a81aea1..87732bb9 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index bda8ec0b..458d281f 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 9e1502d5..f52b30af 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 5ec11c6f..0fd45dec 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 3199e877..c3e79413 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 13794d5f..fc598571 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index adffc7a4..e44854e3 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Out.c b/bootstrap/windows-48/Out.c index 07ed2f75..ebafde72 100644 --- a/bootstrap/windows-48/Out.c +++ b/bootstrap/windows-48/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Out.h b/bootstrap/windows-48/Out.h index 4f49bfa7..cbb4de1a 100644 --- a/bootstrap/windows-48/Out.h +++ b/bootstrap/windows-48/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index bf9c1b7f..fee81ec0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 99ea737f..19fe26f9 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 2182dda5..96851302 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index fad4ca32..188b60fb 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/VT100.c b/bootstrap/windows-48/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/windows-48/VT100.c +++ b/bootstrap/windows-48/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-48/VT100.h b/bootstrap/windows-48/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/windows-48/VT100.h +++ b/bootstrap/windows-48/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/Compiler.c b/bootstrap/windows-88/Compiler.c index c828f47d..d13ed803 100644 --- a/bootstrap/windows-88/Compiler.c +++ b/bootstrap/windows-88/Compiler.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspamS */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspamS */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index 5fa885ca..eb305bbe 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -19,6 +19,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8.", Configuration_versionLong, 75); + __MOVE("2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8.", Configuration_versionLong, 75); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index af5f5580..d10b5011 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 097b5552..3b7e4c54 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 6ef831df..0093b4e8 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index c618f3ef..9f808e0f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -69,7 +69,7 @@ static INT64 Heap_bigBlocks; export INT64 Heap_allocated; static BOOLEAN Heap_firstTry; export INT64 Heap_heap; -static INT64 Heap_heapNegMin, Heap_heapNegMax, Heap_heapPosMin, Heap_heapPosMax; +static INT64 Heap_heapMin, Heap_heapMax; export INT64 Heap_heapsize; static Heap_FinNode Heap_fin; static INT16 Heap_lockdepth; @@ -87,12 +87,12 @@ export void Heap_FINALL (void); static void Heap_Finalize (void); export INT32 Heap_FreeModule (CHAR *name, ADDRESS name__len); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len); +static void Heap_HeapSort (INT32 n, INT64 *a, ADDRESS a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); static void Heap_Mark (INT64 q); -static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len); +static void Heap_MarkCandidates (INT32 n, INT64 *cand, ADDRESS cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len); export SYSTEM_PTR Heap_NEWBLK (INT64 size); @@ -103,7 +103,7 @@ export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); export void Heap_REGTYP (Heap_Module m, INT64 typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len); +static void Heap_Sift (INT32 l, INT32 r, INT64 *a, ADDRESS a__len); export void Heap_Unlock (void); extern void *Heap__init(); @@ -113,6 +113,8 @@ extern ADDRESS Platform_OSAllocate(ADDRESS size); #define Heap_ModulesHalt(code) Modules_Halt(code) #define Heap_ModulesMainStackFrame() Modules_MainStackFrame #define Heap_OSAllocate(size) Platform_OSAllocate(size) +#define Heap_uLE(x, y) ((size_t)x <= (size_t)y) +#define Heap_uLT(x, y) ((size_t)x < (size_t)y) void Heap_Lock (void) { @@ -213,20 +215,11 @@ static INT64 Heap_NewChunk (INT64 blksz) __PUT(blk + 24, Heap_bigBlocks, INT64); Heap_bigBlocks = blk; Heap_heapsize += blksz; - if (chnk > 0) { - if (chnk < Heap_heapPosMin) { - Heap_heapPosMin = blk + 8; - } - if (end > Heap_heapPosMax) { - Heap_heapPosMax = end; - } - } else { - if (chnk < Heap_heapNegMin) { - Heap_heapNegMin = blk + 8; - } - if (end > Heap_heapNegMax) { - Heap_heapNegMax = end; - } + if (Heap_uLT(blk + 8, Heap_heapMin)) { + Heap_heapMin = blk + 8; + } + if (Heap_uLT(Heap_heapMax, end)) { + Heap_heapMax = end; } } return chnk; @@ -235,20 +228,20 @@ static INT64 Heap_NewChunk (INT64 blksz) static void Heap_ExtendHeap (INT64 blksz) { INT64 size, chnk, j, next; - if (blksz > 320000) { + if (Heap_uLT(320000, blksz)) { size = blksz; } else { size = 320000; } chnk = Heap_NewChunk(size); if (chnk != 0) { - if (chnk < Heap_heap) { + if (Heap_uLT(chnk, Heap_heap)) { __PUT(chnk, Heap_heap, INT64); Heap_heap = chnk; } else { j = Heap_heap; __GET(j, next, INT64); - while ((next != 0 && chnk - next > 0)) { + while ((next != 0 && Heap_uLT(next, chnk))) { j = next; __GET(j, next, INT64); } @@ -266,14 +259,14 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __GET(tag, blksz, INT64); i0 = __ASHR(blksz, 5); i = i0; - if (i < 9) { + if (Heap_uLT(i, 9)) { adr = Heap_freeList[i]; while (adr == 0) { i += 1; adr = Heap_freeList[i]; } } - if (i < 9) { + if (Heap_uLT(i, 9)) { __GET(adr + 24, next, INT64); Heap_freeList[i] = next; if (i != i0) { @@ -296,7 +289,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) if (Heap_firstTry) { Heap_GC(1); blksz += 32; - if (__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2) < Heap_heapsize) { + if (Heap_uLT(Heap_heapsize - Heap_allocated, blksz) || Heap_uLT(__ASHL((Heap_heapsize - Heap_allocated) - blksz, 2), Heap_heapsize)) { Heap_ExtendHeap(__ASHL(__DIV(Heap_allocated + blksz, 96), 7) - Heap_heapsize); } Heap_firstTry = 0; @@ -314,7 +307,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } } __GET(adr + 8, t, INT64); - if (t >= blksz) { + if (Heap_uLE(blksz, t)) { break; } prev = adr; @@ -325,7 +318,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) __PUT(end + 8, blksz, INT64); __PUT(end + 16, -8, INT64); __PUT(end, end + 8, INT64); - if (restsize > 288) { + if (Heap_uLT(288, restsize)) { __PUT(adr + 8, restsize, INT64); } else { __GET(adr + 24, next, INT64); @@ -334,7 +327,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } else { __PUT(prev + 24, next, INT64); } - if (restsize > 0) { + if (restsize != 0) { di = __ASHR(restsize, 5); __PUT(adr + 8, restsize, INT64); __PUT(adr + 24, Heap_freeList[di], INT64); @@ -345,7 +338,7 @@ SYSTEM_PTR Heap_NEWREC (INT64 tag) } i = adr + 32; end = adr + blksz; - while (end - i > 0) { + while (Heap_uLT(i, end)) { __PUT(i, 0, INT64); __PUT(i + 8, 0, INT64); __PUT(i + 16, 0, INT64); @@ -442,17 +435,17 @@ static void Heap_Scan (void) while (chnk != 0) { adr = chnk + 24; __GET(chnk + 8, end, INT64); - while (end - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT64); if (__ODD(tag)) { - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { @@ -471,14 +464,14 @@ static void Heap_Scan (void) adr += size; } } - if (freesize > 0) { + if (freesize != 0) { start = adr - freesize; __PUT(start, start + 8, INT64); __PUT(start + 8, freesize, INT64); __PUT(start + 16, -8, INT64); i = __ASHR(freesize, 5); freesize = 0; - if (i < 9) { + if (Heap_uLT(i, 9)) { __PUT(start + 24, Heap_freeList[i], INT64); Heap_freeList[i] = start; } else { @@ -490,18 +483,19 @@ static void Heap_Scan (void) } } -static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) +static void Heap_Sift (INT32 l, INT32 r, INT64 *a, ADDRESS a__len) { - INT64 i, j, x; + INT32 i, j; + INT64 x; j = l; x = a[j]; for (;;) { i = j; j = __ASHL(j, 1) + 1; - if ((j < r && a[j] < a[j + 1])) { + if ((j < r && Heap_uLT(a[j], a[j + 1]))) { j += 1; } - if (j > r || a[j] <= x) { + if (j > r || Heap_uLE(a[j], x)) { break; } a[i] = a[j]; @@ -509,9 +503,10 @@ static void Heap_Sift (INT64 l, INT64 r, INT64 *a, ADDRESS a__len) a[i] = x; } -static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) +static void Heap_HeapSort (INT32 n, INT64 *a, ADDRESS a__len) { - INT64 l, r, x; + INT32 l, r; + INT64 x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -527,37 +522,42 @@ static void Heap_HeapSort (INT64 n, INT64 *a, ADDRESS a__len) } } -static void Heap_MarkCandidates (INT64 n, INT64 *cand, ADDRESS cand__len) +static void Heap_MarkCandidates (INT32 n, INT64 *cand, ADDRESS cand__len) { - INT64 chnk, adr, tag, next, lim, lim1, i, ptr, size; - chnk = Heap_heap; + INT64 chnk, end, adr, tag, next, i, ptr, size; + chnk = Heap_heap; i = 0; - lim = cand[n - 1]; - while ((chnk != 0 && lim - chnk > 0)) { + while (chnk != 0) { + __GET(chnk + 8, end, INT64); adr = chnk + 24; - __GET(chnk + 8, lim1, INT64); - if (lim1 - lim > 0) { - lim1 = lim; - } - while (lim1 - adr > 0) { + while (Heap_uLT(adr, end)) { __GET(adr, tag, INT64); if (__ODD(tag)) { __GET(tag - 1, size, INT64); adr += size; + ptr = adr + 8; + while (Heap_uLT(cand[i], ptr)) { + i += 1; + if (i == (INT64)n) { + return; + } + } } else { __GET(tag, size, INT64); ptr = adr + 8; - while (ptr - cand[i] > 0) { + adr += size; + while (Heap_uLT(cand[i], ptr)) { i += 1; + if (i == (INT64)n) { + return; + } } - if (i == n) { - return; - } - next = adr + size; - if (next - cand[i] > 0) { + if (Heap_uLT(cand[i], adr)) { Heap_Mark(ptr); } - adr = next; + } + if (Heap_uLE(end, cand[i])) { + adr = end; } } __GET(chnk, chnk, INT64); @@ -619,7 +619,8 @@ void Heap_FINALL (void) static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) { SYSTEM_PTR frame; - INT64 inc, nofcand, sp, p, stack0; + INT32 nofcand; + INT64 inc, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -632,13 +633,13 @@ static void Heap_MarkStack (INT64 n, INT64 *cand, ADDRESS cand__len) sp = (ADDRESS)&frame; stack0 = Heap_ModulesMainStackFrame(); inc = (ADDRESS)&align.p - (ADDRESS)&align; - if (sp - stack0 > 0) { + if (Heap_uLT(stack0, sp)) { inc = -inc; } while (sp != stack0) { __GET(sp, p, INT64); - if ((((p > 0 && p >= Heap_heapPosMin)) && p < Heap_heapPosMax) || (((p < 0 && p >= Heap_heapNegMin)) && p < Heap_heapNegMax)) { - if (nofcand == (INT64)cand__len) { + if ((Heap_uLE(Heap_heapMin, p) && Heap_uLT(p, Heap_heapMax))) { + if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); Heap_MarkCandidates(nofcand, (void*)cand, cand__len); nofcand = 0; @@ -752,17 +753,15 @@ void Heap_InitHeap (void) Heap_heapsize = 0; Heap_allocated = 0; Heap_lockdepth = 0; - Heap_heapPosMin = 9223372036854775807LL; - Heap_heapPosMax = 0; - Heap_heapNegMin = 0; - Heap_heapNegMax = (-9223372036854775807LL-1); + Heap_heapMin = -1; + Heap_heapMax = 0; + Heap_bigBlocks = 0; Heap_heap = Heap_NewChunk(256000); __PUT(Heap_heap, 0, INT64); Heap_firstTry = 1; Heap_freeList[9] = 1; Heap_FileCount = 0; Heap_modules = NIL; - Heap_bigBlocks = 0; Heap_fin = NIL; Heap_interrupted = 0; Heap_HeapModuleInit(); diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index cd281d35..ac0c9a94 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tsSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tsSF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index c210b7d7..539c398c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 98b2aa47..13be7215 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c8ffb553..bb4ea138 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 587f5ca2..6757803a 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index 556ff058..093bb886 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 377385f1..a32c29e0 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 4b66e7f1..dc8eecc1 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index d52e3f0f..f246eacb 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index 06c6a681..911d0bf7 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index c168cbe7..913d2eef 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index b554bf21..abfcd4b8 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 6e983459..9e15ba4e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. tspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. tspaSF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index cd38533c..68c085a5 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index bc21d626..228191bf 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 327f244d..7340919d 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 5d34109a..ea04b5b8 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Out.c b/bootstrap/windows-88/Out.c index 6ad86a73..cb9b1989 100644 --- a/bootstrap/windows-88/Out.c +++ b/bootstrap/windows-88/Out.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Out.h b/bootstrap/windows-88/Out.h index 26039116..fe405da3 100644 --- a/bootstrap/windows-88/Out.h +++ b/bootstrap/windows-88/Out.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Out__h #define Out__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index aa0f4ff3..127901b0 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 7699502f..0b6a96a2 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 2b39fcf1..9b449f98 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 016451be..3e83af42 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index b7456c5c..f9b5310a 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index be22ef18..58f9b546 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 09c54393..429d0665 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index cc880f07..ac6542ff 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/VT100.c b/bootstrap/windows-88/VT100.c index 9b5da2b4..80457921 100644 --- a/bootstrap/windows-88/VT100.c +++ b/bootstrap/windows-88/VT100.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 diff --git a/bootstrap/windows-88/VT100.h b/bootstrap/windows-88/VT100.h index 2c94eb2a..1a589c43 100644 --- a/bootstrap/windows-88/VT100.h +++ b/bootstrap/windows-88/VT100.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef VT100__h #define VT100__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index fd65edea..46b1acc2 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #define SHORTINT INT8 #define INTEGER INT16 @@ -65,7 +65,7 @@ static void extTools_execute (CHAR *title, ADDRESS title__len, CHAR *cmd, ADDRES static void extTools_InitialiseCompilerCommand (CHAR *s, ADDRESS s__len) { - __COPY("i686-w64-mingw32-gcc -g", s, s__len); + __COPY("gcc -g", s, s__len); Strings_Append((CHAR*)" -I \"", 6, (void*)s, s__len); Strings_Append(OPM_ResourceDir, 1024, (void*)s, s__len); Strings_Append((CHAR*)"/include\" ", 11, (void*)s, s__len); @@ -95,7 +95,7 @@ void extTools_LinkMain (CHAR *moduleName, ADDRESS moduleName__len, BOOLEAN stati Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023); Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023); if (statically) { - Strings_Append((CHAR*)"", 1, (void*)cmd, 1023); + Strings_Append((CHAR*)" -static", 9, (void*)cmd, 1023); } Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023); Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023); diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 7d8a92d3..4201df04 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 2.00 [2016/12/18]. Bootstrapping compiler for address size 4, alignment 8. xtspaSF */ +/* voc 2.00 [2016/12/19]. Bootstrapping compiler for address size 8, alignment 8. xtspaSF */ #ifndef extTools__h #define extTools__h