mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 04:02:25 +00:00
Change of mind: s/uintptr/address/. Replace LONGINT with ADDRESS in Platform*.
This commit is contained in:
parent
90737e5677
commit
a865643d6c
215 changed files with 1441 additions and 1410 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}};
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue