diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index baf934fc..fa03933a 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index c971536e..2337fa73 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index f5c55397..a76b0c07 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index f8dc8de8..5b3bea8f 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -230,7 +230,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -530,7 +530,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index a4c001f3..bed97db3 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 4692859f..6157e386 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index e78a2d49..76aee9f2 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index baf934fc..fa03933a 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index c971536e..2337fa73 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index f5c55397..a76b0c07 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index f8dc8de8..5b3bea8f 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -139,13 +139,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -162,7 +162,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -230,7 +230,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -530,7 +530,7 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) { int16 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -766,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}}; diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index a4c001f3..bed97db3 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index e3516799..343d9491 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index b8f301f7..776889ff 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index ea06c48a..b1d34288 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 1e741041..5fbd4f23 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index 32b4d836..b285b3ec 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(1, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 432a6e71..51684091 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 55714eaa..14855929 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 4dcd76c5..fb2ef55f 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index ba7f69f4..1f1b65b4 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -61,10 +61,10 @@ typedef export SYSTEM_PTR Heap_modules; static int64 Heap_freeList[10]; static int64 Heap_bigBlocks; -export int64 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -88,12 +88,12 @@ static void Heap_Mark (int64 q); static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, uintptr 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, LONGINT a__len); @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,7 +155,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int64); m->types = typ; @@ -166,15 +166,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int64 _o_result; - int64 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 8, chnk + (24 + blksz), uintptr); + __PUT(chnk + 24, chnk + 32, uintptr); + __PUT(chnk + 32, blksz, uintptr); __PUT(chnk + 40, -8, int64); __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (int64 blksz) } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; @@ -280,21 +280,21 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } @@ -311,28 +311,28 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i += 32; } __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); __PUT(adr + 8, 0, int64); __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int64 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int64)(uintptr)new) + blksz) - 24; __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); + __PUT(tag, blksz, uintptr); __PUT(tag + 8, -8, int64); - __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); + __PUT((int64)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (int64 q) __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (int64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, int64); __PUT(q - 8, tag + 1, int64); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(uintptr)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,8 +408,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -422,7 +422,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,8 +434,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(SYSTEM_ADRINT)obj; + f->obj = (int64)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index e07b0d1e..82ba661b 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 3cc9156d..7db3d54c 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index f1bcc92f..fe368fa3 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index ad99f16a..bab019ae 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -2197,7 +2197,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 82eb03c4..6b193164 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index f67c2556..ee075a94 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 42f6f30d..90ff6275 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index fb89bcd6..44c0d929 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((SYSTEM_ADRINT)&real, i, int32); + __GET((uintptr)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 72257311..3e1ddd3d 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index e270236a..0ac463ca 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 9897c9c2..bd26983c 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index d07d06ca..5ae4fbdf 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index 2aee5b21..5fcf9030 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 6fd27531..94145f3d 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 349849e8..e2409b86 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index d3aa0a87..a99c5bfe 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -940,7 +940,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -956,7 +956,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1328,7 +1328,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 09b50b36..6e3e6c65 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 2a6381d8..7895f7e6 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -140,13 +140,13 @@ extern void Heap_InitHeap(); #define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664) #define Platform_openro(n, n__len) open((char*)n, O_RDONLY) #define Platform_openrw(n, n__len) open((char*)n, O_RDWR) -#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr)(p), l) #define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n) #define Platform_sectotm(s) struct tm *time = localtime((time_t*)&s) #define Platform_seekcur() SEEK_CUR #define Platform_seekend() SEEK_END #define Platform_seekset() SEEK_SET -#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADRINT)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr)h) #define Platform_stat(n, n__len) stat((char*)n, &s) #define Platform_statdev() (LONGINT)s.st_dev #define Platform_statino() (LONGINT)s.st_ino @@ -163,7 +163,7 @@ extern void Heap_InitHeap(); #define Platform_tvsec() tv.tv_sec #define Platform_tvusec() tv.tv_usec #define Platform_unlink(n, n__len) unlink((char*)n) -#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADRINT)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr)(p), l) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -231,7 +231,7 @@ void Platform_Init (int32 argc, int64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -264,7 +264,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -531,7 +531,7 @@ int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) { int32 _o_result; - *n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len); + *n = Platform_readfile(h, (uintptr)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -767,7 +767,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 24), {-8}}; diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 63531c58..7b310e29 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index d6e77abf..4aafefde 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int32); + __GET((uintptr)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int32); + __GET((uintptr)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 2c04bec3..1b6d1f96 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 769cecb7..abf00b3b 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 012e77f9..5280395c 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 934bc227..e8858afa 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index fbd8a7a4..990d15c3 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index f781d7ee..bed71868 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index b1aa1639..2f0938c0 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 049c862a..c2bb7560 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 51975db4..b9d03b09 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 3cba883d..30095155 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index dfa8df9c..5dd451e1 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 139b592e..bcc323cc 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 194e9da8..5cfd3bbe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index fbca10e0..28ac1853 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 5b63f566..c69949e1 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" @@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int16 error; - error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 3823dacc..5f33afb3 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index b53ae4ca..308a2a37 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index c216c6c6..41cd7233 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index 2315b64e..8f51e615 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int32 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -60,10 +60,10 @@ typedef export SYSTEM_PTR Heap_modules; static int32 Heap_freeList[10]; static int32 Heap_bigBlocks; -export int32 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int32 Heap_heap, Heap_heapend; -export int32 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -87,12 +87,12 @@ static void Heap_Mark (int32 q); static void Heap_MarkCandidates (int32 n, int32 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int32 size); -export SYSTEM_PTR Heap_NEWREC (int32 tag); -static int32 Heap_NewChunk (int32 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int32 typ); +export void Heap_REGTYP (Heap_Module m, uintptr typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); static void Heap_Sift (int32 l, int32 r, int32 *a, LONGINT a__len); @@ -101,7 +101,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -134,7 +134,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,7 +154,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int32 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int32); m->types = typ; @@ -165,15 +165,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int32 Heap_NewChunk (int32 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int32 _o_result; - int32 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), int32); - __PUT(chnk + 12, chnk + 16, int32); - __PUT(chnk + 16, blksz, int32); + __PUT(chnk + 4, chnk + (12 + blksz), uintptr); + __PUT(chnk + 12, chnk + 16, uintptr); + __PUT(chnk + 16, blksz, uintptr); __PUT(chnk + 20, -4, int32); __PUT(chnk + 24, Heap_bigBlocks, int32); Heap_bigBlocks = chnk + 12; @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (int32 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int32); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (int32 blksz) } } -SYSTEM_PTR Heap_NEWREC (int32 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int32 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,10 +235,10 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; adr += restsize; @@ -279,21 +279,21 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, int32); + __PUT(end + 4, blksz, uintptr); __PUT(end + 8, -4, int32); __PUT(end, end + 4, int32); if (restsize > 144) { - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, int32); + __PUT(prev + 12, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, int32); + __PUT(adr + 4, restsize, uintptr); __PUT(adr + 12, Heap_freeList[di], int32); Heap_freeList[di] = adr; } @@ -310,28 +310,28 @@ SYSTEM_PTR Heap_NEWREC (int32 tag) i += 16; } __PUT(adr + 12, 0, int32); - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); __PUT(adr + 4, 0, int32); __PUT(adr + 8, 0, int32); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 4); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int32 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int32 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int32)(SYSTEM_ADRINT)new + blksz) - 12; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int32)(uintptr)new) + blksz) - 12; __PUT(tag - 4, 0, int32); - __PUT(tag, blksz, int32); + __PUT(tag, blksz, uintptr); __PUT(tag + 4, -4, int32); - __PUT((int32)(SYSTEM_ADRINT)new - 4, tag, int32); + __PUT((int32)(uintptr)new - 4, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (int32 q) __GET(tag, offset, int32); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (int32 q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, int32); __PUT(q - 4, tag + 1, int32); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (int32 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int32)(SYSTEM_ADRINT)p); + Heap_Mark((int32)(uintptr)p); } static void Heap_Scan (void) { - int32 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,8 +407,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -421,7 +421,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int32); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,8 +433,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, int32); - __PUT(start + 4, freesize, int32); + __PUT(start, start + 4, uintptr); + __PUT(start + 4, freesize, uintptr); __PUT(start + 8, -4, int32); i = __ASHR(freesize, 4); freesize = 0; @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -589,9 +589,9 @@ static void Heap_MarkStack (int32 n, int32 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack) int32 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int32)(SYSTEM_ADRINT)obj; + f->obj = (int32)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 83733c20..771fc9d8 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int32 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int16 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -41,11 +41,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int32 size); -import SYSTEM_PTR Heap_NEWREC (int32 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int32 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index e7006b76..84914960 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index 632138b5..2409c160 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index fa8f98fe..3af88ab8 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -2196,7 +2196,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8b2baa5f..47603929 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index 93d60530..10b51482 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 78a60ed9..a13d99e4 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index 19ad29af..1cd8fb97 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -544,15 +544,15 @@ void OPM_FPrintReal (int32 *fp, REAL real) { int16 i; int32 l; - __GET((SYSTEM_ADRINT)&real, l, int32); + __GET((uintptr)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((SYSTEM_ADRINT)&lr, l, int32); - __GET((SYSTEM_ADRINT)&lr + 4, h, int32); + __GET((uintptr)&lr, l, int32); + __GET((uintptr)&lr + 4, h, int32); OPM_FPrint(&*fp, l); OPM_FPrint(&*fp, h); } diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 44fe5275..f0a96a82 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index b0cd8613..f727dcde 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 423013a4..b8787f9f 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 36b37592..7a14e8c2 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index dec9c209..0e48367c 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 16dfc5b1..32d09e08 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index c290d3de..b12f68e2 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index aeef6224..7a155032 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1327,7 +1327,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 8fd772f8..d45ee079 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 67dc8e39..95b8b50f 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -241,7 +241,7 @@ void Platform_Init (int16 argc, int32 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -559,7 +559,7 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) int16 _o_result; int16 result; *n = 0; - result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (uintptr)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -795,7 +795,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 20), {-4}}; diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 39074f3e..6d983649 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 4e271371..32931aec 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int16); + __GET((uintptr)&x + 2, i, int16); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -66,17 +66,17 @@ int16 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int16 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int16); + __GET((uintptr)&x + 6, i, int16); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index b1e62271..38d206bb 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 439a49e9..728d163f 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 681fcf1c..6e1bcc56 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index e3516799..343d9491 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index b8f301f7..776889ff 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 9224220a..f2e2ae7d 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 6e4f20e5..0dc0c60a 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index f06c706d..4415a5f2 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index 00be6a22..6a7aab56 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 9d9202c0..4e806a33 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 8ca75a42..447b9c81 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 901eed38..3d9d98a7 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index ea06c48a..b1d34288 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/02] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 1e741041..5fbd4f23 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index 7133027a..b73a59cc 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" @@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len); void Console_Flush (void) { int32 error; - error = Platform_Write(Platform_StdOut, (SYSTEM_ADRINT)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (uintptr)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 432a6e71..51684091 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 7eae4cc4..cf6feb16 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf) if (buf->org != f->pos) { error = Platform_Seek(f->fd, buf->org, Platform_SeekSet); } - error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size); + error = Platform_Write(f->fd, (uintptr)buf->data, buf->size); if (error != 0) { Files_Err((CHAR*)"error writing file", 19, f, error); } @@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x } else { min = n; } - __MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min); + __MOVE((uintptr)buf->data + offset, (uintptr)x + xpos, min); offset += min; (*r).offset = offset; xpos += min; @@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT } else { min = n; } - __MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min); + __MOVE((uintptr)x + xpos, (uintptr)buf->data + offset, min); offset += min; (*r).offset = offset; if (offset > buf->size) { @@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, int *res = 3; return; } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n); + error = Platform_Write(fdnew, (uintptr)buf, n); if (error != 0) { ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); Files_Err((CHAR*)"cannot move file", 17, NIL, error); } - error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n); + error = Platform_Read(fdold, (uintptr)buf, 4096, &n); } ignore = Platform_Close(fdold); ignore = Platform_Close(fdnew); @@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de j += 1; } } else { - __MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len); + __MOVE((uintptr)src, (uintptr)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(SYSTEM_ADRINT)o; + f = (Files_File)(uintptr)o; if (f->fd >= 0) { Files_CloseOSFile(f); if (f->tempFile) { @@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len) { __DUP(path, path__len, CHAR); if (Strings_Length(path, path__len) != 0) { - Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((uintptr)((Strings_Length(path, path__len) + 1)))); __COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]); } else { Files_SearchPath = NIL; diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 9a9b3b58..0be3f73d 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index ba7f69f4..1f1b65b4 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - int64 obj; + uintptr obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -61,10 +61,10 @@ typedef export SYSTEM_PTR Heap_modules; static int64 Heap_freeList[10]; static int64 Heap_bigBlocks; -export int64 Heap_allocated; +export uintptr Heap_allocated; static BOOLEAN Heap_firstTry; -static int64 Heap_heap, Heap_heapend; -export int64 Heap_heapsize; +static uintptr Heap_heap, Heap_heapend; +export uintptr Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -88,12 +88,12 @@ static void Heap_Mark (int64 q); static void Heap_MarkCandidates (int64 n, int64 *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (int64 size); -export SYSTEM_PTR Heap_NEWREC (int64 tag); -static int64 Heap_NewChunk (int64 blksz); +export SYSTEM_PTR Heap_NEWBLK (uintptr size); +export SYSTEM_PTR Heap_NEWREC (uintptr tag); +static uintptr Heap_NewChunk (uintptr blksz); export void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); export SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -export void Heap_REGTYP (Heap_Module m, int64 typ); +export void Heap_REGTYP (Heap_Module m, uintptr 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, LONGINT a__len); @@ -102,7 +102,7 @@ export void Heap_Unlock (void); extern void *Heap__init(); extern LONGINT Platform_MainStackFrame; extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer))) +#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) #define Heap_HeapModuleInit() Heap__init() #define Heap_OSAllocate(size) Platform_OSAllocate(size) #define Heap_PlatformHalt(code) Platform_Halt(code) @@ -135,7 +135,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs) __COPY(name, m->name, 20); m->refcnt = 0; m->enumPtrs = enumPtrs; - m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m->next = (Heap_Module)(uintptr)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,7 +155,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, int64 typ) +void Heap_REGTYP (Heap_Module m, uintptr typ) { __PUT(typ, m->types, int64); m->types = typ; @@ -166,15 +166,15 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static int64 Heap_NewChunk (int64 blksz) +static uintptr Heap_NewChunk (uintptr blksz) { - int64 _o_result; - int64 chnk; + uintptr _o_result; + uintptr chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), int64); - __PUT(chnk + 24, chnk + 32, int64); - __PUT(chnk + 32, blksz, int64); + __PUT(chnk + 8, chnk + (24 + blksz), uintptr); + __PUT(chnk + 24, chnk + 32, uintptr); + __PUT(chnk + 32, blksz, uintptr); __PUT(chnk + 40, -8, int64); __PUT(chnk + 48, Heap_bigBlocks, int64); Heap_bigBlocks = chnk + 24; @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (int64 blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, int64); + __PUT(chnk, Heap_heap, uintptr); Heap_heap = chnk; } else { j = Heap_heap; @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (int64 blksz) } } -SYSTEM_PTR Heap_NEWREC (int64 tag) +SYSTEM_PTR Heap_NEWREC (uintptr tag) { SYSTEM_PTR _o_result; - int64 i, i0, di, blksz, restsize, t, adr, end, next, prev; + uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,10 +236,10 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; adr += restsize; @@ -280,21 +280,21 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, int64); + __PUT(end + 8, blksz, uintptr); __PUT(end + 16, -8, int64); __PUT(end, end + 8, int64); if (restsize > 288) { - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, int64); + __PUT(prev + 24, next, uintptr); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, int64); + __PUT(adr + 8, restsize, uintptr); __PUT(adr + 24, Heap_freeList[di], int64); Heap_freeList[di] = adr; } @@ -311,28 +311,28 @@ SYSTEM_PTR Heap_NEWREC (int64 tag) i += 32; } __PUT(adr + 24, 0, int64); - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); __PUT(adr + 8, 0, int64); __PUT(adr + 16, 0, int64); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(SYSTEM_ADRINT)(adr + 8); + _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (int64 size) +SYSTEM_PTR Heap_NEWBLK (uintptr size) { SYSTEM_PTR _o_result; - int64 blksz, tag; + uintptr blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = ((int64)(SYSTEM_ADRINT)new + blksz) - 24; + new = Heap_NEWREC((uintptr)&blksz); + tag = (((int64)(uintptr)new) + blksz) - 24; __PUT(tag - 8, 0, int64); - __PUT(tag, blksz, int64); + __PUT(tag, blksz, uintptr); __PUT(tag + 8, -8, int64); - __PUT((int64)(SYSTEM_ADRINT)new - 8, tag, int64); + __PUT((int64)(uintptr)new - 8, tag, uintptr); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (int64 q) __GET(tag, offset, int64); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (int64 q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, int64); __PUT(q - 8, tag + 1, int64); - __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (int64 q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((int64)(SYSTEM_ADRINT)p); + Heap_Mark((int64)(uintptr)p); } static void Heap_Scan (void) { - int64 chnk, adr, end, start, tag, i, size, freesize; + uintptr chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,8 +408,8 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -422,7 +422,7 @@ static void Heap_Scan (void) } } tag -= 1; - __PUT(adr, tag, int64); + __PUT(adr, tag, uintptr); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,8 +434,8 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, int64); - __PUT(start + 8, freesize, int64); + __PUT(start, start + 8, uintptr); + __PUT(start + 8, freesize, uintptr); __PUT(start + 16, -8, int64); i = __ASHR(freesize, 5); freesize = 0; @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); + (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); } } @@ -590,9 +590,9 @@ static void Heap_MarkStack (int64 n, int64 *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (SYSTEM_ADRINT)&frame; + sp = (uintptr)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align; + inc = (uintptr)&align.p - (uintptr)&align; if (sp > stack0) { inc = -inc; } @@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack) int64 cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(SYSTEM_ADRINT)Heap_modules; + m = (Heap_Module)(uintptr)Heap_modules; while (m != NIL) { if (m->enumPtrs != NIL) { (*m->enumPtrs)(Heap_MarkP); @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = (int64)(SYSTEM_ADRINT)obj; + f->obj = (int64)(uintptr)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index e07b0d1e..82ba661b 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import int64 Heap_allocated, Heap_heapsize; +import uintptr Heap_allocated, Heap_heapsize; import int32 Heap_FileCount; import LONGINT *Heap_ModuleDesc__typ; @@ -42,11 +42,11 @@ import void Heap_GC (BOOLEAN markStack); import void Heap_INCREF (Heap_Module m); import void Heap_InitHeap (void); import void Heap_Lock (void); -import SYSTEM_PTR Heap_NEWBLK (int64 size); -import SYSTEM_PTR Heap_NEWREC (int64 tag); +import SYSTEM_PTR Heap_NEWBLK (uintptr size); +import SYSTEM_PTR Heap_NEWREC (uintptr tag); import void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd); import SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs); -import void Heap_REGTYP (Heap_Module m, int64 typ); +import void Heap_REGTYP (Heap_Module m, uintptr typ); import void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); import void Heap_Unlock (void); import void *Heap__init(void); diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 3cc9156d..7db3d54c 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index f1bcc92f..fe368fa3 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index ad99f16a..bab019ae 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -2197,7 +2197,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno) if (((x->class == 8 || x->class == 9) || __IN(f, 0x0501)) || x->typ->comp == 3) { OPB_err(126); } - if (x->typ->size < p->typ->size) { + if ((x->class != 7 && x->typ->size < p->typ->size)) { OPB_err(-308); } t = OPT_NewNode(11); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 82eb03c4..6b193164 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index f67c2556..ee075a94 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 42f6f30d..90ff6275 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index fb89bcd6..44c0d929 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -545,7 +545,7 @@ void OPM_FPrintReal (int64 *fp, REAL real) { int32 i; int64 l; - __GET((SYSTEM_ADRINT)&real, i, int32); + __GET((uintptr)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 72257311..3e1ddd3d 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index e270236a..0ac463ca 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 9897c9c2..bd26983c 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index d07d06ca..5ae4fbdf 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index 2aee5b21..5fcf9030 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 6fd27531..94145f3d 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 349849e8..e2409b86 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index d3aa0a87..a99c5bfe 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -940,7 +940,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -956,7 +956,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPC_Ident(n->typ->strobj); OPM_Write(')'); if (__IN(n->typ->form, 0x1800) || __IN(l->typ->form, 0x1800)) { - OPM_WriteString((CHAR*)"(SYSTEM_ADRINT)", 16); + OPM_WriteString((CHAR*)"(uintptr)", 10); } OPV_expr(l, exprPrec); } else { @@ -1328,7 +1328,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x) if (x->class == 7) { OPC_IntLiteral(x->conval->intval, OPM_PointerSize); } else { - OPM_WriteString((CHAR*)"((SYSTEM_ADRINT)(", 18); + OPM_WriteString((CHAR*)"((uintptr)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 09b50b36..6e3e6c65 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index 456a43cf..0135ee93 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -242,7 +242,7 @@ void Platform_Init (int32 argc, int64 argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; + av = (Platform_ArgVecPtr)(uintptr)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; + av = (Platform_ArgVec)(uintptr)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -560,7 +560,7 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) int32 _o_result; int32 result; *n = 0; - result = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len, &*n); + result = Platform_readfile(h, (uintptr)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -796,7 +796,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN); + __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); } __TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 40), {-8}}; diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index 3691e5fb..f3b3574f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index d6e77abf..4aafefde 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -59,7 +59,7 @@ int32 Reals_Expo (REAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 2, i, int32); + __GET((uintptr)&x + 2, i, int32); _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } @@ -67,17 +67,17 @@ int32 Reals_Expo (REAL x) void Reals_SetExpo (REAL *x, int32 ex) { CHAR c; - __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); - __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __GET((uintptr)x + 3, c, CHAR); + __PUT((uintptr)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((uintptr)x + 2, c, CHAR); + __PUT((uintptr)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((SYSTEM_ADRINT)&x + 6, i, int32); + __GET((uintptr)&x + 6, i, int32); _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 2c04bec3..1b6d1f96 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 769cecb7..abf00b3b 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 012e77f9..5280395c 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 934bc227..e8858afa 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index fbd8a7a4..990d15c3 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index f781d7ee..bed71868 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index b1aa1639..2f0938c0 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 049c862a..c2bb7560 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 51975db4..b9d03b09 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 3cba883d..30095155 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index dfa8df9c..5dd451e1 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 139b592e..bcc323cc 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/02] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 9f696edc..62be133a 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1208,7 +1208,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) err(126) END; (* Warn if the result type includes memory past the end of the source variable *) - IF x.typ.size < p.typ.size THEN err(-308) END; + IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; (* IF (x^.class >= OPT.Nconst) OR ((f IN OPT.realSet) # (p^.typ^.form IN OPT.realSet)) THEN diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index e23a89ad..cd387568 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -566,7 +566,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, MinPrec); OPM.Write(CloseParen) | OPT.cap: OPM.WriteString("__CAP("); expr(l, MinPrec); OPM.Write(CloseParen) | OPT.odd: OPM.WriteString("__ODD("); expr(l, MinPrec); OPM.Write(CloseParen) - | OPT.adr: OPM.WriteString("(SYSTEM_ADRINT)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(uintptr)"); (*SYSTEM*) IF l^.class = OPT.Nvarpar THEN OPC.CompleteIdent(l^.obj) ELSE IF (l^.typ^.form # OPT.String) & ~(l^.typ^.comp IN {OPT.Array, OPT.DynArr}) THEN OPM.Write("&") END ; @@ -579,7 +579,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); IF (n^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) OR (l^.typ^.form IN {OPT.Pointer, OPT.ProcTyp}) THEN - OPM.WriteString("(SYSTEM_ADRINT)") + OPM.WriteString("(uintptr)") END; expr(l, exprPrec) ELSE @@ -797,7 +797,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 IF typ^.comp = OPT.DynArr THEN IF x^.class = OPT.Nconst THEN OPC.IntLiteral(x.conval.intval, OPM.PointerSize) - ELSE OPM.WriteString("((SYSTEM_ADRINT)("); expr(x, 10); OPM.WriteString("))") + ELSE OPM.WriteString("((uintptr)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 619daf53..6b6411a2 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -30,6 +30,7 @@ MODULE Heap; sntlOff = LONG(LONG(2*SZL)); (* pointer offset table sentinel in free block relative to block start *) nextOff = LONG(LONG(3*SZL)); (* next pointer in free block relative to block start *) NoPtrSntl = LONG(LONG(-SZL)); + (*NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZL);*) LongZero = LONG(LONG(0)); TYPE @@ -64,7 +65,7 @@ MODULE Heap; FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: LONGINT; (* weak pointer *) + obj: SYSTEM.UINTPTR; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; @@ -75,13 +76,13 @@ MODULE Heap; freeList: ARRAY nofLists + 1 OF LONGINT; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) bigBlocks: LONGINT; - allocated*: LONGINT; + allocated*: SYSTEM.UINTPTR; firstTry: BOOLEAN; (* extensible heap *) - heap: LONGINT; (* the sorted list of heap chunks *) - heapend: LONGINT; (* max possible pointer value (used for stack collection) *) - heapsize*: LONGINT; (* the sum of all heap chunk sizes *) + heap: SYSTEM.UINTPTR; (* the sorted list of heap chunks *) + heapend: SYSTEM.UINTPTR; (* max possible pointer value (used for stack collection) *) + heapsize*: SYSTEM.UINTPTR; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -153,7 +154,7 @@ MODULE Heap; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: LONGINT); + PROCEDURE REGTYP*(m: Module; typ: SYSTEM.UINTPTR); BEGIN SYSTEM.PUT(typ, m.types); m.types := typ END REGTYP; @@ -165,8 +166,8 @@ MODULE Heap; PROCEDURE -ExternPlatformOSAllocate "extern uintptr Platform_OSAllocate(uintptr size);"; PROCEDURE -OSAllocate(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: LONGINT): LONGINT; - VAR chnk: LONGINT; + PROCEDURE NewChunk(blksz: SYSTEM.UINTPTR): SYSTEM.UINTPTR; + VAR chnk: SYSTEM.UINTPTR; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN @@ -185,8 +186,13 @@ MODULE Heap; (* FetchAddress fetches a pointer from memory and returns it as a LONGINT. It works correctly regardless of the size of an address. Specifically on 32 bit address architectures with 64 bit LONGINT, it loads 32 bits and extends it to LONGINT - rather than loading 64 bits. *) - PROCEDURE -FetchAddress(pointer: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)(*((void**)((SYSTEM_ADRINT)pointer)))"; + rather than loading 64 bits. + + NOTE - with uintpr work complete this function should be replaces withSYSTEM.GET + as there will be no need to extend addresses to larger types. + + *) + PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; PROCEDURE ExtendHeap(blksz: LONGINT); VAR size, chnk, j, next: LONGINT; @@ -213,16 +219,16 @@ MODULE Heap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: LONGINT): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: SYSTEM.UINTPTR): SYSTEM.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: LONGINT; + i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.UINTPTR; new: SYSTEM.PTR; BEGIN Lock(); blksz := FetchAddress(tag); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) <= SIZE(LONGINT)); + ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.UINTPTR)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -305,8 +311,8 @@ MODULE Heap; RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZL) END NEWREC; - PROCEDURE NEWBLK*(size: LONGINT): SYSTEM.PTR; - VAR blksz, tag: LONGINT; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: SYSTEM.UINTPTR): SYSTEM.PTR; + VAR blksz, tag: SYSTEM.UINTPTR; new: SYSTEM.PTR; BEGIN Lock(); blksz := (size + (4*SZL + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) @@ -364,7 +370,7 @@ MODULE Heap; END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: LONGINT; + VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.UINTPTR; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index 34ee60b6..76c0db89 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (SYSTEM_ADRINT)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (uintptr)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -369,7 +369,7 @@ END Size; PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(SYSTEM_ADRINT)(p), l)"; +"read(fd, (void*)(uintptr)(p), l)"; PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; BEGIN @@ -386,7 +386,7 @@ END ReadBuf; PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(SYSTEM_ADRINT)(p), l)"; +"write(fd, (void*)(uintptr)(p), l)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; VAR written: LONGINT; diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index c83f69f1..31fa97c5 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -39,8 +39,8 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t - +//#define uintptr size_t +#define uintptr int64 // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -255,8 +255,8 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (LONGINT size); -extern SYSTEM_PTR Heap_NEWREC (LONGINT tag); +extern SYSTEM_PTR Heap_NEWBLK (uintptr size); +extern SYSTEM_PTR Heap_NEWREC (uintptr tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len))