From a865643d6cc68233d213258b90408d369efb6514 Mon Sep 17 00:00:00 2001 From: David Brown Date: Sun, 4 Sep 2016 14:34:24 +0100 Subject: [PATCH] Change of mind: s/uintptr/address/. Replace LONGINT with ADDRESS in Platform*. --- bootstrap/unix-44/Configuration.c | 4 +- bootstrap/unix-44/Configuration.h | 2 +- bootstrap/unix-44/Console.c | 4 +- bootstrap/unix-44/Console.h | 2 +- bootstrap/unix-44/Files.c | 20 +-- bootstrap/unix-44/Files.h | 2 +- bootstrap/unix-44/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-44/Heap.h | 10 +- bootstrap/unix-44/Modules.c | 2 +- bootstrap/unix-44/Modules.h | 2 +- bootstrap/unix-44/OPB.c | 2 +- bootstrap/unix-44/OPB.h | 2 +- bootstrap/unix-44/OPC.c | 9 +- bootstrap/unix-44/OPC.h | 2 +- bootstrap/unix-44/OPM.c | 8 +- bootstrap/unix-44/OPM.h | 2 +- bootstrap/unix-44/OPP.c | 2 +- bootstrap/unix-44/OPP.h | 2 +- bootstrap/unix-44/OPS.c | 2 +- bootstrap/unix-44/OPS.h | 2 +- bootstrap/unix-44/OPT.c | 8 +- bootstrap/unix-44/OPT.h | 4 +- bootstrap/unix-44/OPV.c | 10 +- bootstrap/unix-44/OPV.h | 2 +- bootstrap/unix-44/Platform.c | 51 +++--- bootstrap/unix-44/Platform.h | 18 +-- bootstrap/unix-44/Reals.c | 14 +- bootstrap/unix-44/Reals.h | 2 +- bootstrap/unix-44/SYSTEM.c | 14 +- bootstrap/unix-44/SYSTEM.h | 48 +++--- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Strings.h | 2 +- bootstrap/unix-44/Texts.c | 2 +- bootstrap/unix-44/Texts.h | 2 +- bootstrap/unix-44/Vishap.c | 4 +- bootstrap/unix-44/errors.c | 2 +- bootstrap/unix-44/errors.h | 2 +- bootstrap/unix-44/extTools.c | 2 +- bootstrap/unix-44/extTools.h | 2 +- bootstrap/unix-44/vt100.c | 2 +- bootstrap/unix-44/vt100.h | 2 +- bootstrap/unix-48/Configuration.c | 4 +- bootstrap/unix-48/Configuration.h | 2 +- bootstrap/unix-48/Console.c | 4 +- bootstrap/unix-48/Console.h | 2 +- bootstrap/unix-48/Files.c | 20 +-- bootstrap/unix-48/Files.h | 2 +- bootstrap/unix-48/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-48/Heap.h | 10 +- bootstrap/unix-48/Modules.c | 2 +- bootstrap/unix-48/Modules.h | 2 +- bootstrap/unix-48/OPB.c | 2 +- bootstrap/unix-48/OPB.h | 2 +- bootstrap/unix-48/OPC.c | 9 +- bootstrap/unix-48/OPC.h | 2 +- bootstrap/unix-48/OPM.c | 8 +- bootstrap/unix-48/OPM.h | 2 +- bootstrap/unix-48/OPP.c | 2 +- bootstrap/unix-48/OPP.h | 2 +- bootstrap/unix-48/OPS.c | 2 +- bootstrap/unix-48/OPS.h | 2 +- bootstrap/unix-48/OPT.c | 8 +- bootstrap/unix-48/OPT.h | 4 +- bootstrap/unix-48/OPV.c | 10 +- bootstrap/unix-48/OPV.h | 2 +- bootstrap/unix-48/Platform.c | 51 +++--- bootstrap/unix-48/Platform.h | 18 +-- bootstrap/unix-48/Reals.c | 14 +- bootstrap/unix-48/Reals.h | 2 +- bootstrap/unix-48/SYSTEM.c | 14 +- bootstrap/unix-48/SYSTEM.h | 48 +++--- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Strings.h | 2 +- bootstrap/unix-48/Texts.c | 2 +- bootstrap/unix-48/Texts.h | 2 +- bootstrap/unix-48/Vishap.c | 4 +- bootstrap/unix-48/errors.c | 2 +- bootstrap/unix-48/errors.h | 2 +- bootstrap/unix-48/extTools.c | 2 +- bootstrap/unix-48/extTools.h | 2 +- bootstrap/unix-48/vt100.c | 2 +- bootstrap/unix-48/vt100.h | 2 +- bootstrap/unix-88/Configuration.c | 4 +- bootstrap/unix-88/Configuration.h | 2 +- bootstrap/unix-88/Console.c | 4 +- bootstrap/unix-88/Console.h | 2 +- bootstrap/unix-88/Files.c | 20 +-- bootstrap/unix-88/Files.h | 2 +- bootstrap/unix-88/Heap.c | 222 +++++++++++++-------------- bootstrap/unix-88/Heap.h | 10 +- bootstrap/unix-88/Modules.c | 2 +- bootstrap/unix-88/Modules.h | 2 +- bootstrap/unix-88/OPB.c | 2 +- bootstrap/unix-88/OPB.h | 2 +- bootstrap/unix-88/OPC.c | 9 +- bootstrap/unix-88/OPC.h | 2 +- bootstrap/unix-88/OPM.c | 4 +- bootstrap/unix-88/OPM.h | 2 +- bootstrap/unix-88/OPP.c | 2 +- bootstrap/unix-88/OPP.h | 2 +- bootstrap/unix-88/OPS.c | 2 +- bootstrap/unix-88/OPS.h | 2 +- bootstrap/unix-88/OPT.c | 8 +- bootstrap/unix-88/OPT.h | 4 +- bootstrap/unix-88/OPV.c | 10 +- bootstrap/unix-88/OPV.h | 2 +- bootstrap/unix-88/Platform.c | 51 +++--- bootstrap/unix-88/Platform.h | 18 +-- bootstrap/unix-88/Reals.c | 14 +- bootstrap/unix-88/Reals.h | 2 +- bootstrap/unix-88/SYSTEM.c | 14 +- bootstrap/unix-88/SYSTEM.h | 48 +++--- bootstrap/unix-88/Strings.c | 2 +- bootstrap/unix-88/Strings.h | 2 +- bootstrap/unix-88/Texts.c | 2 +- bootstrap/unix-88/Texts.h | 2 +- bootstrap/unix-88/Vishap.c | 4 +- bootstrap/unix-88/errors.c | 2 +- bootstrap/unix-88/errors.h | 2 +- bootstrap/unix-88/extTools.c | 2 +- bootstrap/unix-88/extTools.h | 2 +- bootstrap/unix-88/vt100.c | 2 +- bootstrap/unix-88/vt100.h | 2 +- bootstrap/windows-48/Configuration.c | 4 +- bootstrap/windows-48/Configuration.h | 2 +- bootstrap/windows-48/Console.c | 4 +- bootstrap/windows-48/Console.h | 2 +- bootstrap/windows-48/Files.c | 20 +-- bootstrap/windows-48/Files.h | 2 +- bootstrap/windows-48/Heap.c | 222 +++++++++++++-------------- bootstrap/windows-48/Heap.h | 10 +- bootstrap/windows-48/Modules.c | 2 +- bootstrap/windows-48/Modules.h | 2 +- bootstrap/windows-48/OPB.c | 2 +- bootstrap/windows-48/OPB.h | 2 +- bootstrap/windows-48/OPC.c | 9 +- bootstrap/windows-48/OPC.h | 2 +- bootstrap/windows-48/OPM.c | 8 +- bootstrap/windows-48/OPM.h | 2 +- bootstrap/windows-48/OPP.c | 2 +- bootstrap/windows-48/OPP.h | 2 +- bootstrap/windows-48/OPS.c | 2 +- bootstrap/windows-48/OPS.h | 2 +- bootstrap/windows-48/OPT.c | 8 +- bootstrap/windows-48/OPT.h | 4 +- bootstrap/windows-48/OPV.c | 10 +- bootstrap/windows-48/OPV.h | 2 +- bootstrap/windows-48/Platform.c | 90 ++++++----- bootstrap/windows-48/Platform.h | 17 +- bootstrap/windows-48/Reals.c | 14 +- bootstrap/windows-48/Reals.h | 2 +- bootstrap/windows-48/SYSTEM.c | 14 +- bootstrap/windows-48/SYSTEM.h | 48 +++--- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Strings.h | 2 +- bootstrap/windows-48/Texts.c | 2 +- bootstrap/windows-48/Texts.h | 2 +- bootstrap/windows-48/Vishap.c | 4 +- bootstrap/windows-48/errors.c | 2 +- bootstrap/windows-48/errors.h | 2 +- bootstrap/windows-48/extTools.c | 2 +- bootstrap/windows-48/extTools.h | 2 +- bootstrap/windows-48/vt100.c | 2 +- bootstrap/windows-48/vt100.h | 2 +- bootstrap/windows-88/Configuration.c | 4 +- bootstrap/windows-88/Configuration.h | 2 +- bootstrap/windows-88/Console.c | 4 +- bootstrap/windows-88/Console.h | 2 +- bootstrap/windows-88/Files.c | 20 +-- bootstrap/windows-88/Files.h | 2 +- bootstrap/windows-88/Heap.c | 222 +++++++++++++-------------- bootstrap/windows-88/Heap.h | 10 +- bootstrap/windows-88/Modules.c | 2 +- bootstrap/windows-88/Modules.h | 2 +- bootstrap/windows-88/OPB.c | 2 +- bootstrap/windows-88/OPB.h | 2 +- bootstrap/windows-88/OPC.c | 9 +- bootstrap/windows-88/OPC.h | 2 +- bootstrap/windows-88/OPM.c | 4 +- bootstrap/windows-88/OPM.h | 2 +- bootstrap/windows-88/OPP.c | 2 +- bootstrap/windows-88/OPP.h | 2 +- bootstrap/windows-88/OPS.c | 2 +- bootstrap/windows-88/OPS.h | 2 +- bootstrap/windows-88/OPT.c | 8 +- bootstrap/windows-88/OPT.h | 4 +- bootstrap/windows-88/OPV.c | 10 +- bootstrap/windows-88/OPV.h | 2 +- bootstrap/windows-88/Platform.c | 90 ++++++----- bootstrap/windows-88/Platform.h | 17 +- bootstrap/windows-88/Reals.c | 14 +- bootstrap/windows-88/Reals.h | 2 +- bootstrap/windows-88/SYSTEM.c | 14 +- bootstrap/windows-88/SYSTEM.h | 48 +++--- bootstrap/windows-88/Strings.c | 2 +- bootstrap/windows-88/Strings.h | 2 +- bootstrap/windows-88/Texts.c | 2 +- bootstrap/windows-88/Texts.h | 2 +- bootstrap/windows-88/Vishap.c | 4 +- bootstrap/windows-88/errors.c | 2 +- bootstrap/windows-88/errors.h | 2 +- bootstrap/windows-88/extTools.c | 2 +- bootstrap/windows-88/extTools.h | 2 +- bootstrap/windows-88/vt100.c | 2 +- bootstrap/windows-88/vt100.h | 2 +- src/compiler/OPB.Mod | 1 + src/compiler/OPC.Mod | 5 +- src/compiler/OPT.Mod | 4 +- src/compiler/OPV.Mod | 8 +- src/compiler/Vishap.Mod | 2 +- src/system/Heap.Mod | 106 ++++++------- src/system/Platformunix.Mod | 34 ++-- src/system/Platformwindows.Mod | 71 +++++---- src/system/SYSTEM.c | 14 +- src/system/SYSTEM.h | 48 +++--- 215 files changed, 1441 insertions(+), 1410 deletions(-) diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 5cfd3bbe..560d018b 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 fa03933a..7a2cc9d0 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 2337fa73..87b9a0a5 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)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((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)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((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)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((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)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, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((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 a76b0c07..4fc7ce7e 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 a003e797..02e6f1cb 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address 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, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)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)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)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 = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address 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 (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address 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, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address 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 84914960..fab3561e 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 2409c160..13abd6d0 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 07797236..1d0b8774 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 8949813a..b702852c 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 1cd8fb97..70121d63 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&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 f0a96a82..fce4bdd3 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f727dcde..dc286221 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b8787f9f..e79b5819 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 7a14e8c2..b90cb34b 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 0e48367c..347c669a 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f151a183..ccfba447 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,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*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,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*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f7f6f6b6..056a333c 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,12 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -59,16 +59,16 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Read (int32 h, address p, address l, address *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -87,7 +87,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); +export int16 Platform_Write (int32 h, address p, address l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -119,7 +119,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -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*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(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, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)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*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -213,24 +213,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -512,7 +512,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +int16 Platform_Read (int32 h, address p, address l, address *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -527,10 +527,10 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int16 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -542,10 +542,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +int16 Platform_Write (int32 h, address p, address l) { int16 _o_result; - int32 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -650,7 +650,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -766,7 +765,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&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 bed97db3..ab1d3003 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,12 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,16 +48,16 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Read (int32 h, address p, address l, address *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import int16 Platform_Write (int32 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&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((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); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&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 38d206bb..9ebc1c17 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/SYSTEM.c b/bootstrap/unix-44/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-44/SYSTEM.c +++ b/bootstrap/unix-44/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 6157e386..8b4c3700 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 76aee9f2..4444900f 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f2e2ae7d..81b2d70f 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 4415a5f2..696219d4 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 6a7aab56..553a3d7d 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 4e806a33..ba9937e8 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 447b9c81..ab305ed1 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 3d9d98a7..71079dc0 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5cfd3bbe..560d018b 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 fa03933a..7a2cc9d0 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 2337fa73..87b9a0a5 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)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((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)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((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)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((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)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, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((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 a76b0c07..4fc7ce7e 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 a003e797..02e6f1cb 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address 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, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)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)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)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 = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address 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 (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address 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, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address 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 84914960..fab3561e 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 2409c160..13abd6d0 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 07797236..1d0b8774 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 8949813a..b702852c 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 1cd8fb97..70121d63 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&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 f0a96a82..fce4bdd3 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f727dcde..dc286221 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b8787f9f..e79b5819 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 7a14e8c2..b90cb34b 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 0e48367c..347c669a 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f151a183..ccfba447 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,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*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,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*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f7f6f6b6..056a333c 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,12 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[256]; export int16 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -59,16 +59,16 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +export int16 Platform_Read (int32 h, address p, address l, address *n); +export int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -87,7 +87,7 @@ export BOOLEAN Platform_TimedOut (int16 e); export BOOLEAN Platform_TooManyFiles (int16 e); export int16 Platform_Truncate (int32 h, int32 l); export int16 Platform_Unlink (CHAR *n, LONGINT n__len); -export int16 Platform_Write (int32 h, int32 p, int32 l); +export int16 Platform_Write (int32 h, address p, address l); static void Platform_YMDHMStoClock (int32 ye, int32 mo, int32 da, int32 ho, int32 mi, int32 se, int32 *t, int32 *d); static void Platform_errch (CHAR c); static void Platform_errint (int32 l); @@ -119,7 +119,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -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*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(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, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)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*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -213,24 +213,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -512,7 +512,7 @@ int16 Platform_Size (int32 h, int32 *l) return _o_result; } -int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) +int16 Platform_Read (int32 h, address p, address l, address *n) { int16 _o_result; *n = Platform_readfile(h, p, l); @@ -527,10 +527,10 @@ int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n) __RETCHK; } -int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) +int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int16 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -542,10 +542,10 @@ int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n) __RETCHK; } -int16 Platform_Write (int32 h, int32 p, int32 l) +int16 Platform_Write (int32 h, address p, address l) { int16 _o_result; - int32 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -650,7 +650,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -766,7 +765,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&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 bed97db3..ab1d3003 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -18,12 +18,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[256]; import int16 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -48,16 +48,16 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); -import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); -import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, int32 *n); +import int16 Platform_Read (int32 h, address p, address l, address *n); +import int16 Platform_ReadBuf (int32 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int16 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -75,7 +75,7 @@ import BOOLEAN Platform_TimedOut (int16 e); import BOOLEAN Platform_TooManyFiles (int16 e); import int16 Platform_Truncate (int32 h, int32 l); import int16 Platform_Unlink (CHAR *n, LONGINT n__len); -import int16 Platform_Write (int32 h, int32 p, int32 l); +import int16 Platform_Write (int32 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&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((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); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&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 38d206bb..9ebc1c17 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/SYSTEM.c b/bootstrap/unix-48/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-48/SYSTEM.c +++ b/bootstrap/unix-48/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 343d9491..b218c1b0 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 776889ff..3174aa9b 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f2e2ae7d..81b2d70f 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 4415a5f2..696219d4 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 6a7aab56..553a3d7d 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 4e806a33..ba9937e8 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 447b9c81..ab305ed1 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 3d9d98a7..71079dc0 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b1d34288..c0502177 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 5fbd4f23..73002e87 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b285b3ec..13a36e69 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)Console_line, Console_pos); + error = Platform_Write(1, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 51684091..bcf5714f 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 14855929..0633202c 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)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((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)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((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)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((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)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, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((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 fb2ef55f..340af571 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 6712b853..b5749b04 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -52,19 +52,19 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -76,33 +76,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address 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, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)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)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), uintptr); - __PUT(chnk + 24, chnk + 32, uintptr); - __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, uintptr); - __PUT(chnk + 48, Heap_bigBlocks, uintptr); + __PUT(chnk + 8, chnk + (24 + blksz), address); + __PUT(chnk + 24, chnk + 32, address); + __PUT(chnk + 32, blksz, address); + __PUT(chnk + 40, -8, address); + __PUT(chnk + 48, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); if (restsize > 288) { - __PUT(adr + 8, restsize, uintptr); + __PUT(adr + 8, restsize, address); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, uintptr); + __PUT(prev + 24, next, address); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 16, 0, uintptr); - __PUT(i + 24, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 16, 0, address); + __PUT(i + 24, 0, address); i += 32; } - __PUT(adr + 24, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, uintptr); - __PUT(adr + 16, 0, uintptr); + __PUT(adr + 24, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 8, 0, address); + __PUT(adr + 16, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); + _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 24; - __PUT(tag - 8, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, uintptr); - __PUT((uintptr)(uintptr)new - 8, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 24; + __PUT(tag - 8, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 8, -8, address); + __PUT((address)(address)new - 8, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, uintptr); + __PUT(q - 8, tagbits + 1, address); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 63)) { - __PUT(q - 8, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; } @@ -358,19 +358,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, uintptr); - __PUT(q - 8, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 8, tagbits + 1, address); + __PUT(q - 8, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,14 +573,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -590,14 +590,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,11 +619,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)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 = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 82ba661b..b547af41 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address 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 (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address 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, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address 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 7db3d54c..bce66b2e 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 fe368fa3..544820fd 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5ede35ed..1414fc79 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 6b193164..718d88bb 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 d4a0fc06..fad896b9 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2048,7 +2048,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2085,7 +2085,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 90ff6275..ac5c7677 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 44c0d929..f410e6d3 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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((uintptr)&real, i, int32); + __GET((address)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 3e1ddd3d..cc77f079 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 0ac463ca..6c3c14fe 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 bd26983c..9aba4ad7 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5ae4fbdf..e0988fb0 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5fcf9030..1601514e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 d5057c1d..c08c86af 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1850,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index aefdfd2a..f50911dd 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 7edc861b..b8c77e55 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,7 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,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*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 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*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 6e3e6c65..92c13a0a 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 7895f7e6..0aab8de3 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -27,12 +27,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export uintptr Platform_MainStackFrame; +export address Platform_MainStackFrame; export int64 Platform_HaltCode; export int32 Platform_PID; export CHAR Platform_CWD[256]; export int32 Platform_ArgCount; -export uintptr Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -60,16 +60,16 @@ export void Platform_Halt (int64 code); export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); export BOOLEAN Platform_NoSuchDirectory (int32 e); -export uintptr Platform_OSAllocate (uintptr size); -export void Platform_OSFree (uintptr address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +export int32 Platform_Read (int64 h, address p, address l, address *n); +export int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); export int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); export BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); export BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -88,7 +88,7 @@ export BOOLEAN Platform_TimedOut (int32 e); export BOOLEAN Platform_TooManyFiles (int32 e); export int32 Platform_Truncate (int64 h, int64 l); export int32 Platform_Unlink (CHAR *n, LONGINT n__len); -export int32 Platform_Write (int64 h, int64 p, int64 l); +export int32 Platform_Write (int64 h, address p, address l); static void Platform_YMDHMStoClock (int64 ye, int64 mo, int64 da, int64 ho, int64 mi, int64 se, int64 *t, int64 *d); static void Platform_errch (CHAR c); static void Platform_errint (int64 l); @@ -120,7 +120,7 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT #define Platform_EXDEV() EXDEV extern void Heap_InitHeap(); #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_allocate(size) (uintptr)((void*)malloc((size_t)size)) +#define Platform_allocate(size) (address)((void*)malloc((size_t)size)) #define Platform_chdir(n, n__len) chdir((char*)n) #define Platform_closefile(fd) close(fd) #define Platform_err() errno @@ -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*)(uintptr)(p), l) +#define Platform_readfile(fd, p, l) read(fd, (void*)(address)(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, (uintptr)h) +#define Platform_sethandler(s, h) SystemSetHandler(s, (address)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*)(uintptr)(p), l) +#define Platform_writefile(fd, p, l) write(fd, (void*)(address)(p), l) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -214,24 +214,24 @@ BOOLEAN Platform_ConnectionFailed (int32 e) return _o_result; } -uintptr Platform_OSAllocate (uintptr size) +address Platform_OSAllocate (address size) { - uintptr _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (uintptr address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (int32 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)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)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -513,7 +513,7 @@ int32 Platform_Size (int64 h, int64 *l) return _o_result; } -int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) +int32 Platform_Read (int64 h, address p, address l, address *n) { int32 _o_result; *n = Platform_readfile(h, p, l); @@ -528,10 +528,10 @@ int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n) __RETCHK; } -int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) +int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n) { int32 _o_result; - *n = Platform_readfile(h, (uintptr)b, b__len); + *n = Platform_readfile(h, (address)b, b__len); if (*n < 0) { *n = 0; _o_result = Platform_err(); @@ -543,10 +543,10 @@ int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n) __RETCHK; } -int32 Platform_Write (int64 h, int64 p, int64 l) +int32 Platform_Write (int64 h, address p, address l) { int32 _o_result; - int64 written; + address written; written = Platform_writefile(h, p, l); if (written < 0) { _o_result = Platform_err(); @@ -651,7 +651,6 @@ static void Platform_errch (CHAR c) static void Platform_errln (void) { - Platform_errch(0x0d); Platform_errch(0x0a); } @@ -767,7 +766,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&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 7b310e29..324566bf 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -19,12 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import uintptr Platform_MainStackFrame; +import address Platform_MainStackFrame; import int64 Platform_HaltCode; import int32 Platform_PID; import CHAR Platform_CWD[256]; import int32 Platform_ArgCount; -import uintptr Platform_ArgVector; +import address Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import CHAR Platform_nl[3]; @@ -49,16 +49,16 @@ import void Platform_Halt (int64 code); import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); import BOOLEAN Platform_NoSuchDirectory (int32 e); -import uintptr Platform_OSAllocate (uintptr size); -import void Platform_OSFree (uintptr address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); -import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); -import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, int64 *n); +import int32 Platform_Read (int64 h, address p, address l, address *n); +import int32 Platform_ReadBuf (int64 h, SYSTEM_BYTE *b, LONGINT b__len, address *n); import int32 Platform_Rename (CHAR *o, LONGINT o__len, CHAR *n, LONGINT n__len); import BOOLEAN Platform_SameFile (Platform_FileIdentity i1, Platform_FileIdentity i2); import BOOLEAN Platform_SameFileTime (Platform_FileIdentity i1, Platform_FileIdentity i2); @@ -76,7 +76,7 @@ import BOOLEAN Platform_TimedOut (int32 e); import BOOLEAN Platform_TooManyFiles (int32 e); import int32 Platform_Truncate (int64 h, int64 l); import int32 Platform_Unlink (CHAR *n, LONGINT n__len); -import int32 Platform_Write (int64 h, int64 p, int64 l); +import int32 Platform_Write (int64 h, address p, address l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index 4aafefde..80ca4829 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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((uintptr)&x + 2, i, int32); + __GET((address)&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((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); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 6, i, int32); + __GET((address)&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 1b6d1f96..da0c1f86 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/SYSTEM.c b/bootstrap/unix-88/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/unix-88/SYSTEM.c +++ b/bootstrap/unix-88/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index abf00b3b..f240e3b4 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5280395c..88b212f1 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 e8858afa..59d184b4 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 990d15c3..d779d5d5 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 bed71868..7a2484a5 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 2f0938c0..1d7e852f 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 c2bb7560..f917a7b6 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b9d03b09..d656f5be 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 30095155..1f0bb8e7 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5dd451e1..22698256 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 bcc323cc..f6c994fa 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5cfd3bbe..560d018b 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 28ac1853..ac266eec 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 c69949e1..5b34dfb9 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 5f33afb3..fd32774b 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 308a2a37..0957fcfb 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)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((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)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((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)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((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int32 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)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, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((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 41cd7233..01dff049 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 a003e797..02e6f1cb 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { @@ -34,7 +34,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -51,19 +51,19 @@ typedef Heap_ModuleName name; int32 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int32 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int16 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -75,33 +75,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address 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, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)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)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -154,9 +154,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -165,17 +165,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 12); if (chnk != 0) { - __PUT(chnk + 4, chnk + (12 + blksz), uintptr); - __PUT(chnk + 12, chnk + 16, uintptr); - __PUT(chnk + 16, blksz, uintptr); - __PUT(chnk + 20, -4, uintptr); - __PUT(chnk + 24, Heap_bigBlocks, uintptr); + __PUT(chnk + 4, chnk + (12 + blksz), address); + __PUT(chnk + 12, chnk + 16, address); + __PUT(chnk + 16, blksz, address); + __PUT(chnk + 20, -4, address); + __PUT(chnk + 24, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 12; Heap_heapsize += blksz; } @@ -183,9 +183,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 160000) { size = blksz; } else { @@ -194,7 +194,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -203,8 +203,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 4); @@ -212,10 +212,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -235,11 +235,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 4); end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -279,22 +279,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 4, blksz, uintptr); - __PUT(end + 8, -4, uintptr); - __PUT(end, end + 4, uintptr); + __PUT(end + 4, blksz, address); + __PUT(end + 8, -4, address); + __PUT(end, end + 4, address); if (restsize > 144) { - __PUT(adr + 4, restsize, uintptr); + __PUT(adr + 4, restsize, address); } else { next = Heap_FetchAddress(adr + 12); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 12, next, uintptr); + __PUT(prev + 12, next, address); } if (restsize > 0) { di = __ASHR(restsize, 4); - __PUT(adr + 4, restsize, uintptr); - __PUT(adr + 12, Heap_freeList[di], uintptr); + __PUT(adr + 4, restsize, address); + __PUT(adr + 12, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -303,53 +303,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 16; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 4, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 12, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 4, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 12, 0, address); i += 16; } - __PUT(adr + 12, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 4, 0, uintptr); - __PUT(adr + 8, 0, uintptr); + __PUT(adr + 12, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 4, 0, address); + __PUT(adr + 8, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 4); + _o_result = (SYSTEM_PTR)(address)(adr + 4); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 12; - __PUT(tag - 4, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 4, -4, uintptr); - __PUT((uintptr)(uintptr)new - 4, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 12; + __PUT(tag - 4, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 4, -4, address); + __PUT((address)(address)new - 4, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 4); if (!__ODD(tagbits)) { - __PUT(q - 4, tagbits + 1, uintptr); + __PUT(q - 4, tagbits + 1, address); p = 0; tag = tagbits + 4; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 31)) { - __PUT(q - 4, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 31)) { + __PUT(q - 4, (tag + offset) + 1, address); if (p == 0) { break; } @@ -357,19 +357,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 4); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 4); if (!__ODD(tagbits)) { - __PUT(n - 4, tagbits + 1, uintptr); - __PUT(q - 4, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 4, tagbits + 1, address); + __PUT(q - 4, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,12 +384,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -407,21 +407,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -433,16 +433,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 4, uintptr); - __PUT(start + 4, freesize, uintptr); - __PUT(start + 8, -4, uintptr); + __PUT(start, start + 4, address); + __PUT(start + 4, freesize, address); + __PUT(start + 8, -4, address); i = __ASHR(freesize, 4); freesize = 0; if (i < 9) { - __PUT(start + 12, Heap_freeList[i], uintptr); + __PUT(start + 12, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 12, Heap_bigBlocks, uintptr); + __PUT(start + 12, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -450,9 +450,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -469,9 +469,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -487,9 +487,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -527,7 +527,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 4); @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,14 +572,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -589,14 +589,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -618,11 +618,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)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 = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -710,7 +710,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(128000); Heap_heapend = Heap_FetchAddress(Heap_heap + 4); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 771fc9d8..ca1d8e95 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -31,7 +31,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address 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 (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address 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, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address 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 84914960..fab3561e 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 2409c160..13abd6d0 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 07797236..1d0b8774 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 47603929..465ba585 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 8949813a..b702852c 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" @@ -200,8 +200,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2047,7 +2047,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2084,7 +2084,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index a13d99e4..2839fb0f 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 1cd8fb97..70121d63 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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((uintptr)&real, l, int32); + __GET((address)&real, l, int32); OPM_FPrint(&*fp, l); } void OPM_FPrintLReal (int32 *fp, LONGREAL lr) { int32 l, h; - __GET((uintptr)&lr, l, int32); - __GET((uintptr)&lr + 4, h, int32); + __GET((address)&lr, l, int32); + __GET((address)&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 f0a96a82..fce4bdd3 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f727dcde..dc286221 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b8787f9f..e79b5819 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 7a14e8c2..b90cb34b 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 0e48367c..347c669a 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f151a183..ccfba447 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -83,7 +83,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1767,7 +1767,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1849,7 +1849,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 41a1b2e4..ce146e6f 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -67,7 +67,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 4272132e..da9a8429 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -285,7 +285,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -938,7 +938,7 @@ static void OPV_expr (OPT_Node n, int16 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -954,7 +954,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*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); } OPV_expr(l, exprPrec); } else { @@ -1326,7 +1326,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*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index d45ee079..600b19bd 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 95b8b50f..e3a21ae0 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef @@ -26,11 +26,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int32 Platform_MainStackFrame, Platform_HaltCode; +export address Platform_MainStackFrame; +export int32 Platform_HaltCode; export int16 Platform_PID; export CHAR Platform_CWD[4096]; export int16 Platform_ArgCount; -export int32 Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int32 Platform_TimeStart; export int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -60,12 +61,12 @@ export void Platform_Halt (int32 code); export int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int16 e); -export void Platform_Init (int16 argc, int32 argvadr); +export void Platform_Init (int16 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); export int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); export BOOLEAN Platform_NoSuchDirectory (int16 e); -export int32 Platform_OSAllocate (int32 size); -export void Platform_OSFree (int32 address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); export int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -111,9 +112,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -121,44 +122,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -173,7 +174,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int16 e) { @@ -224,24 +225,24 @@ BOOLEAN Platform_ConnectionFailed (int16 e) return _o_result; } -int32 Platform_OSAllocate (int32 size) +address Platform_OSAllocate (address size) { - int32 _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int32 address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int16 argc, int32 argvadr) +void Platform_Init (int16 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +281,7 @@ void Platform_GetArg (int16 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -559,7 +560,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, (uintptr)b, b__len, &*n); + result = Platform_readfile(h, (address)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -745,8 +746,23 @@ static void Platform_DisplayHaltCode (int32 code) case -9: Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; + case -10: + Platform_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", 27); + break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); @@ -795,7 +811,7 @@ static void Platform_TestLittleEndian (void) { int16 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&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 6d983649..6d0de5b3 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -19,11 +19,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int32 Platform_MainStackFrame, Platform_HaltCode; +import address Platform_MainStackFrame; +import int32 Platform_HaltCode; import int16 Platform_PID; import CHAR Platform_CWD[4096]; import int16 Platform_ArgCount; -import int32 Platform_ArgVector; +import address Platform_ArgVector; import int16 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int32 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -49,12 +50,12 @@ import void Platform_Halt (int32 code); import int16 Platform_Identify (int32 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int16 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int16 e); -import void Platform_Init (int16 argc, int32 argvadr); +import void Platform_Init (int16 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int32 *t, int32 *d); import int16 Platform_New (CHAR *n, LONGINT n__len, int32 *h); import BOOLEAN Platform_NoSuchDirectory (int16 e); -import int32 Platform_OSAllocate (int32 size); -import void Platform_OSFree (int32 address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int16 Platform_OldRO (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_OldRW (CHAR *n, LONGINT n__len, int32 *h); import int16 Platform_Read (int32 h, int32 p, int32 l, int32 *n); @@ -78,7 +79,7 @@ import int16 Platform_Write (int32 h, int32 p, int32 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) #endif diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 32931aec..8fe37010 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -58,7 +58,7 @@ int16 Reals_Expo (REAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 2, i, int16); + __GET((address)&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((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); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR((int16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK((int16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int16 Reals_ExpoL (LONGREAL x) { int16 _o_result; int16 i; - __GET((uintptr)&x + 6, i, int16); + __GET((address)&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 38d206bb..9ebc1c17 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/SYSTEM.c b/bootstrap/windows-48/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/windows-48/SYSTEM.c +++ b/bootstrap/windows-48/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index 728d163f..a642190c 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 6e1bcc56..f537406e 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 343d9491..b218c1b0 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 776889ff..3174aa9b 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 f2e2ae7d..81b2d70f 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" @@ -81,7 +81,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 0dc0c60a..a5576d43 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 4415a5f2..696219d4 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 6a7aab56..553a3d7d 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 4e806a33..ba9937e8 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 447b9c81..ab305ed1 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 3d9d98a7..71079dc0 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b1d34288..c0502177 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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/03] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/04] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 5fbd4f23..73002e87 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b73a59cc..83c649cf 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)Console_line, Console_pos); + error = Platform_Write(Platform_StdOut, (address)Console_line, Console_pos); Console_pos = 0; } diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 51684091..bcf5714f 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 cf6feb16..1f5e58a0 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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, (uintptr)buf->data, buf->size); + error = Platform_Write(f->fd, (address)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((uintptr)buf->data + offset, (uintptr)x + xpos, min); + __MOVE((address)buf->data + offset, (address)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((uintptr)x + xpos, (uintptr)buf->data + offset, min); + __MOVE((address)x + xpos, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)buf, 4096, &n); while (n > 0) { - error = Platform_Write(fdnew, (uintptr)buf, n); + error = Platform_Write(fdnew, (address)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, (uintptr)buf, 4096, &n); + error = Platform_Read(fdold, (address)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((uintptr)src, (uintptr)dest, src__len); + __MOVE((address)src, (address)dest, src__len); } } @@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o) { Files_File f = NIL; int64 res; - f = (Files_File)(uintptr)o; + f = (Files_File)(address)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, ((uintptr)((Strings_Length(path, path__len) + 1)))); + Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((address)((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 0be3f73d..65de586e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 6712b853..b5749b04 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" @@ -35,7 +35,7 @@ typedef typedef struct Heap_FinDesc { Heap_FinNode next; - uintptr obj; + address obj; BOOLEAN marked; Heap_Finalizer finalize; } Heap_FinDesc; @@ -52,19 +52,19 @@ typedef Heap_ModuleName name; int64 refcnt; Heap_Cmd cmds; - uintptr types; + address types; Heap_EnumProc enumPtrs; int64 reserved1, reserved2; } Heap_ModuleDesc; export SYSTEM_PTR Heap_modules; -static uintptr Heap_freeList[10]; -static uintptr Heap_bigBlocks; -export uintptr Heap_allocated; +static address Heap_freeList[10]; +static address Heap_bigBlocks; +export address Heap_allocated; static BOOLEAN Heap_firstTry; -static uintptr Heap_heap, Heap_heapend; -export uintptr Heap_heapsize; +static address Heap_heap, Heap_heapend; +export address Heap_heapsize; static Heap_FinNode Heap_fin; static int32 Heap_lockdepth; static BOOLEAN Heap_interrupted; @@ -76,33 +76,33 @@ export LONGINT *Heap_FinDesc__typ; export LONGINT *Heap__1__typ; static void Heap_CheckFin (void); -static void Heap_ExtendHeap (uintptr blksz); +static void Heap_ExtendHeap (address blksz); export void Heap_FINALL (void); static void Heap_Finalize (void); export void Heap_GC (BOOLEAN markStack); -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len); +static void Heap_HeapSort (address n, address *a, LONGINT a__len); export void Heap_INCREF (Heap_Module m); export void Heap_InitHeap (void); export void Heap_Lock (void); -static void Heap_Mark (uintptr q); -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len); +static void Heap_Mark (address q); +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len); static void Heap_MarkP (SYSTEM_PTR p); -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len); -export SYSTEM_PTR Heap_NEWBLK (uintptr size); -export SYSTEM_PTR Heap_NEWREC (uintptr tag); -static uintptr Heap_NewChunk (uintptr blksz); +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len); +export SYSTEM_PTR Heap_NEWBLK (address size); +export SYSTEM_PTR Heap_NEWREC (address tag); +static address Heap_NewChunk (address 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, uintptr typ); +export void Heap_REGTYP (Heap_Module m, address typ); export void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize); static void Heap_Scan (void); -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len); +static void Heap_Sift (address l, address r, address *a, LONGINT a__len); export void Heap_Unlock (void); extern void *Heap__init(); -extern uintptr Platform_MainStackFrame; -extern uintptr Platform_OSAllocate(uintptr size); -#define Heap_FetchAddress(pointer) (uintptr)(*((void**)((uintptr)pointer))) +extern address Platform_MainStackFrame; +extern address Platform_OSAllocate(address size); +#define Heap_FetchAddress(pointer) (address)(*((void**)((address)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)(uintptr)Heap_modules; + m->next = (Heap_Module)(address)Heap_modules; Heap_modules = (SYSTEM_PTR)m; _o_result = (void*)m; return _o_result; @@ -155,9 +155,9 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd) m->cmds = c; } -void Heap_REGTYP (Heap_Module m, uintptr typ) +void Heap_REGTYP (Heap_Module m, address typ) { - __PUT(typ, m->types, uintptr); + __PUT(typ, m->types, address); m->types = typ; } @@ -166,17 +166,17 @@ void Heap_INCREF (Heap_Module m) m->refcnt += 1; } -static uintptr Heap_NewChunk (uintptr blksz) +static address Heap_NewChunk (address blksz) { - uintptr _o_result; - uintptr chnk; + address _o_result; + address chnk; chnk = Heap_OSAllocate(blksz + 24); if (chnk != 0) { - __PUT(chnk + 8, chnk + (24 + blksz), uintptr); - __PUT(chnk + 24, chnk + 32, uintptr); - __PUT(chnk + 32, blksz, uintptr); - __PUT(chnk + 40, -8, uintptr); - __PUT(chnk + 48, Heap_bigBlocks, uintptr); + __PUT(chnk + 8, chnk + (24 + blksz), address); + __PUT(chnk + 24, chnk + 32, address); + __PUT(chnk + 32, blksz, address); + __PUT(chnk + 40, -8, address); + __PUT(chnk + 48, Heap_bigBlocks, address); Heap_bigBlocks = chnk + 24; Heap_heapsize += blksz; } @@ -184,9 +184,9 @@ static uintptr Heap_NewChunk (uintptr blksz) return _o_result; } -static void Heap_ExtendHeap (uintptr blksz) +static void Heap_ExtendHeap (address blksz) { - uintptr size, chnk, j, next; + address size, chnk, j, next; if (blksz > 320000) { size = blksz; } else { @@ -195,7 +195,7 @@ static void Heap_ExtendHeap (uintptr blksz) chnk = Heap_NewChunk(size); if (chnk != 0) { if (chnk < Heap_heap) { - __PUT(chnk, Heap_heap, uintptr); + __PUT(chnk, Heap_heap, address); Heap_heap = chnk; } else { j = Heap_heap; @@ -204,8 +204,8 @@ static void Heap_ExtendHeap (uintptr blksz) j = next; next = Heap_FetchAddress(j); } - __PUT(chnk, next, uintptr); - __PUT(j, chnk, uintptr); + __PUT(chnk, next, address); + __PUT(j, chnk, address); } if (next == 0) { Heap_heapend = Heap_FetchAddress(chnk + 8); @@ -213,10 +213,10 @@ static void Heap_ExtendHeap (uintptr blksz) } } -SYSTEM_PTR Heap_NEWREC (uintptr tag) +SYSTEM_PTR Heap_NEWREC (address tag) { SYSTEM_PTR _o_result; - uintptr i, i0, di, blksz, restsize, t, adr, end, next, prev; + address i, i0, di, blksz, restsize, t, adr, end, next, prev; SYSTEM_PTR new; Heap_Lock(); blksz = Heap_FetchAddress(tag); @@ -236,11 +236,11 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) di = i - i0; restsize = __ASHL(di, 5); end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; adr += restsize; } @@ -280,22 +280,22 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) } restsize = t - blksz; end = adr + restsize; - __PUT(end + 8, blksz, uintptr); - __PUT(end + 16, -8, uintptr); - __PUT(end, end + 8, uintptr); + __PUT(end + 8, blksz, address); + __PUT(end + 16, -8, address); + __PUT(end, end + 8, address); if (restsize > 288) { - __PUT(adr + 8, restsize, uintptr); + __PUT(adr + 8, restsize, address); } else { next = Heap_FetchAddress(adr + 24); if (prev == 0) { Heap_bigBlocks = next; } else { - __PUT(prev + 24, next, uintptr); + __PUT(prev + 24, next, address); } if (restsize > 0) { di = __ASHR(restsize, 5); - __PUT(adr + 8, restsize, uintptr); - __PUT(adr + 24, Heap_freeList[di], uintptr); + __PUT(adr + 8, restsize, address); + __PUT(adr + 24, Heap_freeList[di], address); Heap_freeList[di] = adr; } } @@ -304,53 +304,53 @@ SYSTEM_PTR Heap_NEWREC (uintptr tag) i = adr + 32; end = adr + blksz; while (i < end) { - __PUT(i, 0, uintptr); - __PUT(i + 8, 0, uintptr); - __PUT(i + 16, 0, uintptr); - __PUT(i + 24, 0, uintptr); + __PUT(i, 0, address); + __PUT(i + 8, 0, address); + __PUT(i + 16, 0, address); + __PUT(i + 24, 0, address); i += 32; } - __PUT(adr + 24, 0, uintptr); - __PUT(adr, tag, uintptr); - __PUT(adr + 8, 0, uintptr); - __PUT(adr + 16, 0, uintptr); + __PUT(adr + 24, 0, address); + __PUT(adr, tag, address); + __PUT(adr + 8, 0, address); + __PUT(adr + 16, 0, address); Heap_allocated += blksz; Heap_Unlock(); - _o_result = (SYSTEM_PTR)(uintptr)(adr + 8); + _o_result = (SYSTEM_PTR)(address)(adr + 8); return _o_result; } -SYSTEM_PTR Heap_NEWBLK (uintptr size) +SYSTEM_PTR Heap_NEWBLK (address size) { SYSTEM_PTR _o_result; - uintptr blksz, tag; + address blksz, tag; SYSTEM_PTR new; Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); - new = Heap_NEWREC((uintptr)&blksz); - tag = ((uintptr)(uintptr)new + blksz) - 24; - __PUT(tag - 8, 0, uintptr); - __PUT(tag, blksz, uintptr); - __PUT(tag + 8, -8, uintptr); - __PUT((uintptr)(uintptr)new - 8, tag, uintptr); + new = Heap_NEWREC((address)&blksz); + tag = ((address)(address)new + blksz) - 24; + __PUT(tag - 8, 0, address); + __PUT(tag, blksz, address); + __PUT(tag + 8, -8, address); + __PUT((address)(address)new - 8, tag, address); Heap_Unlock(); _o_result = new; return _o_result; } -static void Heap_Mark (uintptr q) +static void Heap_Mark (address q) { - uintptr p, tag, offset, fld, n, tagbits; + address p, tag, offset, fld, n, tagbits; if (q != 0) { tagbits = Heap_FetchAddress(q - 8); if (!__ODD(tagbits)) { - __PUT(q - 8, tagbits + 1, uintptr); + __PUT(q - 8, tagbits + 1, address); p = 0; tag = tagbits + 8; for (;;) { - __GET(tag, offset, uintptr); - if (__BIT((uintptr)&offset, 63)) { - __PUT(q - 8, (tag + offset) + 1, uintptr); + __GET(tag, offset, address); + if (__BIT((address)&offset, 63)) { + __PUT(q - 8, (tag + offset) + 1, address); if (p == 0) { break; } @@ -358,19 +358,19 @@ static void Heap_Mark (uintptr q) q = p; tag = Heap_FetchAddress(q - 8); tag -= 1; - __GET(tag, offset, uintptr); + __GET(tag, offset, address); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, (SYSTEM_PTR)(uintptr)n, SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(address)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); if (n != 0) { tagbits = Heap_FetchAddress(n - 8); if (!__ODD(tagbits)) { - __PUT(n - 8, tagbits + 1, uintptr); - __PUT(q - 8, tag + 1, uintptr); - __PUT(fld, (SYSTEM_PTR)(uintptr)p, SYSTEM_PTR); + __PUT(n - 8, tagbits + 1, address); + __PUT(q - 8, tag + 1, address); + __PUT(fld, (SYSTEM_PTR)(address)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,12 +385,12 @@ static void Heap_Mark (uintptr q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark((uintptr)(uintptr)p); + Heap_Mark((address)(address)p); } static void Heap_Scan (void) { - uintptr chnk, adr, end, start, tag, i, size, freesize; + address chnk, adr, end, start, tag, i, size, freesize; Heap_bigBlocks = 0; i = 1; while (i < 9) { @@ -408,21 +408,21 @@ static void Heap_Scan (void) if (__ODD(tag)) { if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } tag -= 1; - __PUT(adr, tag, uintptr); + __PUT(adr, tag, address); size = Heap_FetchAddress(tag); Heap_allocated += size; adr += size; @@ -434,16 +434,16 @@ static void Heap_Scan (void) } if (freesize > 0) { start = adr - freesize; - __PUT(start, start + 8, uintptr); - __PUT(start + 8, freesize, uintptr); - __PUT(start + 16, -8, uintptr); + __PUT(start, start + 8, address); + __PUT(start + 8, freesize, address); + __PUT(start + 16, -8, address); i = __ASHR(freesize, 5); freesize = 0; if (i < 9) { - __PUT(start + 24, Heap_freeList[i], uintptr); + __PUT(start + 24, Heap_freeList[i], address); Heap_freeList[i] = start; } else { - __PUT(start + 24, Heap_bigBlocks, uintptr); + __PUT(start + 24, Heap_bigBlocks, address); Heap_bigBlocks = start; } } @@ -451,9 +451,9 @@ static void Heap_Scan (void) } } -static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) +static void Heap_Sift (address l, address r, address *a, LONGINT a__len) { - uintptr i, j, x; + address i, j, x; j = l; x = a[j]; for (;;) { @@ -470,9 +470,9 @@ static void Heap_Sift (uintptr l, uintptr r, uintptr *a, LONGINT a__len) a[i] = x; } -static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) +static void Heap_HeapSort (address n, address *a, LONGINT a__len) { - uintptr l, r, x; + address l, r, x; l = __ASHR(n, 1); r = n - 1; while (l > 0) { @@ -488,9 +488,9 @@ static void Heap_HeapSort (uintptr n, uintptr *a, LONGINT a__len) } } -static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkCandidates (address n, address *cand, LONGINT cand__len) { - uintptr chnk, adr, tag, next, lim, lim1, i, ptr, size; + address chnk, adr, tag, next, lim, lim1, i, ptr, size; chnk = Heap_heap; i = 0; lim = cand[n - 1]; @@ -528,7 +528,7 @@ static void Heap_MarkCandidates (uintptr n, uintptr *cand, LONGINT cand__len) static void Heap_CheckFin (void) { Heap_FinNode n; - uintptr tag; + address tag; n = Heap_fin; while (n != NIL) { tag = Heap_FetchAddress(n->obj - 8); @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,14 +573,14 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)((SYSTEM_PTR)(uintptr)n->obj); + (*n->finalize)((SYSTEM_PTR)(address)n->obj); } } -static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) +static void Heap_MarkStack (address n, address *cand, LONGINT cand__len) { SYSTEM_PTR frame; - uintptr inc, nofcand, sp, p, stack0; + address inc, nofcand, sp, p, stack0; struct Heap__1 align; if (n > 0) { Heap_MarkStack(n - 1, cand, cand__len); @@ -590,14 +590,14 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) } if (n == 0) { nofcand = 0; - sp = (uintptr)&frame; + sp = (address)&frame; stack0 = Heap_PlatformMainStackFrame(); - inc = (uintptr)&align.p - (uintptr)&align; + inc = (address)&align.p - (address)&align; if (sp > stack0) { inc = -inc; } while (sp != stack0) { - __GET(sp, p, uintptr); + __GET(sp, p, address); if ((p > Heap_heap && p < Heap_heapend)) { if (nofcand == cand__len) { Heap_HeapSort(nofcand, (void*)cand, cand__len); @@ -619,11 +619,11 @@ static void Heap_MarkStack (uintptr n, uintptr *cand, LONGINT cand__len) void Heap_GC (BOOLEAN markStack) { Heap_Module m; - uintptr i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; - uintptr cand[10000]; + address i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23; + address cand[10000]; if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) { Heap_Lock(); - m = (Heap_Module)(uintptr)Heap_modules; + m = (Heap_Module)(address)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 = (uintptr)(uintptr)obj; + f->obj = (address)(address)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; @@ -711,7 +711,7 @@ void Heap_InitHeap (void) { Heap_heap = Heap_NewChunk(256000); Heap_heapend = Heap_FetchAddress(Heap_heap + 8); - __PUT(Heap_heap, 0, uintptr); + __PUT(Heap_heap, 0, address); Heap_allocated = 0; Heap_firstTry = 1; Heap_freeList[9] = 1; diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 82ba661b..b547af41 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h @@ -32,7 +32,7 @@ typedef import SYSTEM_PTR Heap_modules; -import uintptr Heap_allocated, Heap_heapsize; +import address 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 (uintptr size); -import SYSTEM_PTR Heap_NEWREC (uintptr tag); +import SYSTEM_PTR Heap_NEWBLK (address size); +import SYSTEM_PTR Heap_NEWREC (address 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, uintptr typ); +import void Heap_REGTYP (Heap_Module m, address 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 7db3d54c..bce66b2e 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 fe368fa3..544820fd 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5ede35ed..1414fc79 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 6b193164..718d88bb 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 d4a0fc06..fad896b9 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -201,8 +201,8 @@ void OPC_Ident (OPT_Object obj) } } } else if ((mode == 5 && obj->typ->form == 4)) { - if (obj->typ == OPT_pinttyp) { - OPM_WriteString((CHAR*)"uintptr", 8); + if (obj->typ == OPT_adrtyp) { + OPM_WriteString((CHAR*)"address", 8); } else { OPM_WriteString((CHAR*)"int", 4); OPM_WriteInt(__ASHL(obj->typ->size, 3)); @@ -2048,7 +2048,7 @@ static void OPC_InitKeywords (void) OPC_hashtab[__X(i, 105)] = -1; i += 1; } - Enter__49((CHAR*)"adrint", 7); + Enter__49((CHAR*)"address", 8); Enter__49((CHAR*)"asm", 4); Enter__49((CHAR*)"auto", 5); Enter__49((CHAR*)"break", 6); @@ -2085,7 +2085,6 @@ static void OPC_InitKeywords (void) Enter__49((CHAR*)"struct", 7); Enter__49((CHAR*)"switch", 7); Enter__49((CHAR*)"typedef", 8); - Enter__49((CHAR*)"uintptr", 8); Enter__49((CHAR*)"uint16", 7); Enter__49((CHAR*)"uint32", 7); Enter__49((CHAR*)"uint64", 7); diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 90ff6275..ac5c7677 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 44c0d929..f410e6d3 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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((uintptr)&real, i, int32); + __GET((address)&real, i, int32); l = i; OPM_FPrint(&*fp, l); } diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 3e1ddd3d..cc77f079 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 0ac463ca..6c3c14fe 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 bd26983c..9aba4ad7 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5ae4fbdf..e0988fb0 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5fcf9030..1601514e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/04] 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 d5057c1d..c08c86af 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -84,7 +84,7 @@ typedef export void (*OPT_typSize)(OPT_Struct); export OPT_Object OPT_topScope; -export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; @@ -1768,7 +1768,7 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_sinttyp); P(OPT_inttyp); P(OPT_linttyp); - P(OPT_pinttyp); + P(OPT_adrtyp); P(OPT_int8typ); P(OPT_int16typ); P(OPT_int32typ); @@ -1850,7 +1850,7 @@ export void *OPT__init(void) OPT_InitStruct(&OPT_niltyp, 9); OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); - OPT_EnterTyp((CHAR*)"UINTPTR", 4, OPM_PointerSize, &OPT_pinttyp); + OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index aefdfd2a..f50911dd 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,7 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); import OPT_Object OPT_topScope; -import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_pinttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; +import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 7edc861b..b8c77e55 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -286,7 +286,7 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_realtyp->strobj->linkadr = 2; OPT_inttyp->strobj->linkadr = 2; OPT_linttyp->strobj->linkadr = 2; - OPT_pinttyp->strobj->linkadr = 2; + OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; @@ -939,7 +939,7 @@ static void OPV_expr (OPT_Node n, int32 prec) OPM_Write(')'); break; case 24: - OPM_WriteString((CHAR*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 10); if (l->class == 1) { OPC_CompleteIdent(l->obj); } else { @@ -955,7 +955,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*)"(uintptr)", 10); + OPM_WriteString((CHAR*)"(address)", 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*)"((uintptr)(", 12); + OPM_WriteString((CHAR*)"((address)(", 12); OPV_expr(x, 10); OPM_WriteString((CHAR*)"))", 3); } diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 6e3e6c65..92c13a0a 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 0135ee93..128d21e0 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -27,11 +27,12 @@ typedef export BOOLEAN Platform_LittleEndian; -export int64 Platform_MainStackFrame, Platform_HaltCode; +export address Platform_MainStackFrame; +export int64 Platform_HaltCode; export int32 Platform_PID; export CHAR Platform_CWD[4096]; export int32 Platform_ArgCount; -export int64 Platform_ArgVector; +export address Platform_ArgVector; static Platform_HaltProcedure Platform_HaltHandler; static int64 Platform_TimeStart; export int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; @@ -61,12 +62,12 @@ export void Platform_Halt (int64 code); export int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); export int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); export BOOLEAN Platform_Inaccessible (int32 e); -export void Platform_Init (int32 argc, int64 argvadr); +export void Platform_Init (int32 argc, address argvadr); export void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); export int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); export BOOLEAN Platform_NoSuchDirectory (int32 e); -export int64 Platform_OSAllocate (int64 size); -export void Platform_OSFree (int64 address); +export address Platform_OSAllocate (address size); +export void Platform_OSFree (address address); export int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); export int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); @@ -112,9 +113,9 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT extern void Heap_InitHeap(); #define Platform_GetTickCount() (LONGINT)(uint32)GetTickCount() #define Platform_HeapInitHeap() Heap_InitHeap() -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) -#define Platform_allocate(size) (LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) +#define Platform_allocate(size) (address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size)) #define Platform_bhfiIndexHigh() (LONGINT)bhfi.nFileIndexHigh #define Platform_bhfiIndexLow() (LONGINT)bhfi.nFileIndexLow #define Platform_bhfiMtimeHigh() (LONGINT)bhfi.ftLastWriteTime.dwHighDateTime @@ -122,44 +123,44 @@ extern void Heap_InitHeap(); #define Platform_bhfiVsn() (LONGINT)bhfi.dwVolumeSerialNumber #define Platform_byHandleFileInformation() BY_HANDLE_FILE_INFORMATION bhfi #define Platform_cleanupProcess() CloseHandle(pi.hProcess); CloseHandle(pi.hThread); -#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h) +#define Platform_closeHandle(h) (INTEGER)CloseHandle((HANDLE)(address)h) #define Platform_createProcess(str, str__len) (INTEGER)CreateProcess(0, (char*)str, 0,0,0,0,0,0,&si,&pi) #define Platform_deleteFile(n, n__len) (INTEGER)DeleteFile((char*)n) #define Platform_err() (INTEGER)GetLastError() -#define Platform_errc(c) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0) -#define Platform_errstring(s, s__len) WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0) +#define Platform_errc(c) WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0) +#define Platform_errstring(s, s__len) WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0) #define Platform_exit(code) ExitProcess((UINT)code) #define Platform_fileTimeToSysTime() SYSTEMTIME st; FileTimeToSystemTime(&ft, &st) -#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address) +#define Platform_flushFileBuffers(h) (INTEGER)FlushFileBuffers((HANDLE)(address)h) +#define Platform_free(address) HeapFree(GetProcessHeap(), 0, (void*)address) #define Platform_ftToUli() ULARGE_INTEGER ul; ul.LowPart=ft.dwLowDateTime; ul.HighPart=ft.dwHighDateTime #define Platform_getCurrentDirectory(n, n__len) GetCurrentDirectory(n__len, (char*)n) #define Platform_getExitCodeProcess(exitcode) GetExitCodeProcess(pi.hProcess, (DWORD*)exitcode); -#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi) -#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart -#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li) +#define Platform_getFileInformationByHandle(h) (INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi) +#define Platform_getFilePos(h, r, rc) LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart +#define Platform_getFileSize(h) (INTEGER)GetFileSizeEx((HANDLE)(address)h, &li) #define Platform_getLocalTime() SYSTEMTIME st; GetLocalTime(&st) #define Platform_getenv(name, name__len, buf, buf__len) (INTEGER)GetEnvironmentVariable((char*)name, (char*)buf, buf__len) #define Platform_getpid() (INTEGER)GetCurrentProcessId() -#define Platform_getstderrhandle() (SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE) -#define Platform_getstdinhandle() (SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE) -#define Platform_getstdouthandle() (SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE) +#define Platform_getstderrhandle() (address)GetStdHandle(STD_ERROR_HANDLE) +#define Platform_getstdinhandle() (address)GetStdHandle(STD_INPUT_HANDLE) +#define Platform_getstdouthandle() (address)GetStdHandle(STD_OUTPUT_HANDLE) #define Platform_identityToFileTime(i) FILETIME ft; ft.dwHighDateTime = i.mtimehigh; ft.dwLowDateTime = i.mtimelow -#define Platform_invalidHandleValue() ((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE) +#define Platform_invalidHandleValue() ((LONGINT)(address)INVALID_HANDLE_VALUE) #define Platform_largeInteger() LARGE_INTEGER li #define Platform_liLongint() (LONGINT)li.QuadPart #define Platform_moveFile(o, o__len, n, n__len) (INTEGER)MoveFileEx((char*)o, (char*)n, MOVEFILE_REPLACE_EXISTING) -#define Platform_opennew(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openro(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) -#define Platform_openrw(n, n__len) (LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_opennew(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openro(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) +#define Platform_openrw(n, n__len) (LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0) #define Platform_processInfo() PROCESS_INFORMATION pi = {0}; -#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0) +#define Platform_readfile(fd, p, l, n) (INTEGER)ReadFile ((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, (DWORD*)n, 0) #define Platform_seekcur() FILE_CURRENT #define Platform_seekend() FILE_END #define Platform_seekset() FILE_BEGIN #define Platform_setCurrentDirectory(n, n__len) (INTEGER)SetCurrentDirectory((char*)n) -#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h) -#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r) +#define Platform_setEndOfFile(h) (INTEGER)SetEndOfFile((HANDLE)(address)h) +#define Platform_setFilePointerEx(h, o, r, rc) li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r) #define Platform_sleep(ms) Sleep((DWORD)ms) #define Platform_stToFt() FILETIME ft; SystemTimeToFileTime(&st, &ft) #define Platform_startupInfo() STARTUPINFO si = {0}; si.cb = sizeof(si); @@ -174,7 +175,7 @@ extern void Heap_InitHeap(); #define Platform_ulSec() (LONGINT)(ul.QuadPart / 1000000LL) #define Platform_uluSec() (LONGINT)(ul.QuadPart % 1000000LL) #define Platform_waitForProcess() (INTEGER)WaitForSingleObject(pi.hProcess, INFINITE) -#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0) +#define Platform_writefile(fd, p, l) (INTEGER)WriteFile((HANDLE)(address)fd, (void*)(address)(p), (DWORD)l, 0,0) BOOLEAN Platform_TooManyFiles (int32 e) { @@ -225,24 +226,24 @@ BOOLEAN Platform_ConnectionFailed (int32 e) return _o_result; } -int64 Platform_OSAllocate (int64 size) +address Platform_OSAllocate (address size) { - int64 _o_result; + address _o_result; _o_result = Platform_allocate(size); return _o_result; } -void Platform_OSFree (int64 address) +void Platform_OSFree (address address) { Platform_free(address); } -void Platform_Init (int32 argc, int64 argvadr) +void Platform_Init (int32 argc, address argvadr) { Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = (Platform_ArgVecPtr)(uintptr)argvadr; + av = (Platform_ArgVecPtr)(address)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +282,7 @@ void Platform_GetArg (int32 n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = (Platform_ArgVec)(uintptr)Platform_ArgVector; + av = (Platform_ArgVec)(address)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -560,7 +561,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, (uintptr)b, b__len, &*n); + result = Platform_readfile(h, (address)b, b__len, &*n); if (result == 0) { *n = 0; _o_result = Platform_err(); @@ -746,8 +747,23 @@ static void Platform_DisplayHaltCode (int64 code) case -9: Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60); break; + case -10: + Platform_errstring((CHAR*)"NIL access.", 12); + break; + case -11: + Platform_errstring((CHAR*)"Alignment error.", 17); + break; + case -12: + Platform_errstring((CHAR*)"Divide by zero.", 16); + break; + case -13: + Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31); + break; + case -14: + Platform_errstring((CHAR*)"Invalid function argument.", 27); + break; case -15: - Platform_errstring((CHAR*)"Type descriptor size mismatch.", 31); + Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52); break; case -20: Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60); @@ -796,7 +812,7 @@ static void Platform_TestLittleEndian (void) { int32 i; i = 1; - __GET((uintptr)&i, Platform_LittleEndian, BOOLEAN); + __GET((address)&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 f3b3574f..25f6197f 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h @@ -20,11 +20,12 @@ typedef import BOOLEAN Platform_LittleEndian; -import int64 Platform_MainStackFrame, Platform_HaltCode; +import address Platform_MainStackFrame; +import int64 Platform_HaltCode; import int32 Platform_PID; import CHAR Platform_CWD[4096]; import int32 Platform_ArgCount; -import int64 Platform_ArgVector; +import address Platform_ArgVector; import int32 Platform_SeekSet, Platform_SeekCur, Platform_SeekEnd; import int64 Platform_StdIn, Platform_StdOut, Platform_StdErr; import CHAR Platform_nl[3]; @@ -50,12 +51,12 @@ import void Platform_Halt (int64 code); import int32 Platform_Identify (int64 h, Platform_FileIdentity *identity, LONGINT *identity__typ); import int32 Platform_IdentifyByName (CHAR *n, LONGINT n__len, Platform_FileIdentity *identity, LONGINT *identity__typ); import BOOLEAN Platform_Inaccessible (int32 e); -import void Platform_Init (int32 argc, int64 argvadr); +import void Platform_Init (int32 argc, address argvadr); import void Platform_MTimeAsClock (Platform_FileIdentity i, int64 *t, int64 *d); import int32 Platform_New (CHAR *n, LONGINT n__len, int64 *h); import BOOLEAN Platform_NoSuchDirectory (int32 e); -import int64 Platform_OSAllocate (int64 size); -import void Platform_OSFree (int64 address); +import address Platform_OSAllocate (address size); +import void Platform_OSFree (address address); import int32 Platform_OldRO (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_OldRW (CHAR *n, LONGINT n__len, int64 *h); import int32 Platform_Read (int64 h, int64 p, int64 l, int64 *n); @@ -79,7 +80,7 @@ import int32 Platform_Write (int64 h, int64 p, int64 l); import BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT val__len); import void *Platform__init(void); -#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((SYSTEM_ADRINT)h) -#define Platform_SetQuitHandler(h) SystemSetQuitHandler((SYSTEM_ADRINT)h) +#define Platform_SetInterruptHandler(h) SystemSetInterruptHandler((address)h) +#define Platform_SetQuitHandler(h) SystemSetQuitHandler((address)h) #endif diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index 4aafefde..80ca4829 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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((uintptr)&x + 2, i, int32); + __GET((address)&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((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); + __GET((address)x + 3, c, CHAR); + __PUT((address)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((address)x + 2, c, CHAR); + __PUT((address)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } int32 Reals_ExpoL (LONGREAL x) { int32 _o_result; int32 i; - __GET((uintptr)&x + 6, i, int32); + __GET((address)&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 1b6d1f96..da0c1f86 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/SYSTEM.c b/bootstrap/windows-88/SYSTEM.c index 16681ab8..821a6096 100644 --- a/bootstrap/windows-88/SYSTEM.c +++ b/bootstrap/windows-88/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index abf00b3b..f240e3b4 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5280395c..88b212f1 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 e8858afa..59d184b4 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 990d15c3..d779d5d5 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 bed71868..7a2484a5 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/04] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -82,7 +82,7 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_realtyp->size = OPM_RealSize; OPT_inttyp->size = OPM_IntSize; OPT_linttyp->size = OPM_LIntSize; - OPT_pinttyp->size = OPM_PointerSize; + OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; OPT_sinttyp->size = OPM_SIntSize; OPT_booltyp->size = OPM_BoolSize; diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 2f0938c0..1d7e852f 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 c2bb7560..f917a7b6 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 b9d03b09..d656f5be 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 30095155..1f0bb8e7 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 5dd451e1..22698256 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 bcc323cc..f6c994fa 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/03] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/04] 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 73832049..44b11ad9 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -1213,6 +1213,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (x.class # OPT.Nconst) & (x.typ.size < p.typ.size) THEN err(-308) END; IF (x.class = OPT.Nconst) & (x.typ.form = OPT.Int) & (p.typ.form = OPT.Int) THEN + (* Convert integer constants in place allowing usage in CONST section. *) Convert(x, p.typ) ELSE t := OPT.NewNode(OPT.Nmop); t^.subcl := OPT.val; t^.left := x; x := t; diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index f8c71ee8..362a72df 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -117,7 +117,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) IF keytab[hashtab[h]] = obj^.name THEN OPM.Write('_') END END ELSIF (mode = OPT.Typ) & (obj.typ.form = OPT.Int) THEN - IF obj.typ = OPT.pinttyp THEN OPM.WriteString("uintptr") + IF obj.typ = OPT.adrtyp THEN OPM.WriteString("address") ELSE OPM.WriteString("int"); OPM.WriteInt(obj.typ.size*8) END ELSE @@ -1320,7 +1320,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) BEGIN n := 0; FOR i := 0 TO 104 DO hashtab[i] := -1 END ; - Enter("adrint"); (* pseudo keyword used by voc *) + Enter("address"); (* pseudo keyword used by voc *) Enter("asm"); Enter("auto"); Enter("break"); @@ -1357,7 +1357,6 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) Enter("struct"); Enter("switch"); Enter("typedef"); - Enter("uintptr"); (* pseudo keyword used by voc *) Enter("uint16"); (* pseudo keyword used by voc *) Enter("uint32"); (* pseudo keyword used by voc *) Enter("uint64"); (* pseudo keyword used by voc *) diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 19bfdb47..8b21b9a5 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -155,7 +155,7 @@ VAR undftyp*, bytetyp*, booltyp*, chartyp*, sinttyp*, inttyp*, linttyp*, - pinttyp*, + adrtyp*, int8typ*, int16typ*, int32typ*, int64typ*, realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; @@ -1188,7 +1188,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*initialization of module SYSTEM*) EnterTyp("BYTE", Byte, OPM.ByteSize, bytetyp); EnterTyp("PTR", Pointer, OPM.PointerSize, sysptrtyp); - EnterTyp("UINTPTR", Int, OPM.PointerSize, pinttyp); + EnterTyp("ADDRESS", Int, OPM.PointerSize, adrtyp); EnterTyp("INT8", Int, 1, int8typ); EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 25cc2898..7cc0fe38 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -205,7 +205,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.realtyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; - OPT.pinttyp^.strobj^.linkadr := PredefinedType; + OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; @@ -565,7 +565,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("(uintptr)"); (*SYSTEM*) + | OPT.adr: OPM.WriteString("(address)"); (*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 ; @@ -578,7 +578,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("(uintptr)") + OPM.WriteString("(address)") END; expr(l, exprPrec) ELSE @@ -796,7 +796,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("((uintptr)("); expr(x, 10); OPM.WriteString("))") + ELSE OPM.WriteString("((address)("); expr(x, 10); OPM.WriteString("))") END ; x := x^.link ELSE diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 615a032c..3323883d 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -58,7 +58,7 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.realtyp.size := OPM.RealSize; OPT.inttyp.size := OPM.IntSize; OPT.linttyp.size := OPM.LIntSize; - OPT.pinttyp.size := OPM.PointerSize; + OPT.adrtyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; OPT.sinttyp.size := OPM.SIntSize; OPT.booltyp.size := OPM.BoolSize diff --git a/src/system/Heap.Mod b/src/system/Heap.Mod index 00c106dd..e1fc81c4 100644 --- a/src/system/Heap.Mod +++ b/src/system/Heap.Mod @@ -6,7 +6,7 @@ MODULE Heap; CONST ModNameLen = 20; CmdNameLen = 24; - SZA = SIZE(SYSTEM.UINTPTR); (* Size of address *) + SZA = SIZE(SYSTEM.ADDRESS); (* Size of address *) Unit = 4*SZA; (* smallest possible heap block *) nofLists = 9; (* number of free_lists *) heapSize0 = 8000*Unit; (* startup heap size *) @@ -20,17 +20,17 @@ MODULE Heap; *) (* heap chunks *) - nextChnkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* next heap chunk, sorted ascendingly! *) - endOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* end of heap chunk *) - blkOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* first block in a chunk *) + nextChnkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* next heap chunk, sorted ascendingly! *) + endOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* end of heap chunk *) + blkOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* first block in a chunk *) (* heap blocks *) - tagOff = SYSTEM.VAL(SYSTEM.UINTPTR, 0); (* block starts with tag *) - sizeOff = SYSTEM.VAL(SYSTEM.UINTPTR, SZA); (* block size in free block relative to block start *) - sntlOff = SYSTEM.VAL(SYSTEM.UINTPTR, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) - nextOff = SYSTEM.VAL(SYSTEM.UINTPTR, 3*SZA); (* next pointer in free block relative to block start *) - NoPtrSntl = SYSTEM.VAL(SYSTEM.UINTPTR, -SZA); - AddressZero = SYSTEM.VAL(SYSTEM.UINTPTR, 0); + tagOff = SYSTEM.VAL(SYSTEM.ADDRESS, 0); (* block starts with tag *) + sizeOff = SYSTEM.VAL(SYSTEM.ADDRESS, SZA); (* block size in free block relative to block start *) + sntlOff = SYSTEM.VAL(SYSTEM.ADDRESS, 2*SZA); (* pointer offset table sentinel in free block relative to block start *) + nextOff = SYSTEM.VAL(SYSTEM.ADDRESS, 3*SZA); (* next pointer in free block relative to block start *) + NoPtrSntl = SYSTEM.VAL(SYSTEM.ADDRESS, -SZA); + AddressZero = SYSTEM.VAL(SYSTEM.ADDRESS, 0); TYPE ModuleName = ARRAY ModNameLen OF CHAR; @@ -46,7 +46,7 @@ MODULE Heap; name: ModuleName; refcnt: LONGINT; cmds: Cmd; - types: SYSTEM.UINTPTR; + types: SYSTEM.ADDRESS; enumPtrs: EnumProc; reserved1, reserved2: LONGINT END ; @@ -64,7 +64,7 @@ MODULE Heap; FinNode = POINTER TO FinDesc; FinDesc = RECORD next: FinNode; - obj: SYSTEM.UINTPTR; (* weak pointer *) + obj: SYSTEM.ADDRESS; (* weak pointer *) marked: BOOLEAN; finalize: Finalizer; END ; @@ -73,15 +73,15 @@ MODULE Heap; (* the list of loaded (=initialization started) modules *) modules*: SYSTEM.PTR; - freeList: ARRAY nofLists + 1 OF SYSTEM.UINTPTR; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) - bigBlocks: SYSTEM.UINTPTR; - allocated*: SYSTEM.UINTPTR; + freeList: ARRAY nofLists + 1 OF SYSTEM.ADDRESS; (* dummy, 16, 32, 48, 64, 80, 96, 112, 128, sentinel *) + bigBlocks: SYSTEM.ADDRESS; + allocated*: SYSTEM.ADDRESS; firstTry: BOOLEAN; (* extensible heap *) - 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 *) + heap: SYSTEM.ADDRESS; (* the sorted list of heap chunks *) + heapend: SYSTEM.ADDRESS; (* max possible pointer value (used for stack collection) *) + heapsize*: SYSTEM.ADDRESS; (* the sum of all heap chunk sizes *) (* finalization candidates *) fin: FinNode; @@ -153,7 +153,7 @@ MODULE Heap; COPY(name, c.name); c.cmd := cmd; c.next := m.cmds; m.cmds := c END REGCMD; - PROCEDURE REGTYP*(m: Module; typ: SYSTEM.UINTPTR); + PROCEDURE REGTYP*(m: Module; typ: SYSTEM.ADDRESS); BEGIN SYSTEM.PUT(typ, m.types); m.types := typ END REGTYP; @@ -162,11 +162,11 @@ MODULE Heap; END INCREF; - PROCEDURE -ExternPlatformOSAllocate "extern uintptr Platform_OSAllocate(uintptr size);"; - PROCEDURE -OSAllocate(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "Platform_OSAllocate(size)"; + PROCEDURE -ExternPlatformOSAllocate "extern address Platform_OSAllocate(address size);"; + PROCEDURE -OSAllocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "Platform_OSAllocate(size)"; - PROCEDURE NewChunk(blksz: SYSTEM.UINTPTR): SYSTEM.UINTPTR; - VAR chnk: SYSTEM.UINTPTR; + PROCEDURE NewChunk(blksz: SYSTEM.ADDRESS): SYSTEM.ADDRESS; + VAR chnk: SYSTEM.ADDRESS; BEGIN chnk := OSAllocate(blksz + blkOff); IF chnk # 0 THEN @@ -191,10 +191,10 @@ MODULE Heap; as there will be no need to extend addresses to larger types. *) - PROCEDURE -FetchAddress(pointer: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)(*((void**)((uintptr)pointer)))"; + PROCEDURE -FetchAddress(pointer: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)(*((void**)((address)pointer)))"; - PROCEDURE ExtendHeap(blksz: SYSTEM.UINTPTR); - VAR size, chnk, j, next: SYSTEM.UINTPTR; + PROCEDURE ExtendHeap(blksz: SYSTEM.ADDRESS); + VAR size, chnk, j, next: SYSTEM.ADDRESS; BEGIN IF blksz > 10000*Unit THEN size := blksz ELSE size := 10000*Unit (* additional heuristics *) @@ -218,16 +218,16 @@ MODULE Heap; PROCEDURE ^GC*(markStack: BOOLEAN); - PROCEDURE NEWREC*(tag: SYSTEM.UINTPTR): SYSTEM.PTR; + PROCEDURE NEWREC*(tag: SYSTEM.ADDRESS): SYSTEM.PTR; VAR - i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.UINTPTR; + i, i0, di, blksz, restsize, t, adr, end, next, prev: SYSTEM.ADDRESS; new: SYSTEM.PTR; BEGIN Lock(); blksz := FetchAddress(tag); ASSERT((Unit = 16) OR (Unit = 32)); - ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.UINTPTR)); + ASSERT(SIZE(SYSTEM.PTR) = SIZE(SYSTEM.ADDRESS)); ASSERT(blksz MOD Unit = 0); i0 := blksz DIV Unit; i := i0; @@ -310,23 +310,23 @@ MODULE Heap; RETURN SYSTEM.VAL(SYSTEM.PTR, adr + SZA) END NEWREC; - PROCEDURE NEWBLK*(size: SYSTEM.UINTPTR): SYSTEM.PTR; - VAR blksz, tag: SYSTEM.UINTPTR; new: SYSTEM.PTR; + PROCEDURE NEWBLK*(size: SYSTEM.ADDRESS): SYSTEM.PTR; + VAR blksz, tag: SYSTEM.ADDRESS; new: SYSTEM.PTR; BEGIN Lock(); blksz := (size + (4*SZA + Unit - 1)) DIV Unit * Unit; (*size + tag + meta + blksz + sntnl + UnitAlignment*) new := NEWREC(SYSTEM.ADR(blksz)); - tag := SYSTEM.VAL(SYSTEM.UINTPTR, new) + blksz - 3*SZA; + tag := SYSTEM.VAL(SYSTEM.ADDRESS, new) + blksz - 3*SZA; SYSTEM.PUT(tag - SZA, AddressZero); (*reserved for meta info*) SYSTEM.PUT(tag, blksz); SYSTEM.PUT(tag + SZA, NoPtrSntl); - SYSTEM.PUT(SYSTEM.VAL(SYSTEM.UINTPTR, new) - SZA, tag); + SYSTEM.PUT(SYSTEM.VAL(SYSTEM.ADDRESS, new) - SZA, tag); Unlock(); RETURN new END NEWBLK; - PROCEDURE Mark(q: SYSTEM.UINTPTR); - VAR p, tag, offset, fld, n, tagbits: SYSTEM.UINTPTR; + PROCEDURE Mark(q: SYSTEM.ADDRESS); + VAR p, tag, offset, fld, n, tagbits: SYSTEM.ADDRESS; BEGIN IF q # 0 THEN tagbits := FetchAddress(q - SZA); (* Load the tag for the record at q *) @@ -336,7 +336,7 @@ MODULE Heap; tag := tagbits + SZA; (* Tag addresses first offset *) LOOP SYSTEM.GET(tag, offset); (* Get next ptr field offset *) - IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.UINTPTR)*8 - 1) THEN + IF SYSTEM.BIT(SYSTEM.ADR(offset), SIZE(SYSTEM.ADDRESS)*8 - 1) THEN (* Sentinel reached: Value is -8*(#fields+1) *) SYSTEM.PUT(q - SZA, tag + offset + 1); (* Rotate base ptr into tag *) IF p = 0 THEN EXIT END ; @@ -366,11 +366,11 @@ MODULE Heap; PROCEDURE MarkP(p: SYSTEM.PTR); (* for compatibility with EnumPtrs in ANSI mode *) BEGIN - Mark(SYSTEM.VAL(SYSTEM.UINTPTR, p)) + Mark(SYSTEM.VAL(SYSTEM.ADDRESS, p)) END MarkP; PROCEDURE Scan; - VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.UINTPTR; + VAR chnk, adr, end, start, tag, i, size, freesize: SYSTEM.ADDRESS; BEGIN bigBlocks := 0; i := 1; WHILE i < nofLists DO freeList[i] := 0; INC(i) END ; freesize := 0; allocated := 0; chnk := heap; @@ -415,8 +415,8 @@ MODULE Heap; END END Scan; - PROCEDURE Sift (l, r: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); - VAR i, j, x: SYSTEM.UINTPTR; + PROCEDURE Sift (l, r: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); + VAR i, j, x: SYSTEM.ADDRESS; BEGIN j := l; x := a[j]; LOOP i := j; j := 2*j + 1; IF (j < r) & (a[j] < a[j+1]) THEN INC(j) END; @@ -426,15 +426,15 @@ MODULE Heap; a[i] := x END Sift; - PROCEDURE HeapSort (n: SYSTEM.UINTPTR; VAR a: ARRAY OF SYSTEM.UINTPTR); - VAR l, r, x: SYSTEM.UINTPTR; + PROCEDURE HeapSort (n: SYSTEM.ADDRESS; VAR a: ARRAY OF SYSTEM.ADDRESS); + VAR l, r, x: SYSTEM.ADDRESS; BEGIN l := n DIV 2; r := n - 1; WHILE l > 0 DO DEC(l); Sift(l, r, a) END; WHILE r > 0 DO x := a[0]; a[0] := a[r]; a[r] := x; DEC(r); Sift(l, r, a) END END HeapSort; - PROCEDURE MarkCandidates(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); - VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.UINTPTR; + PROCEDURE MarkCandidates(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); + VAR chnk, adr, tag, next, lim, lim1, i, ptr, size: SYSTEM.ADDRESS; BEGIN chnk := heap; i := 0; lim := cand[n-1]; WHILE (chnk # 0 ) & (chnk < lim) DO @@ -460,7 +460,7 @@ MODULE Heap; END MarkCandidates; PROCEDURE CheckFin; - VAR n: FinNode; tag: SYSTEM.UINTPTR; + VAR n: FinNode; tag: SYSTEM.ADDRESS; BEGIN n := fin; WHILE n # NIL DO @@ -496,14 +496,14 @@ MODULE Heap; END END FINALL; - PROCEDURE -ExternMainStackFrame "extern uintptr Platform_MainStackFrame;"; - PROCEDURE -PlatformMainStackFrame(): SYSTEM.UINTPTR "Platform_MainStackFrame"; + PROCEDURE -ExternMainStackFrame "extern address Platform_MainStackFrame;"; + PROCEDURE -PlatformMainStackFrame(): SYSTEM.ADDRESS "Platform_MainStackFrame"; - PROCEDURE MarkStack(n: SYSTEM.UINTPTR; VAR cand: ARRAY OF SYSTEM.UINTPTR); + PROCEDURE MarkStack(n: SYSTEM.ADDRESS; VAR cand: ARRAY OF SYSTEM.ADDRESS); VAR frame: SYSTEM.PTR; - inc, nofcand: SYSTEM.UINTPTR; - sp, p, stack0: SYSTEM.UINTPTR; + inc, nofcand: SYSTEM.ADDRESS; + sp, p, stack0: SYSTEM.ADDRESS; align: RECORD ch: CHAR; p: SYSTEM.PTR END ; BEGIN IF n > 0 THEN MarkStack(n-1, cand); (* flush register windows by means of recursive calls *) @@ -530,8 +530,8 @@ MODULE Heap; PROCEDURE GC*(markStack: BOOLEAN); VAR m: Module; - i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.UINTPTR; - cand: ARRAY 10000 OF SYSTEM.UINTPTR; + i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, i10, i11, i12, i13, i14, i15, i16, i17, i18, i19, i20, i21, i22, i23: SYSTEM.ADDRESS; + cand: ARRAY 10000 OF SYSTEM.ADDRESS; BEGIN IF (lockdepth = 0) OR (lockdepth = 1) & ~markStack THEN Lock(); @@ -566,7 +566,7 @@ MODULE Heap; PROCEDURE RegisterFinalizer*(obj: SYSTEM.PTR; finalize: Finalizer); VAR f: FinNode; BEGIN NEW(f); - f.obj := SYSTEM.VAL(SYSTEM.UINTPTR, obj); f.finalize := finalize; f.marked := TRUE; + f.obj := SYSTEM.VAL(SYSTEM.ADDRESS, obj); f.finalize := finalize; f.marked := TRUE; f.next := fin; fin := f; END RegisterFinalizer; diff --git a/src/system/Platformunix.Mod b/src/system/Platformunix.Mod index f950f2a3..cbd5b646 100644 --- a/src/system/Platformunix.Mod +++ b/src/system/Platformunix.Mod @@ -27,13 +27,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: SYSTEM.UINTPTR; + MainStackFrame-: SYSTEM.ADDRESS; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 256 OF CHAR; ArgCount-: INTEGER; - ArgVector-: SYSTEM.UINTPTR; + ArgVector-: SYSTEM.ADDRESS; HaltHandler: HaltProcedure; TimeStart: LONGINT; @@ -106,11 +106,11 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate (size: SYSTEM.UINTPTR): SYSTEM.UINTPTR "(uintptr)((void*)malloc((size_t)size))"; -PROCEDURE OSAllocate*(size: SYSTEM.UINTPTR): SYSTEM.UINTPTR; BEGIN RETURN allocate(size) END OSAllocate; +PROCEDURE -allocate (size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)malloc((size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: SYSTEM.UINTPTR) "free((void*)address)"; -PROCEDURE OSFree*(address: SYSTEM.UINTPTR); BEGIN free(address) END OSFree; +PROCEDURE -free(address: SYSTEM.ADDRESS) "free((void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; @@ -120,7 +120,7 @@ PROCEDURE OSFree*(address: SYSTEM.UINTPTR); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: LONGINT); +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; @@ -189,7 +189,7 @@ END ArgPos; (* Signals and traps *) -PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (uintptr)h)"; +PROCEDURE -sethandler(s: INTEGER; h: SignalHandler) "SystemSetHandler(s, (address)h)"; PROCEDURE SetInterruptHandler*(handler: SignalHandler); BEGIN sethandler(2, handler); END SetInterruptHandler; @@ -368,16 +368,16 @@ END Size; -PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"read(fd, (void*)(uintptr)(p), l)"; +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"read(fd, (void*)(address)(p), l)"; -PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; BEGIN n := readfile(h, p, l); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; BEGIN n := readfile(h, SYSTEM.ADR(b), LEN(b)); IF n < 0 THEN n := 0; RETURN err() ELSE RETURN 0 END @@ -385,11 +385,11 @@ END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): LONGINT -"write(fd, (void*)(uintptr)(p), l)"; +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"write(fd, (void*)(address)(p), l)"; -PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; - VAR written: LONGINT; +PROCEDURE Write*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): ErrorCode; + VAR written: SYSTEM.ADDRESS; BEGIN written := writefile(h, p, l); IF written < 0 THEN RETURN err() ELSE RETURN 0 END @@ -467,7 +467,7 @@ BEGIN exit(code) END Exit; PROCEDURE -errstring(s: ARRAY OF CHAR) 'write(1, s, s__len-1)'; PROCEDURE -errc (c: CHAR) 'write(1, &c, 1)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; -PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; +PROCEDURE errln; BEGIN errch(0AX) END errln; PROCEDURE errposint(l: LONGINT); BEGIN IF l>10 THEN errposint(l DIV 10) END; errch(CHR(ORD('0') + (l MOD 10))) END errposint; diff --git a/src/system/Platformwindows.Mod b/src/system/Platformwindows.Mod index 7511e427..272180b8 100644 --- a/src/system/Platformwindows.Mod +++ b/src/system/Platformwindows.Mod @@ -30,13 +30,13 @@ TYPE VAR LittleEndian-: BOOLEAN; - MainStackFrame-: LONGINT; + MainStackFrame-: SYSTEM.ADDRESS; HaltCode-: LONGINT; PID-: INTEGER; (* Note: Must be updated by Fork implementation *) CWD-: ARRAY 4096 OF CHAR; ArgCount-: INTEGER; - ArgVector-: LONGINT; + ArgVector-: SYSTEM.ADDRESS; HaltHandler: HaltProcedure; TimeStart: LONGINT; @@ -104,11 +104,11 @@ BEGIN RETURN (e = ECONNREFUSED()) OR (e = ECONNABORTED()) (* OS memory allocaton *) -PROCEDURE -allocate(size: LONGINT): LONGINT "(LONGINT)(SYSTEM_ADRINT)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; -PROCEDURE OSAllocate*(size: LONGINT): LONGINT; BEGIN RETURN allocate(size) END OSAllocate; +PROCEDURE -allocate(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS "(address)((void*)HeapAlloc(GetProcessHeap(), 0, (size_t)size))"; +PROCEDURE OSAllocate*(size: SYSTEM.ADDRESS): SYSTEM.ADDRESS; BEGIN RETURN allocate(size) END OSAllocate; -PROCEDURE -free(address: LONGINT) "HeapFree(GetProcessHeap(), 0, (void*)(SYSTEM_ADRINT)address)"; -PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; +PROCEDURE -free(address: SYSTEM.ADDRESS) "HeapFree(GetProcessHeap(), 0, (void*)address)"; +PROCEDURE OSFree*(address: SYSTEM.ADDRESS); BEGIN free(address) END OSFree; @@ -118,7 +118,7 @@ PROCEDURE OSFree*(address: LONGINT); BEGIN free(address) END OSFree; PROCEDURE -ExternInitHeap "extern void Heap_InitHeap();"; PROCEDURE -HeapInitHeap() "Heap_InitHeap()"; -PROCEDURE Init*(argc: INTEGER; argvadr: LONGINT); +PROCEDURE Init*(argc: INTEGER; argvadr: SYSTEM.ADDRESS); VAR av: ArgVecPtr; BEGIN MainStackFrame := argvadr; @@ -200,8 +200,8 @@ END ArgPos; (* Ctrl/c handling *) -PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((SYSTEM_ADRINT)h)"; -PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((SYSTEM_ADRINT)h)"; +PROCEDURE -SetInterruptHandler*(h: SignalHandler) "SystemSetInterruptHandler((address)h)"; +PROCEDURE -SetQuitHandler* (h: SignalHandler) "SystemSetQuitHandler((address)h)"; PROCEDURE SetBadInstructionHandler*(handler: SignalHandler); BEGIN (* TODO *) END SetBadInstructionHandler; @@ -293,16 +293,16 @@ PROCEDURE Error*(): ErrorCode; BEGIN RETURN err() END Error; (* File system *) -PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(SYSTEM_ADRINT)INVALID_HANDLE_VALUE)"; +PROCEDURE -invalidHandleValue(): LONGINT "((LONGINT)(address)INVALID_HANDLE_VALUE)"; PROCEDURE -openrw (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -openro (n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ , FILE_SHARE_READ|FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)"; PROCEDURE -opennew(n: ARRAY OF CHAR): LONGINT -"(LONGINT)(SYSTEM_ADRINT)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; +"(LONGINT)(address)CreateFile((char*)n, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0)"; @@ -332,7 +332,7 @@ END New; -PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -closeHandle(h: FileHandle): INTEGER "(INTEGER)CloseHandle((HANDLE)(address)h)"; PROCEDURE Close*(h: FileHandle): ErrorCode; BEGIN @@ -342,7 +342,7 @@ END Close; PROCEDURE -byHandleFileInformation "BY_HANDLE_FILE_INFORMATION bhfi"; -PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(SYSTEM_ADRINT)h, &bhfi)"; +PROCEDURE -getFileInformationByHandle(h: FileHandle): INTEGER "(INTEGER)GetFileInformationByHandle((HANDLE)(address)h, &bhfi)"; PROCEDURE -bhfiMtimeHigh(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwHighDateTime"; PROCEDURE -bhfiMtimeLow(): LONGINT "(LONGINT)bhfi.ftLastWriteTime.dwLowDateTime"; PROCEDURE -bhfiVsn(): LONGINT "(LONGINT)bhfi.dwVolumeSerialNumber"; @@ -401,7 +401,7 @@ END MTimeAsClock; PROCEDURE -largeInteger "LARGE_INTEGER li"; PROCEDURE -liLongint(): LONGINT "(LONGINT)li.QuadPart"; -PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(SYSTEM_ADRINT)h, &li)"; +PROCEDURE -getFileSize(h: FileHandle): INTEGER "(INTEGER)GetFileSizeEx((HANDLE)(address)h, &li)"; PROCEDURE Size*(h: FileHandle; VAR l: LONGINT): ErrorCode; BEGIN @@ -412,10 +412,10 @@ BEGIN END Size; -PROCEDURE -readfile (fd: LONGINT; p: LONGINT; l: LONGINT; VAR n: LONGINT): INTEGER -"(INTEGER)ReadFile ((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, (DWORD*)n, 0)"; +PROCEDURE -readfile (fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): SYSTEM.ADDRESS +"(address)ReadFile((HANDLE)fd, (void*)p, (DWORD)l, (DWORD*)n, 0)"; -PROCEDURE Read*(h: FileHandle; p: LONGINT; l: LONGINT; VAR n: LONGINT): ErrorCode; +PROCEDURE Read*(h: FileHandle; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS; VAR n: SYSTEM.ADDRESS): ErrorCode; VAR result: INTEGER; BEGIN n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) @@ -423,18 +423,18 @@ BEGIN IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END Read; -PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: LONGINT): ErrorCode; +PROCEDURE ReadBuf*(h: FileHandle; VAR b: ARRAY OF SYSTEM.BYTE; VAR n: SYSTEM.ADDRESS): ErrorCode; VAR result: INTEGER; BEGIN - n := 0; (* Clear n because readfile takes a LONGINT but only updates the bottom 32 bits *) + n := 0; (* Clear n because readfile takes a SYSTEM.ADDRESS but only updates the bottom 32 bits *) result := readfile(h, SYSTEM.ADR(b), LEN(b), n); IF result = 0 THEN n := 0; RETURN err() ELSE RETURN 0 END END ReadBuf; -PROCEDURE -writefile(fd: LONGINT; p: LONGINT; l: LONGINT): INTEGER -"(INTEGER)WriteFile((HANDLE)(SYSTEM_ADRINT)fd, (void*)(SYSTEM_ADRINT)(p), (DWORD)l, 0,0)"; +PROCEDURE -writefile(fd: LONGINT; p: SYSTEM.ADDRESS; l: SYSTEM.ADDRESS): INTEGER +"(INTEGER)WriteFile((HANDLE)fd, (void*)(p), (DWORD)l, 0,0)"; PROCEDURE Write*(h: FileHandle; p: LONGINT; l: LONGINT): ErrorCode; BEGIN @@ -443,7 +443,7 @@ END Write; -PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -flushFileBuffers(h: FileHandle): INTEGER "(INTEGER)FlushFileBuffers((HANDLE)h)"; PROCEDURE Sync*(h: FileHandle): ErrorCode; BEGIN @@ -453,7 +453,7 @@ END Sync; PROCEDURE -setFilePointerEx(h: FileHandle; o: LONGINT; r: INTEGER; VAR rc: INTEGER) -"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, li, 0, (DWORD)r)"; +"li.QuadPart=o; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, li, 0, (DWORD)r)"; PROCEDURE -seekset(): INTEGER "FILE_BEGIN"; PROCEDURE -seekcur(): INTEGER "FILE_CURRENT"; @@ -469,9 +469,9 @@ END Seek; -PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(SYSTEM_ADRINT)h)"; +PROCEDURE -setEndOfFile(h: FileHandle): INTEGER "(INTEGER)SetEndOfFile((HANDLE)(address)h)"; PROCEDURE -getFilePos(h: FileHandle; VAR r: LONGINT; VAR rc: INTEGER) -"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(SYSTEM_ADRINT)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; +"LARGE_INTEGER liz = {0}; *rc = (INTEGER)SetFilePointerEx((HANDLE)(address)h, liz, &li, FILE_CURRENT); *r = (LONGINT)li.QuadPart"; PROCEDURE Truncate*(h: FileHandle; limit: LONGINT): ErrorCode; VAR rc: INTEGER; oldpos: LONGINT; @@ -529,8 +529,8 @@ PROCEDURE Exit*(code: INTEGER); BEGIN exit(code) END Exit; -PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, s, s__len-1, 0,0)'; -PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(SYSTEM_ADRINT)Platform_StdOut, &c, 1, 0,0)'; +PROCEDURE -errstring(s: ARRAY OF CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, s, s__len-1, 0,0)'; +PROCEDURE -errc (c: CHAR) 'WriteFile((HANDLE)(address)Platform_StdOut, &c, 1, 0,0)'; PROCEDURE errch(c: CHAR); BEGIN errc(c) END errch; PROCEDURE errln; BEGIN errch(0DX); errch(0AX) END errln; @@ -552,7 +552,12 @@ BEGIN | -7: errstring("WITH statement type guard failed.") | -8: errstring("SHORT: Value too large for shorter type.") | -9: errstring("Heap interrupted while locked, but lockdepth = 0 at unlock.") - |-15: errstring("Type descriptor size mismatch.") + |-10: errstring("NIL access."); + |-11: errstring("Alignment error."); + |-12: errstring("Divide by zero."); + |-13: errstring("Arithmetic overflow/underflow."); + |-14: errstring("Invalid function argument."); + |-15: errstring("Internal error, e.g. Type descriptor size mismatch.") |-20: errstring("Too many, or negative number of, elements in dynamic array.") ELSE END @@ -589,9 +594,9 @@ PROCEDURE TestLittleEndian; BEGIN i := 1; SYSTEM.GET(SYSTEM.ADR(i), LittleEndian); END TestLittleEndian; -PROCEDURE -getstdinhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_INPUT_HANDLE)"; -PROCEDURE -getstdouthandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_OUTPUT_HANDLE)"; -PROCEDURE -getstderrhandle(): FileHandle "(SYSTEM_ADRINT)GetStdHandle(STD_ERROR_HANDLE)"; +PROCEDURE -getstdinhandle(): FileHandle "(address)GetStdHandle(STD_INPUT_HANDLE)"; +PROCEDURE -getstdouthandle(): FileHandle "(address)GetStdHandle(STD_OUTPUT_HANDLE)"; +PROCEDURE -getstderrhandle(): FileHandle "(address)GetStdHandle(STD_ERROR_HANDLE)"; PROCEDURE -getpid(): INTEGER "(INTEGER)GetCurrentProcessId()"; BEGIN diff --git a/src/system/SYSTEM.c b/src/system/SYSTEM.c index 16681ab8..821a6096 100644 --- a/src/system/SYSTEM.c +++ b/src/system/SYSTEM.c @@ -38,7 +38,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0) void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)()) { while (n > 0) { - P((uintptr)(*((void**)(adr)))); + P((address)(*((void**)(adr)))); adr = ((void**)adr) + 1; n--; } @@ -51,7 +51,7 @@ void SYSTEM_ENUMR(void *adr, LONGINT *typ, LONGINT size, LONGINT n, void (*P)()) while (n > 0) { t = typ; off = *t; - while (off >= 0) {P(*(uintptr*)((char*)adr+off)); t++; off = *t;} + while (off >= 0) {P(*(address*)((char*)adr+off)); t++; off = *t;} adr = ((char*)adr) + size; n--; } @@ -109,7 +109,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, else if (typ == (LONGINT*)POINTER__typ) { /* element type is a pointer */ x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[-1]; + p = (LONGINT*)(address)x[-1]; p[-nofelems] = *p; /* build new type desc in situ: 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */ while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;} @@ -122,7 +122,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim, while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */ nptr = nofelems * nofptrs; /* total number of pointers */ x = Heap_NEWBLK(size + nptr * sizeof(LONGINT)); - p = (LONGINT*)(uintptr)x[- 1]; + p = (LONGINT*)(address)x[- 1]; p[-nptr] = *p; /* build new type desc in situ; 1. copy block size; 2. setup ptr tab; 3. set sentinel; 4. patch tag */ p -= nptr - 1; n = 0; off = dataoff; while (n < nofelems) {i = 0; @@ -158,7 +158,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler // (Ignore other signals) } - void SystemSetHandler(int s, uintptr h) { + void SystemSetHandler(int s, address h) { if (s >= 2 && s <= 4) { int needtosetsystemhandler = handler[s-2] == 0; handler[s-2] = (SystemSignalHandler)h; @@ -197,12 +197,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler } } - void SystemSetInterruptHandler(uintptr h) { + void SystemSetInterruptHandler(address h) { EnsureConsoleCtrlHandler(); SystemInterruptHandler = (SystemSignalHandler)h; } - void SystemSetQuitHandler(uintptr h) { + void SystemSetQuitHandler(address h) { EnsureConsoleCtrlHandler(); SystemQuitHandler = (SystemSignalHandler)h; } diff --git a/src/system/SYSTEM.h b/src/system/SYSTEM.h index e7b38a26..8c6c335e 100644 --- a/src/system/SYSTEM.h +++ b/src/system/SYSTEM.h @@ -39,7 +39,7 @@ typedef unsigned short int uint16; typedef signed char int8; typedef unsigned char uint8; -#define uintptr size_t +#define address size_t // The compiler uses 'import' and 'export' which translate to 'extern' and // nothing respectively. @@ -53,7 +53,7 @@ typedef unsigned char uint8; #define NIL ((void*)0) #define __MAXEXT 16 -#define POINTER__typ ((uintptr*)(1)) // not NIL and not a valid type +#define POINTER__typ ((address*)(1)) // not NIL and not a valid type // Oberon types @@ -98,8 +98,8 @@ typedef void* SYSTEM_PTR; // OS Memory allocation interfaces are in PlatformXXX.Mod -extern uintptr Platform_OSAllocate (uintptr size); -extern void Platform_OSFree (uintptr addr); +extern address Platform_OSAllocate (address size); +extern void Platform_OSFree (address addr); // Run time system routines in SYSTEM.c @@ -120,10 +120,10 @@ extern LONGINT SYSTEM_ENTIER (double x); // Signal handling in SYSTEM.c #ifndef _WIN32 - extern void SystemSetHandler(int s, uintptr h); + extern void SystemSetHandler(int s, address h); #else - extern void SystemSetInterruptHandler(uintptr h); - extern void SystemSetQuitHandler (uintptr h); + extern void SystemSetInterruptHandler(address h); + extern void SystemSetQuitHandler (address h); #endif @@ -146,9 +146,9 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __COPY(s, d, n) {char*_a=(void*)s,*_b=(void*)d; LONGINT _i=0,_t=n-1; \ while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;} -#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) +#define __DUP(x, l, t) x=(void*)memcpy((void*)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t)) #define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t)) -#define __DEL(x) Platform_OSFree((LONGINT)(uintptr)x) +#define __DEL(x) Platform_OSFree((address)x) // Index and range checks @@ -165,8 +165,8 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __VAL(t, x) (*(t*)&(x)) -#define __GET(a, x, t) x= *(t*)(uintptr)(a) -#define __PUT(a, x, t) *(t*)(uintptr)(a)=x +#define __GET(a, x, t) x= *(t*)(address)(a) +#define __PUT(a, x, t) *(t*)(address)(a)=x #define __LSHL(x, n, t) ((t)((u##t)(x)<<(n))) #define __LSHR(x, n, t) ((t)((u##t)(x)>>(n))) @@ -182,7 +182,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ #define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n)) #define __BIT(x, n) (*(uint64*)(x)>>(n)&1) -#define __MOVE(s, d, n) memcpy((char*)(uintptr)(d),(char*)(uintptr)(s),n) +#define __MOVE(s, d, n) memcpy((char*)(address)(d),(char*)(address)(s),n) #define __SHORT(x, y) ((int)((uLONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0))) #define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y))) #define __CHR(x) ((CHAR)__R(x, 256)) @@ -235,10 +235,10 @@ extern void Heap_INCREF(); // Main module initialisation, registration and finalisation -extern void Platform_Init(INTEGER argc, LONGINT argv); +extern void Platform_Init(INTEGER argc, address argv); extern void Heap_FINALL(); -#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr)&argv); +#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (address)&argv); #define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum) #define __FINI Heap_FINALL(); return 0 @@ -254,12 +254,12 @@ extern void Platform_AssertFail(LONGINT x); // Memory allocation -extern SYSTEM_PTR Heap_NEWBLK (uintptr size); -extern SYSTEM_PTR Heap_NEWREC (uintptr tag); +extern SYSTEM_PTR Heap_NEWBLK (address size); +extern SYSTEM_PTR Heap_NEWREC (address tag); extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len)) -#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr)t##__typ) +#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(address)t##__typ) #define __NEWARR SYSTEM_NEWARR @@ -290,20 +290,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...); #define __INITYP(t, t0, level) \ t##__typ = (LONGINT*)&t##__desc.blksz; \ memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \ - t##__desc.basep[level] = (LONGINT)(uintptr)t##__typ; \ - t##__desc.module = (LONGINT)(uintptr)m; \ + t##__desc.basep[level] = (LONGINT)(address)t##__typ; \ + t##__desc.module = (LONGINT)(address)m; \ if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \ t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \ - Heap_REGTYP(m, (LONGINT)(uintptr)&t##__desc.next); \ + Heap_REGTYP(m, (LONGINT)(address)&t##__desc.next); \ SYSTEM_INHERIT(t##__typ, t0##__typ) -#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr)typ##__typ) -#define __TYPEOF(p) ((LONGINT*)(uintptr)(*(((LONGINT*)(p))-1))) +#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(address)typ##__typ) +#define __TYPEOF(p) ((LONGINT*)(address)(*(((LONGINT*)(p))-1))) #define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level) // Oberon-2 type bound procedures support -#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr)proc -#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr)*(typ-(__TPROC0OFF+num))))parlist +#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(address)proc +#define __SEND(typ, num, funtyp, parlist) ((funtyp)((address)*(typ-(__TPROC0OFF+num))))parlist