Change of mind: s/uintptr/address/. Replace LONGINT with ADDRESS in Platform*.

This commit is contained in:
David Brown 2016-09-04 14:34:24 +01:00
parent 90737e5677
commit a865643d6c
215 changed files with 1441 additions and 1410 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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);

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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);
}

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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);

View file

@ -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;

View file

@ -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);
}

View file

@ -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

View file

@ -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}};

View file

@ -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);

View file

@ -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;
}

View file

@ -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

View file

@ -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;
}

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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;

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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"

View file

@ -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