mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 05:12:26 +00:00
Replace uses of uintptr_t and size_t with SYSTEM_ADDRESS.
This commit is contained in:
parent
3c36cbd111
commit
3744c3d0ae
211 changed files with 646 additions and 688 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -13,6 +13,6 @@ export void *Configuration__init(void)
|
||||||
__DEFMOD;
|
__DEFMOD;
|
||||||
__REGMOD("Configuration", 0);
|
__REGMOD("Configuration", 0);
|
||||||
/* BEGIN */
|
/* BEGIN */
|
||||||
__MOVE("1.95 [2016/08/22] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
__MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len);
|
||||||
void Console_Flush (void)
|
void Console_Flush (void)
|
||||||
{
|
{
|
||||||
INTEGER error;
|
INTEGER error;
|
||||||
error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos);
|
error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos);
|
||||||
Console_pos = 0;
|
Console_pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Console__h
|
#ifndef Console__h
|
||||||
#define Console__h
|
#define Console__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf)
|
||||||
if (buf->org != f->pos) {
|
if (buf->org != f->pos) {
|
||||||
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
|
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
|
||||||
}
|
}
|
||||||
error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size);
|
error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
||||||
}
|
}
|
||||||
|
|
@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
|
||||||
} else {
|
} else {
|
||||||
min = n;
|
min = n;
|
||||||
}
|
}
|
||||||
__MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min);
|
||||||
offset += min;
|
offset += min;
|
||||||
(*r).offset = offset;
|
(*r).offset = offset;
|
||||||
xpos += min;
|
xpos += min;
|
||||||
|
|
@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
|
||||||
} else {
|
} else {
|
||||||
min = n;
|
min = n;
|
||||||
}
|
}
|
||||||
__MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min);
|
||||||
offset += min;
|
offset += min;
|
||||||
(*r).offset = offset;
|
(*r).offset = offset;
|
||||||
if (offset > buf->size) {
|
if (offset > buf->size) {
|
||||||
|
|
@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
|
||||||
*res = 3;
|
*res = 3;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n);
|
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n);
|
||||||
while (n > 0) {
|
while (n > 0) {
|
||||||
error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n);
|
error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
ignore = Platform_Close(fdold);
|
ignore = Platform_Close(fdold);
|
||||||
ignore = Platform_Close(fdnew);
|
ignore = Platform_Close(fdnew);
|
||||||
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
|
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
|
||||||
}
|
}
|
||||||
error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n);
|
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n);
|
||||||
}
|
}
|
||||||
ignore = Platform_Close(fdold);
|
ignore = Platform_Close(fdold);
|
||||||
ignore = Platform_Close(fdnew);
|
ignore = Platform_Close(fdnew);
|
||||||
|
|
@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
|
||||||
j += 1;
|
j += 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
__MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o)
|
||||||
{
|
{
|
||||||
Files_File f = NIL;
|
Files_File f = NIL;
|
||||||
LONGINT res;
|
LONGINT res;
|
||||||
f = (Files_File)(uintptr_t)o;
|
f = (Files_File)(SYSTEM_ADDRESS)o;
|
||||||
if (f->fd >= 0) {
|
if (f->fd >= 0) {
|
||||||
Files_CloseOSFile(f);
|
Files_CloseOSFile(f);
|
||||||
if (f->tempFile) {
|
if (f->tempFile) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
struct Heap__1 {
|
struct Heap__1 {
|
||||||
|
|
@ -101,7 +101,7 @@ export void Heap_Unlock (void);
|
||||||
extern void *Heap__init();
|
extern void *Heap__init();
|
||||||
extern LONGINT Platform_MainStackFrame;
|
extern LONGINT Platform_MainStackFrame;
|
||||||
extern LONGINT Platform_OSAllocate(LONGINT size);
|
extern LONGINT Platform_OSAllocate(LONGINT size);
|
||||||
#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))
|
#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer)))
|
||||||
#define Heap_HeapModuleInit() Heap__init()
|
#define Heap_HeapModuleInit() Heap__init()
|
||||||
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
|
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
|
||||||
#define Heap_PlatformHalt(code) Platform_Halt(code)
|
#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, ((LONGINT)(20)));
|
__COPY(name, m->name, ((LONGINT)(20)));
|
||||||
m->refcnt = 0;
|
m->refcnt = 0;
|
||||||
m->enumPtrs = enumPtrs;
|
m->enumPtrs = enumPtrs;
|
||||||
m->next = (Heap_Module)(uintptr_t)Heap_modules;
|
m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
|
||||||
Heap_modules = (SYSTEM_PTR)m;
|
Heap_modules = (SYSTEM_PTR)m;
|
||||||
_o_result = (void*)m;
|
_o_result = (void*)m;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag)
|
||||||
__PUT(adr + 8, 0, LONGINT);
|
__PUT(adr + 8, 0, LONGINT);
|
||||||
Heap_allocated += blksz;
|
Heap_allocated += blksz;
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4);
|
_o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4);
|
||||||
return _o_result;
|
return _o_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
||||||
SYSTEM_PTR new;
|
SYSTEM_PTR new;
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
||||||
new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz);
|
new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz);
|
||||||
tag = ((LONGINT)(uintptr_t)new + blksz) - 12;
|
tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12;
|
||||||
__PUT(tag - 4, 0, LONGINT);
|
__PUT(tag - 4, 0, LONGINT);
|
||||||
__PUT(tag, blksz, LONGINT);
|
__PUT(tag, blksz, LONGINT);
|
||||||
__PUT(tag + 4, -4, LONGINT);
|
__PUT(tag + 4, -4, LONGINT);
|
||||||
__PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT);
|
__PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT);
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = new;
|
_o_result = new;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
__GET(tag, offset, LONGINT);
|
__GET(tag, offset, LONGINT);
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
p = Heap_FetchAddress(fld);
|
p = Heap_FetchAddress(fld);
|
||||||
__PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR);
|
||||||
} else {
|
} else {
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
n = Heap_FetchAddress(fld);
|
n = Heap_FetchAddress(fld);
|
||||||
|
|
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
if (!__ODD(tagbits)) {
|
if (!__ODD(tagbits)) {
|
||||||
__PUT(n - 4, tagbits + 1, LONGINT);
|
__PUT(n - 4, tagbits + 1, LONGINT);
|
||||||
__PUT(q - 4, tag + 1, LONGINT);
|
__PUT(q - 4, tag + 1, LONGINT);
|
||||||
__PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR);
|
||||||
p = q;
|
p = q;
|
||||||
q = n;
|
q = n;
|
||||||
tag = tagbits;
|
tag = tagbits;
|
||||||
|
|
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
|
|
||||||
static void Heap_MarkP (SYSTEM_PTR p)
|
static void Heap_MarkP (SYSTEM_PTR p)
|
||||||
{
|
{
|
||||||
Heap_Mark((LONGINT)(uintptr_t)p);
|
Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Heap_Scan (void)
|
static void Heap_Scan (void)
|
||||||
|
|
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
|
||||||
} else {
|
} else {
|
||||||
prev->next = n->next;
|
prev->next = n->next;
|
||||||
}
|
}
|
||||||
(*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj);
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
|
||||||
if (prev == NIL) {
|
if (prev == NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -572,7 +572,7 @@ void Heap_FINALL (void)
|
||||||
while (Heap_fin != NIL) {
|
while (Heap_fin != NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
Heap_fin = Heap_fin->next;
|
Heap_fin = Heap_fin->next;
|
||||||
(*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj);
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len)
|
||||||
}
|
}
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
nofcand = 0;
|
nofcand = 0;
|
||||||
sp = (LONGINT)(uintptr_t)&frame;
|
sp = (LONGINT)(SYSTEM_ADDRESS)&frame;
|
||||||
stack0 = Heap_PlatformMainStackFrame();
|
stack0 = Heap_PlatformMainStackFrame();
|
||||||
inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align;
|
inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align;
|
||||||
if (sp > stack0) {
|
if (sp > stack0) {
|
||||||
inc = -inc;
|
inc = -inc;
|
||||||
}
|
}
|
||||||
|
|
@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack)
|
||||||
LONGINT cand[10000];
|
LONGINT cand[10000];
|
||||||
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
|
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
m = (Heap_Module)(uintptr_t)Heap_modules;
|
m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
|
||||||
while (m != NIL) {
|
while (m != NIL) {
|
||||||
if (m->enumPtrs != NIL) {
|
if (m->enumPtrs != NIL) {
|
||||||
(*m->enumPtrs)(Heap_MarkP);
|
(*m->enumPtrs)(Heap_MarkP);
|
||||||
|
|
@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
|
||||||
{
|
{
|
||||||
Heap_FinNode f;
|
Heap_FinNode f;
|
||||||
__NEW(f, Heap_FinDesc);
|
__NEW(f, Heap_FinDesc);
|
||||||
f->obj = (LONGINT)(uintptr_t)obj;
|
f->obj = (LONGINT)(SYSTEM_ADDRESS)obj;
|
||||||
f->finalize = finalize;
|
f->finalize = finalize;
|
||||||
f->marked = 1;
|
f->marked = 1;
|
||||||
f->next = Heap_fin;
|
f->next = Heap_fin;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "Heap.h"
|
#include "Heap.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
#include "OPS.h"
|
#include "OPS.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real)
|
||||||
{
|
{
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
LONGINT l;
|
LONGINT l;
|
||||||
__GET((LONGINT)(uintptr_t)&real, l, LONGINT);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT);
|
||||||
OPM_FPrint(&*fp, l);
|
OPM_FPrint(&*fp, l);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr)
|
void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr)
|
||||||
{
|
{
|
||||||
LONGINT l, h;
|
LONGINT l, h;
|
||||||
__GET((LONGINT)(uintptr_t)&lr, l, LONGINT);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT);
|
||||||
__GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT);
|
||||||
OPM_FPrint(&*fp, l);
|
OPM_FPrint(&*fp, l);
|
||||||
OPM_FPrint(&*fp, h);
|
OPM_FPrint(&*fp, h);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPB.h"
|
#include "OPB.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
|
|
||||||
#ifndef OPS__h
|
#ifndef OPS__h
|
||||||
#define OPS__h
|
#define OPS__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
#include "OPS.h"
|
#include "OPS.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPT__h
|
#ifndef OPT__h
|
||||||
#define OPT__h
|
#define OPT__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPC.h"
|
#include "OPC.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
@ -931,7 +931,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21);
|
OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26);
|
||||||
if (l->class == 1) {
|
if (l->class == 1) {
|
||||||
OPC_CompleteIdent(l->obj);
|
OPC_CompleteIdent(l->obj);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -947,7 +947,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) {
|
if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) {
|
||||||
OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12);
|
OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17);
|
||||||
}
|
}
|
||||||
OPV_expr(l, exprPrec);
|
OPV_expr(l, exprPrec);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPV__h
|
#ifndef OPV__h
|
||||||
#define OPV__h
|
#define OPV__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
@ -118,14 +118,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT
|
||||||
#define Platform_EXDEV() EXDEV
|
#define Platform_EXDEV() EXDEV
|
||||||
extern void Heap_InitHeap();
|
extern void Heap_InitHeap();
|
||||||
#define Platform_HeapInitHeap() Heap_InitHeap()
|
#define Platform_HeapInitHeap() Heap_InitHeap()
|
||||||
#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)malloc((size_t)size))
|
#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size))
|
||||||
#define Platform_chdir(n, n__len) chdir((char*)n)
|
#define Platform_chdir(n, n__len) chdir((char*)n)
|
||||||
#define Platform_closefile(fd) close(fd)
|
#define Platform_closefile(fd) close(fd)
|
||||||
#define Platform_err() errno
|
#define Platform_err() errno
|
||||||
#define Platform_errc(c) write(1, &c, 1)
|
#define Platform_errc(c) write(1, &c, 1)
|
||||||
#define Platform_errstring(s, s__len) write(1, s, s__len-1)
|
#define Platform_errstring(s, s__len) write(1, s, s__len-1)
|
||||||
#define Platform_exit(code) exit(code)
|
#define Platform_exit(code) exit(code)
|
||||||
#define Platform_free(address) free((void*)(uintptr_t)address)
|
#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address)
|
||||||
#define Platform_fstat(fd) fstat(fd, &s)
|
#define Platform_fstat(fd) fstat(fd, &s)
|
||||||
#define Platform_fsync(fd) fsync(fd)
|
#define Platform_fsync(fd) fsync(fd)
|
||||||
#define Platform_ftruncate(fd, l) ftruncate(fd, l)
|
#define Platform_ftruncate(fd, l) ftruncate(fd, l)
|
||||||
|
|
@ -138,13 +138,13 @@ extern void Heap_InitHeap();
|
||||||
#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)
|
#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_openro(n, n__len) open((char*)n, O_RDONLY)
|
||||||
#define Platform_openrw(n, n__len) open((char*)n, O_RDWR)
|
#define Platform_openrw(n, n__len) open((char*)n, O_RDWR)
|
||||||
#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr_t)(p), l)
|
#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l)
|
||||||
#define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n)
|
#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_sectotm(s) struct tm *time = localtime((time_t*)&s)
|
||||||
#define Platform_seekcur() SEEK_CUR
|
#define Platform_seekcur() SEEK_CUR
|
||||||
#define Platform_seekend() SEEK_END
|
#define Platform_seekend() SEEK_END
|
||||||
#define Platform_seekset() SEEK_SET
|
#define Platform_seekset() SEEK_SET
|
||||||
#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr_t)h)
|
#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h)
|
||||||
#define Platform_stat(n, n__len) stat((char*)n, &s)
|
#define Platform_stat(n, n__len) stat((char*)n, &s)
|
||||||
#define Platform_statdev() (LONGINT)s.st_dev
|
#define Platform_statdev() (LONGINT)s.st_dev
|
||||||
#define Platform_statino() (LONGINT)s.st_ino
|
#define Platform_statino() (LONGINT)s.st_ino
|
||||||
|
|
@ -161,7 +161,7 @@ extern void Heap_InitHeap();
|
||||||
#define Platform_tvsec() tv.tv_sec
|
#define Platform_tvsec() tv.tv_sec
|
||||||
#define Platform_tvusec() tv.tv_usec
|
#define Platform_tvusec() tv.tv_usec
|
||||||
#define Platform_unlink(n, n__len) unlink((char*)n)
|
#define Platform_unlink(n, n__len) unlink((char*)n)
|
||||||
#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr_t)(p), l)
|
#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l)
|
||||||
|
|
||||||
BOOLEAN Platform_TooManyFiles (INTEGER e)
|
BOOLEAN Platform_TooManyFiles (INTEGER e)
|
||||||
{
|
{
|
||||||
|
|
@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
|
||||||
Platform_ArgVecPtr av = NIL;
|
Platform_ArgVecPtr av = NIL;
|
||||||
Platform_MainStackFrame = argvadr;
|
Platform_MainStackFrame = argvadr;
|
||||||
Platform_ArgCount = argc;
|
Platform_ArgCount = argc;
|
||||||
av = (Platform_ArgVecPtr)(uintptr_t)argvadr;
|
av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr;
|
||||||
Platform_ArgVector = (*av)[0];
|
Platform_ArgVector = (*av)[0];
|
||||||
Platform_HaltCode = -128;
|
Platform_HaltCode = -128;
|
||||||
Platform_HeapInitHeap();
|
Platform_HeapInitHeap();
|
||||||
|
|
@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
|
||||||
{
|
{
|
||||||
Platform_ArgVec av = NIL;
|
Platform_ArgVec av = NIL;
|
||||||
if (n < Platform_ArgCount) {
|
if (n < Platform_ArgCount) {
|
||||||
av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector;
|
av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector;
|
||||||
__COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len);
|
__COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n)
|
||||||
INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n)
|
INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
*n = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len);
|
*n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len);
|
||||||
if (*n < 0) {
|
if (*n < 0) {
|
||||||
*n = 0;
|
*n = 0;
|
||||||
_o_result = Platform_err();
|
_o_result = Platform_err();
|
||||||
|
|
@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void)
|
||||||
{
|
{
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
i = 1;
|
i = 1;
|
||||||
__GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}};
|
__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Platform__h
|
#ifndef Platform__h
|
||||||
#define Platform__h
|
#define Platform__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER);
|
||||||
_o_result = __MASK(__ASHR(i, 7), -256);
|
_o_result = __MASK(__ASHR(i, 7), -256);
|
||||||
return _o_result;
|
return _o_result;
|
||||||
}
|
}
|
||||||
|
|
@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x)
|
||||||
void Reals_SetExpo (REAL *x, INTEGER ex)
|
void Reals_SetExpo (REAL *x, INTEGER ex)
|
||||||
{
|
{
|
||||||
CHAR c;
|
CHAR c;
|
||||||
__GET((LONGINT)(uintptr_t)x + 3, c, CHAR);
|
__GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR);
|
||||||
__PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
|
__PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
|
||||||
__GET((LONGINT)(uintptr_t)x + 2, c, CHAR);
|
__GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR);
|
||||||
__PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
|
__PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
INTEGER Reals_ExpoL (LONGREAL x)
|
INTEGER Reals_ExpoL (LONGREAL x)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER);
|
||||||
_o_result = __MASK(__ASHR(i, 4), -2048);
|
_o_result = __MASK(__ASHR(i, 4), -2048);
|
||||||
return _o_result;
|
return _o_result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Reals__h
|
#ifndef Reals__h
|
||||||
#define Reals__h
|
#define Reals__h
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0)
|
||||||
void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)())
|
void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)())
|
||||||
{
|
{
|
||||||
while (n > 0) {
|
while (n > 0) {
|
||||||
P((LONGINT)(uintptr_t)(*((void**)(adr))));
|
P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr))));
|
||||||
adr = ((void**)adr) + 1;
|
adr = ((void**)adr) + 1;
|
||||||
n--;
|
n--;
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim,
|
||||||
else if (typ == (LONGINT*)POINTER__typ) {
|
else if (typ == (LONGINT*)POINTER__typ) {
|
||||||
/* element type is a pointer */
|
/* element type is a pointer */
|
||||||
x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT));
|
x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT));
|
||||||
p = (LONGINT*)(uintptr_t)x[-1];
|
p = (LONGINT*)(SYSTEM_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] = *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 */
|
p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */
|
||||||
while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;}
|
while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;}
|
||||||
|
|
@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim,
|
||||||
while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
|
while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
|
||||||
nptr = nofelems * nofptrs; /* total number of pointers */
|
nptr = nofelems * nofptrs; /* total number of pointers */
|
||||||
x = Heap_NEWBLK(size + nptr * sizeof(LONGINT));
|
x = Heap_NEWBLK(size + nptr * sizeof(LONGINT));
|
||||||
p = (LONGINT*)(uintptr_t)x[- 1];
|
p = (LONGINT*)(SYSTEM_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] = *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;
|
p -= nptr - 1; n = 0; off = dataoff;
|
||||||
while (n < nofelems) {i = 0;
|
while (n < nofelems) {i = 0;
|
||||||
|
|
@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler
|
||||||
// (Ignore other signals)
|
// (Ignore other signals)
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemSetHandler(int s, uintptr_t h) {
|
void SystemSetHandler(int s, SYSTEM_ADDRESS h) {
|
||||||
if (s >= 2 && s <= 4) {
|
if (s >= 2 && s <= 4) {
|
||||||
int needtosetsystemhandler = handler[s-2] == 0;
|
int needtosetsystemhandler = handler[s-2] == 0;
|
||||||
handler[s-2] = (SystemSignalHandler)h;
|
handler[s-2] = (SystemSignalHandler)h;
|
||||||
|
|
@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemSetInterruptHandler(uintptr_t h) {
|
void SystemSetInterruptHandler(SYSTEM_ADDRESS h) {
|
||||||
EnsureConsoleCtrlHandler();
|
EnsureConsoleCtrlHandler();
|
||||||
SystemInterruptHandler = (SystemSignalHandler)h;
|
SystemInterruptHandler = (SystemSignalHandler)h;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemSetQuitHandler(uintptr_t h) {
|
void SystemSetQuitHandler(SYSTEM_ADDRESS h) {
|
||||||
EnsureConsoleCtrlHandler();
|
EnsureConsoleCtrlHandler();
|
||||||
SystemQuitHandler = (SystemSignalHandler)h;
|
SystemQuitHandler = (SystemSignalHandler)h;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,23 +18,16 @@ typedef unsigned char SYSTEM_CARD8;
|
||||||
|
|
||||||
#if (__SIZEOF_POINTER__ == 8)
|
#if (__SIZEOF_POINTER__ == 8)
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
typedef unsigned long long SYSTEM_PTRINT;
|
typedef unsigned long long SYSTEM_ADDRESS;
|
||||||
typedef unsigned long long uintptr_t;
|
|
||||||
typedef unsigned long long size_t;
|
|
||||||
#else
|
#else
|
||||||
typedef unsigned long SYSTEM_PTRINT;
|
typedef unsigned long SYSTEM_ADDRESS;
|
||||||
typedef unsigned long uintptr_t;
|
|
||||||
typedef unsigned long size_t;
|
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
typedef unsigned int SYSTEM_PTRINT;
|
typedef unsigned int SYSTEM_ADDRESS;
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _SIZE_T_DEFINED_ // For OpenBSD
|
|
||||||
|
|
||||||
void *memcpy(void *dest, const void *source, size_t size);
|
void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,10 +104,10 @@ extern LONGINT SYSTEM_ENTIER (double x);
|
||||||
// Signal handling in SYSTEM.c
|
// Signal handling in SYSTEM.c
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
extern void SystemSetHandler(int s, uintptr_t h);
|
extern void SystemSetHandler(int s, SYSTEM_ADDRESS h);
|
||||||
#else
|
#else
|
||||||
extern void SystemSetInterruptHandler(uintptr_t h);
|
extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h);
|
||||||
extern void SystemSetQuitHandler (uintptr_t h);
|
extern void SystemSetQuitHandler (SYSTEM_ADDRESS h);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -137,9 +130,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; \
|
#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;}
|
while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;}
|
||||||
#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t))
|
#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t))
|
||||||
#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t))
|
#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t))
|
||||||
#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x)
|
#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -149,8 +142,8 @@ static int __str_cmp(CHAR *x, CHAR *y){
|
||||||
#define __VAL(t, x) (*(t*)&(x))
|
#define __VAL(t, x) (*(t*)&(x))
|
||||||
|
|
||||||
|
|
||||||
#define __GET(a, x, t) x= *(t*)(uintptr_t)(a)
|
#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a)
|
||||||
#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x
|
#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x
|
||||||
|
|
||||||
#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n)))
|
#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n)))
|
||||||
#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n)))
|
#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n)))
|
||||||
|
|
@ -165,7 +158,7 @@ static int __str_cmp(CHAR *x, CHAR *y){
|
||||||
#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t))
|
#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t))
|
||||||
|
|
||||||
#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1)
|
#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1)
|
||||||
#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n)
|
#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n)
|
||||||
#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n))
|
#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n))
|
||||||
#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0)))
|
#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0)))
|
||||||
#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y)))
|
#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y)))
|
||||||
|
|
@ -226,7 +219,7 @@ extern void Heap_INCREF();
|
||||||
extern void Platform_Init(INTEGER argc, LONGINT argv);
|
extern void Platform_Init(INTEGER argc, LONGINT argv);
|
||||||
extern void Heap_FINALL();
|
extern void Heap_FINALL();
|
||||||
|
|
||||||
#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv);
|
#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv);
|
||||||
#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
|
#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
|
||||||
#define __FINI Heap_FINALL(); return 0
|
#define __FINI Heap_FINALL(); return 0
|
||||||
|
|
||||||
|
|
@ -247,7 +240,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag);
|
||||||
extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...);
|
extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...);
|
||||||
|
|
||||||
#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len))
|
#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len))
|
||||||
#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ)
|
#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ)
|
||||||
#define __NEWARR SYSTEM_NEWARR
|
#define __NEWARR SYSTEM_NEWARR
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -278,20 +271,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...);
|
||||||
#define __INITYP(t, t0, level) \
|
#define __INITYP(t, t0, level) \
|
||||||
t##__typ = (LONGINT*)&t##__desc.blksz; \
|
t##__typ = (LONGINT*)&t##__desc.blksz; \
|
||||||
memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \
|
memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \
|
||||||
t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \
|
t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \
|
||||||
t##__desc.module = (LONGINT)(uintptr_t)m; \
|
t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \
|
||||||
if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \
|
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)); \
|
t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \
|
||||||
Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \
|
Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \
|
||||||
SYSTEM_INHERIT(t##__typ, t0##__typ)
|
SYSTEM_INHERIT(t##__typ, t0##__typ)
|
||||||
|
|
||||||
#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ)
|
#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ)
|
||||||
#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1)))
|
#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1)))
|
||||||
#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level)
|
#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level)
|
||||||
|
|
||||||
// Oberon-2 type bound procedures support
|
// Oberon-2 type bound procedures support
|
||||||
#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc
|
#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc
|
||||||
#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist
|
#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Strings__h
|
#ifndef Strings__h
|
||||||
#define Strings__h
|
#define Strings__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Files.h"
|
#include "Files.h"
|
||||||
#include "Modules.h"
|
#include "Modules.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Texts__h
|
#ifndef Texts__h
|
||||||
#define Texts__h
|
#define Texts__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkamSf */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Heap.h"
|
#include "Heap.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef errors__h
|
#ifndef errors__h
|
||||||
#define errors__h
|
#define errors__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef extTools__h
|
#ifndef extTools__h
|
||||||
#define extTools__h
|
#define extTools__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "Strings.h"
|
#include "Strings.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef vt100__h
|
#ifndef vt100__h
|
||||||
#define vt100__h
|
#define vt100__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -13,6 +13,6 @@ export void *Configuration__init(void)
|
||||||
__DEFMOD;
|
__DEFMOD;
|
||||||
__REGMOD("Configuration", 0);
|
__REGMOD("Configuration", 0);
|
||||||
/* BEGIN */
|
/* BEGIN */
|
||||||
__MOVE("1.95 [2016/08/22] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
__MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len);
|
||||||
void Console_Flush (void)
|
void Console_Flush (void)
|
||||||
{
|
{
|
||||||
INTEGER error;
|
INTEGER error;
|
||||||
error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos);
|
error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos);
|
||||||
Console_pos = 0;
|
Console_pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Console__h
|
#ifndef Console__h
|
||||||
#define Console__h
|
#define Console__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
@ -257,7 +257,7 @@ static void Files_Flush (Files_Buffer buf)
|
||||||
if (buf->org != f->pos) {
|
if (buf->org != f->pos) {
|
||||||
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
|
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
|
||||||
}
|
}
|
||||||
error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size);
|
error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
||||||
}
|
}
|
||||||
|
|
@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
|
||||||
} else {
|
} else {
|
||||||
min = n;
|
min = n;
|
||||||
}
|
}
|
||||||
__MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min);
|
||||||
offset += min;
|
offset += min;
|
||||||
(*r).offset = offset;
|
(*r).offset = offset;
|
||||||
xpos += min;
|
xpos += min;
|
||||||
|
|
@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
|
||||||
} else {
|
} else {
|
||||||
min = n;
|
min = n;
|
||||||
}
|
}
|
||||||
__MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min);
|
||||||
offset += min;
|
offset += min;
|
||||||
(*r).offset = offset;
|
(*r).offset = offset;
|
||||||
if (offset > buf->size) {
|
if (offset > buf->size) {
|
||||||
|
|
@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
|
||||||
*res = 3;
|
*res = 3;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n);
|
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n);
|
||||||
while (n > 0) {
|
while (n > 0) {
|
||||||
error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n);
|
error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
ignore = Platform_Close(fdold);
|
ignore = Platform_Close(fdold);
|
||||||
ignore = Platform_Close(fdnew);
|
ignore = Platform_Close(fdnew);
|
||||||
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
|
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
|
||||||
}
|
}
|
||||||
error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n);
|
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n);
|
||||||
}
|
}
|
||||||
ignore = Platform_Close(fdold);
|
ignore = Platform_Close(fdold);
|
||||||
ignore = Platform_Close(fdnew);
|
ignore = Platform_Close(fdnew);
|
||||||
|
|
@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
|
||||||
j += 1;
|
j += 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
__MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1008,7 +1008,7 @@ static void Files_Finalize (SYSTEM_PTR o)
|
||||||
{
|
{
|
||||||
Files_File f = NIL;
|
Files_File f = NIL;
|
||||||
LONGINT res;
|
LONGINT res;
|
||||||
f = (Files_File)(uintptr_t)o;
|
f = (Files_File)(SYSTEM_ADDRESS)o;
|
||||||
if (f->fd >= 0) {
|
if (f->fd >= 0) {
|
||||||
Files_CloseOSFile(f);
|
Files_CloseOSFile(f);
|
||||||
if (f->tempFile) {
|
if (f->tempFile) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
struct Heap__1 {
|
struct Heap__1 {
|
||||||
|
|
@ -101,7 +101,7 @@ export void Heap_Unlock (void);
|
||||||
extern void *Heap__init();
|
extern void *Heap__init();
|
||||||
extern LONGINT Platform_MainStackFrame;
|
extern LONGINT Platform_MainStackFrame;
|
||||||
extern LONGINT Platform_OSAllocate(LONGINT size);
|
extern LONGINT Platform_OSAllocate(LONGINT size);
|
||||||
#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))
|
#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer)))
|
||||||
#define Heap_HeapModuleInit() Heap__init()
|
#define Heap_HeapModuleInit() Heap__init()
|
||||||
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
|
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
|
||||||
#define Heap_PlatformHalt(code) Platform_Halt(code)
|
#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, ((LONGINT)(20)));
|
__COPY(name, m->name, ((LONGINT)(20)));
|
||||||
m->refcnt = 0;
|
m->refcnt = 0;
|
||||||
m->enumPtrs = enumPtrs;
|
m->enumPtrs = enumPtrs;
|
||||||
m->next = (Heap_Module)(uintptr_t)Heap_modules;
|
m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
|
||||||
Heap_modules = (SYSTEM_PTR)m;
|
Heap_modules = (SYSTEM_PTR)m;
|
||||||
_o_result = (void*)m;
|
_o_result = (void*)m;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -315,7 +315,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag)
|
||||||
__PUT(adr + 8, 0, LONGINT);
|
__PUT(adr + 8, 0, LONGINT);
|
||||||
Heap_allocated += blksz;
|
Heap_allocated += blksz;
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = (SYSTEM_PTR)(uintptr_t)(adr + 4);
|
_o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 4);
|
||||||
return _o_result;
|
return _o_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
||||||
SYSTEM_PTR new;
|
SYSTEM_PTR new;
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
||||||
new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz);
|
new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz);
|
||||||
tag = ((LONGINT)(uintptr_t)new + blksz) - 12;
|
tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 12;
|
||||||
__PUT(tag - 4, 0, LONGINT);
|
__PUT(tag - 4, 0, LONGINT);
|
||||||
__PUT(tag, blksz, LONGINT);
|
__PUT(tag, blksz, LONGINT);
|
||||||
__PUT(tag + 4, -4, LONGINT);
|
__PUT(tag + 4, -4, LONGINT);
|
||||||
__PUT((LONGINT)(uintptr_t)new - 4, tag, LONGINT);
|
__PUT((LONGINT)(SYSTEM_ADDRESS)new - 4, tag, LONGINT);
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = new;
|
_o_result = new;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
__GET(tag, offset, LONGINT);
|
__GET(tag, offset, LONGINT);
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
p = Heap_FetchAddress(fld);
|
p = Heap_FetchAddress(fld);
|
||||||
__PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR);
|
||||||
} else {
|
} else {
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
n = Heap_FetchAddress(fld);
|
n = Heap_FetchAddress(fld);
|
||||||
|
|
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
if (!__ODD(tagbits)) {
|
if (!__ODD(tagbits)) {
|
||||||
__PUT(n - 4, tagbits + 1, LONGINT);
|
__PUT(n - 4, tagbits + 1, LONGINT);
|
||||||
__PUT(q - 4, tag + 1, LONGINT);
|
__PUT(q - 4, tag + 1, LONGINT);
|
||||||
__PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR);
|
||||||
p = q;
|
p = q;
|
||||||
q = n;
|
q = n;
|
||||||
tag = tagbits;
|
tag = tagbits;
|
||||||
|
|
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
|
|
||||||
static void Heap_MarkP (SYSTEM_PTR p)
|
static void Heap_MarkP (SYSTEM_PTR p)
|
||||||
{
|
{
|
||||||
Heap_Mark((LONGINT)(uintptr_t)p);
|
Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Heap_Scan (void)
|
static void Heap_Scan (void)
|
||||||
|
|
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
|
||||||
} else {
|
} else {
|
||||||
prev->next = n->next;
|
prev->next = n->next;
|
||||||
}
|
}
|
||||||
(*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj);
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
|
||||||
if (prev == NIL) {
|
if (prev == NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -572,7 +572,7 @@ void Heap_FINALL (void)
|
||||||
while (Heap_fin != NIL) {
|
while (Heap_fin != NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
Heap_fin = Heap_fin->next;
|
Heap_fin = Heap_fin->next;
|
||||||
(*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj);
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len)
|
||||||
}
|
}
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
nofcand = 0;
|
nofcand = 0;
|
||||||
sp = (LONGINT)(uintptr_t)&frame;
|
sp = (LONGINT)(SYSTEM_ADDRESS)&frame;
|
||||||
stack0 = Heap_PlatformMainStackFrame();
|
stack0 = Heap_PlatformMainStackFrame();
|
||||||
inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align;
|
inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align;
|
||||||
if (sp > stack0) {
|
if (sp > stack0) {
|
||||||
inc = -inc;
|
inc = -inc;
|
||||||
}
|
}
|
||||||
|
|
@ -622,7 +622,7 @@ void Heap_GC (BOOLEAN markStack)
|
||||||
LONGINT cand[10000];
|
LONGINT cand[10000];
|
||||||
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
|
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
m = (Heap_Module)(uintptr_t)Heap_modules;
|
m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
|
||||||
while (m != NIL) {
|
while (m != NIL) {
|
||||||
if (m->enumPtrs != NIL) {
|
if (m->enumPtrs != NIL) {
|
||||||
(*m->enumPtrs)(Heap_MarkP);
|
(*m->enumPtrs)(Heap_MarkP);
|
||||||
|
|
@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
|
||||||
{
|
{
|
||||||
Heap_FinNode f;
|
Heap_FinNode f;
|
||||||
__NEW(f, Heap_FinDesc);
|
__NEW(f, Heap_FinDesc);
|
||||||
f->obj = (LONGINT)(uintptr_t)obj;
|
f->obj = (LONGINT)(SYSTEM_ADDRESS)obj;
|
||||||
f->finalize = finalize;
|
f->finalize = finalize;
|
||||||
f->marked = 1;
|
f->marked = 1;
|
||||||
f->next = Heap_fin;
|
f->next = Heap_fin;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "Heap.h"
|
#include "Heap.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
#include "OPS.h"
|
#include "OPS.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
@ -544,15 +544,15 @@ void OPM_FPrintReal (LONGINT *fp, REAL real)
|
||||||
{
|
{
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
LONGINT l;
|
LONGINT l;
|
||||||
__GET((LONGINT)(uintptr_t)&real, l, LONGINT);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&real, l, LONGINT);
|
||||||
OPM_FPrint(&*fp, l);
|
OPM_FPrint(&*fp, l);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr)
|
void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr)
|
||||||
{
|
{
|
||||||
LONGINT l, h;
|
LONGINT l, h;
|
||||||
__GET((LONGINT)(uintptr_t)&lr, l, LONGINT);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&lr, l, LONGINT);
|
||||||
__GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&lr + 4, h, LONGINT);
|
||||||
OPM_FPrint(&*fp, l);
|
OPM_FPrint(&*fp, l);
|
||||||
OPM_FPrint(&*fp, h);
|
OPM_FPrint(&*fp, h);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPB.h"
|
#include "OPB.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
|
|
||||||
#ifndef OPS__h
|
#ifndef OPS__h
|
||||||
#define OPS__h
|
#define OPS__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
#include "OPS.h"
|
#include "OPS.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPT__h
|
#ifndef OPT__h
|
||||||
#define OPT__h
|
#define OPT__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPC.h"
|
#include "OPC.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
@ -931,7 +931,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
OPM_WriteString((CHAR*)"(LONGINT)(uintptr_t)", (LONGINT)21);
|
OPM_WriteString((CHAR*)"(LONGINT)(SYSTEM_ADDRESS)", (LONGINT)26);
|
||||||
if (l->class == 1) {
|
if (l->class == 1) {
|
||||||
OPC_CompleteIdent(l->obj);
|
OPC_CompleteIdent(l->obj);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -947,7 +947,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) {
|
if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) {
|
||||||
OPM_WriteString((CHAR*)"(uintptr_t)", (LONGINT)12);
|
OPM_WriteString((CHAR*)"(SYSTEM_ADDRESS)", (LONGINT)17);
|
||||||
}
|
}
|
||||||
OPV_expr(l, exprPrec);
|
OPV_expr(l, exprPrec);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPV__h
|
#ifndef OPV__h
|
||||||
#define OPV__h
|
#define OPV__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
@ -118,14 +118,14 @@ export BOOLEAN Platform_getEnv (CHAR *var, LONGINT var__len, CHAR *val, LONGINT
|
||||||
#define Platform_EXDEV() EXDEV
|
#define Platform_EXDEV() EXDEV
|
||||||
extern void Heap_InitHeap();
|
extern void Heap_InitHeap();
|
||||||
#define Platform_HeapInitHeap() Heap_InitHeap()
|
#define Platform_HeapInitHeap() Heap_InitHeap()
|
||||||
#define Platform_allocate(size) (LONGINT)(uintptr_t)((void*)malloc((size_t)size))
|
#define Platform_allocate(size) (LONGINT)(SYSTEM_ADDRESS)((void*)malloc((size_t)size))
|
||||||
#define Platform_chdir(n, n__len) chdir((char*)n)
|
#define Platform_chdir(n, n__len) chdir((char*)n)
|
||||||
#define Platform_closefile(fd) close(fd)
|
#define Platform_closefile(fd) close(fd)
|
||||||
#define Platform_err() errno
|
#define Platform_err() errno
|
||||||
#define Platform_errc(c) write(1, &c, 1)
|
#define Platform_errc(c) write(1, &c, 1)
|
||||||
#define Platform_errstring(s, s__len) write(1, s, s__len-1)
|
#define Platform_errstring(s, s__len) write(1, s, s__len-1)
|
||||||
#define Platform_exit(code) exit(code)
|
#define Platform_exit(code) exit(code)
|
||||||
#define Platform_free(address) free((void*)(uintptr_t)address)
|
#define Platform_free(address) free((void*)(SYSTEM_ADDRESS)address)
|
||||||
#define Platform_fstat(fd) fstat(fd, &s)
|
#define Platform_fstat(fd) fstat(fd, &s)
|
||||||
#define Platform_fsync(fd) fsync(fd)
|
#define Platform_fsync(fd) fsync(fd)
|
||||||
#define Platform_ftruncate(fd, l) ftruncate(fd, l)
|
#define Platform_ftruncate(fd, l) ftruncate(fd, l)
|
||||||
|
|
@ -138,13 +138,13 @@ extern void Heap_InitHeap();
|
||||||
#define Platform_opennew(n, n__len) open((char*)n, O_CREAT | O_TRUNC | O_RDWR, 0664)
|
#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_openro(n, n__len) open((char*)n, O_RDONLY)
|
||||||
#define Platform_openrw(n, n__len) open((char*)n, O_RDWR)
|
#define Platform_openrw(n, n__len) open((char*)n, O_RDWR)
|
||||||
#define Platform_readfile(fd, p, l) read(fd, (void*)(uintptr_t)(p), l)
|
#define Platform_readfile(fd, p, l) read(fd, (void*)(SYSTEM_ADDRESS)(p), l)
|
||||||
#define Platform_rename(o, o__len, n, n__len) rename((char*)o, (char*)n)
|
#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_sectotm(s) struct tm *time = localtime((time_t*)&s)
|
||||||
#define Platform_seekcur() SEEK_CUR
|
#define Platform_seekcur() SEEK_CUR
|
||||||
#define Platform_seekend() SEEK_END
|
#define Platform_seekend() SEEK_END
|
||||||
#define Platform_seekset() SEEK_SET
|
#define Platform_seekset() SEEK_SET
|
||||||
#define Platform_sethandler(s, h) SystemSetHandler(s, (uintptr_t)h)
|
#define Platform_sethandler(s, h) SystemSetHandler(s, (SYSTEM_ADDRESS)h)
|
||||||
#define Platform_stat(n, n__len) stat((char*)n, &s)
|
#define Platform_stat(n, n__len) stat((char*)n, &s)
|
||||||
#define Platform_statdev() (LONGINT)s.st_dev
|
#define Platform_statdev() (LONGINT)s.st_dev
|
||||||
#define Platform_statino() (LONGINT)s.st_ino
|
#define Platform_statino() (LONGINT)s.st_ino
|
||||||
|
|
@ -161,7 +161,7 @@ extern void Heap_InitHeap();
|
||||||
#define Platform_tvsec() tv.tv_sec
|
#define Platform_tvsec() tv.tv_sec
|
||||||
#define Platform_tvusec() tv.tv_usec
|
#define Platform_tvusec() tv.tv_usec
|
||||||
#define Platform_unlink(n, n__len) unlink((char*)n)
|
#define Platform_unlink(n, n__len) unlink((char*)n)
|
||||||
#define Platform_writefile(fd, p, l) write(fd, (void*)(uintptr_t)(p), l)
|
#define Platform_writefile(fd, p, l) write(fd, (void*)(SYSTEM_ADDRESS)(p), l)
|
||||||
|
|
||||||
BOOLEAN Platform_TooManyFiles (INTEGER e)
|
BOOLEAN Platform_TooManyFiles (INTEGER e)
|
||||||
{
|
{
|
||||||
|
|
@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
|
||||||
Platform_ArgVecPtr av = NIL;
|
Platform_ArgVecPtr av = NIL;
|
||||||
Platform_MainStackFrame = argvadr;
|
Platform_MainStackFrame = argvadr;
|
||||||
Platform_ArgCount = argc;
|
Platform_ArgCount = argc;
|
||||||
av = (Platform_ArgVecPtr)(uintptr_t)argvadr;
|
av = (Platform_ArgVecPtr)(SYSTEM_ADDRESS)argvadr;
|
||||||
Platform_ArgVector = (*av)[0];
|
Platform_ArgVector = (*av)[0];
|
||||||
Platform_HaltCode = -128;
|
Platform_HaltCode = -128;
|
||||||
Platform_HeapInitHeap();
|
Platform_HeapInitHeap();
|
||||||
|
|
@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
|
||||||
{
|
{
|
||||||
Platform_ArgVec av = NIL;
|
Platform_ArgVec av = NIL;
|
||||||
if (n < Platform_ArgCount) {
|
if (n < Platform_ArgCount) {
|
||||||
av = (Platform_ArgVec)(uintptr_t)Platform_ArgVector;
|
av = (Platform_ArgVec)(SYSTEM_ADDRESS)Platform_ArgVector;
|
||||||
__COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len);
|
__COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -529,7 +529,7 @@ INTEGER Platform_Read (LONGINT h, LONGINT p, LONGINT l, LONGINT *n)
|
||||||
INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n)
|
INTEGER Platform_ReadBuf (LONGINT h, SYSTEM_BYTE *b, LONGINT b__len, LONGINT *n)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
*n = Platform_readfile(h, (LONGINT)(uintptr_t)b, b__len);
|
*n = Platform_readfile(h, (LONGINT)(SYSTEM_ADDRESS)b, b__len);
|
||||||
if (*n < 0) {
|
if (*n < 0) {
|
||||||
*n = 0;
|
*n = 0;
|
||||||
_o_result = Platform_err();
|
_o_result = Platform_err();
|
||||||
|
|
@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void)
|
||||||
{
|
{
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
i = 1;
|
i = 1;
|
||||||
__GET((LONGINT)(uintptr_t)&i, Platform_LittleEndian, BOOLEAN);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&i, Platform_LittleEndian, BOOLEAN);
|
||||||
}
|
}
|
||||||
|
|
||||||
__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}};
|
__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}};
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Platform__h
|
#ifndef Platform__h
|
||||||
#define Platform__h
|
#define Platform__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&x + 2, i, INTEGER);
|
||||||
_o_result = __MASK(__ASHR(i, 7), -256);
|
_o_result = __MASK(__ASHR(i, 7), -256);
|
||||||
return _o_result;
|
return _o_result;
|
||||||
}
|
}
|
||||||
|
|
@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x)
|
||||||
void Reals_SetExpo (REAL *x, INTEGER ex)
|
void Reals_SetExpo (REAL *x, INTEGER ex)
|
||||||
{
|
{
|
||||||
CHAR c;
|
CHAR c;
|
||||||
__GET((LONGINT)(uintptr_t)x + 3, c, CHAR);
|
__GET((LONGINT)(SYSTEM_ADDRESS)x + 3, c, CHAR);
|
||||||
__PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
|
__PUT((LONGINT)(SYSTEM_ADDRESS)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
|
||||||
__GET((LONGINT)(uintptr_t)x + 2, c, CHAR);
|
__GET((LONGINT)(SYSTEM_ADDRESS)x + 2, c, CHAR);
|
||||||
__PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
|
__PUT((LONGINT)(SYSTEM_ADDRESS)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
INTEGER Reals_ExpoL (LONGREAL x)
|
INTEGER Reals_ExpoL (LONGREAL x)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&x + 6, i, INTEGER);
|
||||||
_o_result = __MASK(__ASHR(i, 4), -2048);
|
_o_result = __MASK(__ASHR(i, 4), -2048);
|
||||||
return _o_result;
|
return _o_result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Reals__h
|
#ifndef Reals__h
|
||||||
#define Reals__h
|
#define Reals__h
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ void SYSTEM_INHERIT(LONGINT *t, LONGINT *t0)
|
||||||
void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)())
|
void SYSTEM_ENUMP(void *adr, LONGINT n, void (*P)())
|
||||||
{
|
{
|
||||||
while (n > 0) {
|
while (n > 0) {
|
||||||
P((LONGINT)(uintptr_t)(*((void**)(adr))));
|
P((LONGINT)(SYSTEM_ADDRESS)(*((void**)(adr))));
|
||||||
adr = ((void**)adr) + 1;
|
adr = ((void**)adr) + 1;
|
||||||
n--;
|
n--;
|
||||||
}
|
}
|
||||||
|
|
@ -106,7 +106,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim,
|
||||||
else if (typ == (LONGINT*)POINTER__typ) {
|
else if (typ == (LONGINT*)POINTER__typ) {
|
||||||
/* element type is a pointer */
|
/* element type is a pointer */
|
||||||
x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT));
|
x = Heap_NEWBLK(size + nofelems * sizeof(LONGINT));
|
||||||
p = (LONGINT*)(uintptr_t)x[-1];
|
p = (LONGINT*)(SYSTEM_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] = *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 */
|
p -= nofelems - 1; n = 1; /* n =1 for skipping the size field */
|
||||||
while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;}
|
while (n <= nofelems) {*p = n*sizeof(LONGINT); p++; n++;}
|
||||||
|
|
@ -119,7 +119,7 @@ SYSTEM_PTR SYSTEM_NEWARR(LONGINT *typ, LONGINT elemsz, int elemalgn, int nofdim,
|
||||||
while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
|
while (ptab[nofptrs] >= 0) {nofptrs++;} /* number of pointers per element */
|
||||||
nptr = nofelems * nofptrs; /* total number of pointers */
|
nptr = nofelems * nofptrs; /* total number of pointers */
|
||||||
x = Heap_NEWBLK(size + nptr * sizeof(LONGINT));
|
x = Heap_NEWBLK(size + nptr * sizeof(LONGINT));
|
||||||
p = (LONGINT*)(uintptr_t)x[- 1];
|
p = (LONGINT*)(SYSTEM_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] = *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;
|
p -= nptr - 1; n = 0; off = dataoff;
|
||||||
while (n < nofelems) {i = 0;
|
while (n < nofelems) {i = 0;
|
||||||
|
|
@ -155,7 +155,7 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler
|
||||||
// (Ignore other signals)
|
// (Ignore other signals)
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemSetHandler(int s, uintptr_t h) {
|
void SystemSetHandler(int s, SYSTEM_ADDRESS h) {
|
||||||
if (s >= 2 && s <= 4) {
|
if (s >= 2 && s <= 4) {
|
||||||
int needtosetsystemhandler = handler[s-2] == 0;
|
int needtosetsystemhandler = handler[s-2] == 0;
|
||||||
handler[s-2] = (SystemSignalHandler)h;
|
handler[s-2] = (SystemSignalHandler)h;
|
||||||
|
|
@ -194,12 +194,12 @@ typedef void (*SystemSignalHandler)(INTEGER); // = Platform_SignalHandler
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemSetInterruptHandler(uintptr_t h) {
|
void SystemSetInterruptHandler(SYSTEM_ADDRESS h) {
|
||||||
EnsureConsoleCtrlHandler();
|
EnsureConsoleCtrlHandler();
|
||||||
SystemInterruptHandler = (SystemSignalHandler)h;
|
SystemInterruptHandler = (SystemSignalHandler)h;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SystemSetQuitHandler(uintptr_t h) {
|
void SystemSetQuitHandler(SYSTEM_ADDRESS h) {
|
||||||
EnsureConsoleCtrlHandler();
|
EnsureConsoleCtrlHandler();
|
||||||
SystemQuitHandler = (SystemSignalHandler)h;
|
SystemQuitHandler = (SystemSignalHandler)h;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,23 +18,16 @@ typedef unsigned char SYSTEM_CARD8;
|
||||||
|
|
||||||
#if (__SIZEOF_POINTER__ == 8)
|
#if (__SIZEOF_POINTER__ == 8)
|
||||||
#if defined(_WIN64)
|
#if defined(_WIN64)
|
||||||
typedef unsigned long long SYSTEM_PTRINT;
|
typedef unsigned long long SYSTEM_ADDRESS;
|
||||||
typedef unsigned long long uintptr_t;
|
|
||||||
typedef unsigned long long size_t;
|
|
||||||
#else
|
#else
|
||||||
typedef unsigned long SYSTEM_PTRINT;
|
typedef unsigned long SYSTEM_ADDRESS;
|
||||||
typedef unsigned long uintptr_t;
|
|
||||||
typedef unsigned long size_t;
|
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
typedef unsigned int SYSTEM_PTRINT;
|
typedef unsigned int SYSTEM_ADDRESS;
|
||||||
typedef unsigned int uintptr_t;
|
|
||||||
typedef unsigned int size_t;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define _SIZE_T_DEFINED_ // For OpenBSD
|
|
||||||
|
|
||||||
void *memcpy(void *dest, const void *source, size_t size);
|
void *memcpy(void *dest, const void *source, SYSTEM_ADDRESS size);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -111,10 +104,10 @@ extern LONGINT SYSTEM_ENTIER (double x);
|
||||||
// Signal handling in SYSTEM.c
|
// Signal handling in SYSTEM.c
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
extern void SystemSetHandler(int s, uintptr_t h);
|
extern void SystemSetHandler(int s, SYSTEM_ADDRESS h);
|
||||||
#else
|
#else
|
||||||
extern void SystemSetInterruptHandler(uintptr_t h);
|
extern void SystemSetInterruptHandler(SYSTEM_ADDRESS h);
|
||||||
extern void SystemSetQuitHandler (uintptr_t h);
|
extern void SystemSetQuitHandler (SYSTEM_ADDRESS h);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -137,9 +130,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; \
|
#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;}
|
while(_i<_t&&((_b[_i]=_a[_i])!=0)){_i++;};_b[_i]=0;}
|
||||||
#define __DUP(x, l, t) x=(void*)memcpy((void*)(uintptr_t)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t))
|
#define __DUP(x, l, t) x=(void*)memcpy((void*)(SYSTEM_ADDRESS)Platform_OSAllocate(l*sizeof(t)),x,l*sizeof(t))
|
||||||
#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t))
|
#define __DUPARR(v, t) v=(void*)memcpy(v##__copy,v,sizeof(t))
|
||||||
#define __DEL(x) Platform_OSFree((LONGINT)(uintptr_t)x)
|
#define __DEL(x) Platform_OSFree((LONGINT)(SYSTEM_ADDRESS)x)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -149,8 +142,8 @@ static int __str_cmp(CHAR *x, CHAR *y){
|
||||||
#define __VAL(t, x) (*(t*)&(x))
|
#define __VAL(t, x) (*(t*)&(x))
|
||||||
|
|
||||||
|
|
||||||
#define __GET(a, x, t) x= *(t*)(uintptr_t)(a)
|
#define __GET(a, x, t) x= *(t*)(SYSTEM_ADDRESS)(a)
|
||||||
#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x
|
#define __PUT(a, x, t) *(t*)(SYSTEM_ADDRESS)(a)=x
|
||||||
|
|
||||||
#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n)))
|
#define __LSHL(x, n, t) ((t)((U_##t)(x)<<(n)))
|
||||||
#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n)))
|
#define __LSHR(x, n, t) ((t)((U_##t)(x)>>(n)))
|
||||||
|
|
@ -165,7 +158,7 @@ static int __str_cmp(CHAR *x, CHAR *y){
|
||||||
#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t))
|
#define __ROT(x, n, t) ((n)>=0? __ROTL(x, n, t): __ROTR(x, -(n), t))
|
||||||
|
|
||||||
#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1)
|
#define __BIT(x, n) (*(U_LONGINT*)(x)>>(n)&1)
|
||||||
#define __MOVE(s, d, n) memcpy((char*)(uintptr_t)(d),(char*)(uintptr_t)(s),n)
|
#define __MOVE(s, d, n) memcpy((char*)(SYSTEM_ADDRESS)(d),(char*)(SYSTEM_ADDRESS)(s),n)
|
||||||
#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n))
|
#define __ASHF(x, n) SYSTEM_ASH((LONGINT)(x), (LONGINT)(n))
|
||||||
#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0)))
|
#define __SHORT(x, y) ((int)((U_LONGINT)(x)+(y)<(y)+(y)?(x):(__HALT(-8),0)))
|
||||||
#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y)))
|
#define __SHORTF(x, y) ((int)(__RF((x)+(y),(y)+(y))-(y)))
|
||||||
|
|
@ -226,7 +219,7 @@ extern void Heap_INCREF();
|
||||||
extern void Platform_Init(INTEGER argc, LONGINT argv);
|
extern void Platform_Init(INTEGER argc, LONGINT argv);
|
||||||
extern void Heap_FINALL();
|
extern void Heap_FINALL();
|
||||||
|
|
||||||
#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(uintptr_t)&argv);
|
#define __INIT(argc, argv) static void *m; Platform_Init((INTEGER)argc, (LONGINT)(SYSTEM_ADDRESS)&argv);
|
||||||
#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
|
#define __REGMAIN(name, enum) m = Heap_REGMOD((CHAR*)name,enum)
|
||||||
#define __FINI Heap_FINALL(); return 0
|
#define __FINI Heap_FINALL(); return 0
|
||||||
|
|
||||||
|
|
@ -247,7 +240,7 @@ extern SYSTEM_PTR Heap_NEWREC (LONGINT tag);
|
||||||
extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...);
|
extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...);
|
||||||
|
|
||||||
#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len))
|
#define __SYSNEW(p, len) p = Heap_NEWBLK((LONGINT)(len))
|
||||||
#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(uintptr_t)t##__typ)
|
#define __NEW(p, t) p = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)t##__typ)
|
||||||
#define __NEWARR SYSTEM_NEWARR
|
#define __NEWARR SYSTEM_NEWARR
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -278,20 +271,20 @@ extern SYSTEM_PTR SYSTEM_NEWARR(LONGINT*, LONGINT, int, int, int, ...);
|
||||||
#define __INITYP(t, t0, level) \
|
#define __INITYP(t, t0, level) \
|
||||||
t##__typ = (LONGINT*)&t##__desc.blksz; \
|
t##__typ = (LONGINT*)&t##__desc.blksz; \
|
||||||
memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \
|
memcpy(t##__desc.basep, t0##__typ - __BASEOFF, level*sizeof(LONGINT)); \
|
||||||
t##__desc.basep[level] = (LONGINT)(uintptr_t)t##__typ; \
|
t##__desc.basep[level] = (LONGINT)(SYSTEM_ADDRESS)t##__typ; \
|
||||||
t##__desc.module = (LONGINT)(uintptr_t)m; \
|
t##__desc.module = (LONGINT)(SYSTEM_ADDRESS)m; \
|
||||||
if(t##__desc.blksz!=sizeof(struct t)) __HALT(-15); \
|
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)); \
|
t##__desc.blksz = (t##__desc.blksz+5*sizeof(LONGINT)-1)/(4*sizeof(LONGINT))*(4*sizeof(LONGINT)); \
|
||||||
Heap_REGTYP(m, (LONGINT)(uintptr_t)&t##__desc.next); \
|
Heap_REGTYP(m, (LONGINT)(SYSTEM_ADDRESS)&t##__desc.next); \
|
||||||
SYSTEM_INHERIT(t##__typ, t0##__typ)
|
SYSTEM_INHERIT(t##__typ, t0##__typ)
|
||||||
|
|
||||||
#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(uintptr_t)typ##__typ)
|
#define __IS(tag, typ, level) (*(tag-(__BASEOFF-level))==(LONGINT)(SYSTEM_ADDRESS)typ##__typ)
|
||||||
#define __TYPEOF(p) ((LONGINT*)(uintptr_t)(*(((LONGINT*)(p))-1)))
|
#define __TYPEOF(p) ((LONGINT*)(SYSTEM_ADDRESS)(*(((LONGINT*)(p))-1)))
|
||||||
#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level)
|
#define __ISP(p, typ, level) __IS(__TYPEOF(p),typ,level)
|
||||||
|
|
||||||
// Oberon-2 type bound procedures support
|
// Oberon-2 type bound procedures support
|
||||||
#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(uintptr_t)proc
|
#define __INITBP(t, proc, num) *(t##__typ-(__TPROC0OFF+num))=(LONGINT)(SYSTEM_ADDRESS)proc
|
||||||
#define __SEND(typ, num, funtyp, parlist) ((funtyp)((uintptr_t)*(typ-(__TPROC0OFF+num))))parlist
|
#define __SEND(typ, num, funtyp, parlist) ((funtyp)((SYSTEM_ADDRESS)*(typ-(__TPROC0OFF+num))))parlist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Strings__h
|
#ifndef Strings__h
|
||||||
#define Strings__h
|
#define Strings__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Files.h"
|
#include "Files.h"
|
||||||
#include "Modules.h"
|
#include "Modules.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Texts__h
|
#ifndef Texts__h
|
||||||
#define Texts__h
|
#define Texts__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkamSf */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkamSf */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Heap.h"
|
#include "Heap.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
typedef
|
typedef
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef errors__h
|
#ifndef errors__h
|
||||||
#define errors__h
|
#define errors__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef extTools__h
|
#ifndef extTools__h
|
||||||
#define extTools__h
|
#define extTools__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
#include "Strings.h"
|
#include "Strings.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef vt100__h
|
#ifndef vt100__h
|
||||||
#define vt100__h
|
#define vt100__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
|
|
@ -14,6 +14,6 @@ export void *Configuration__init(void)
|
||||||
__DEFMOD;
|
__DEFMOD;
|
||||||
__REGMOD("Configuration", 0);
|
__REGMOD("Configuration", 0);
|
||||||
/* BEGIN */
|
/* BEGIN */
|
||||||
__MOVE("1.95 [2016/08/22] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
__MOVE("1.95 [2016/08/23] for gcc LP64 on cygwin", Configuration_versionLong, 41);
|
||||||
__ENDMOD;
|
__ENDMOD;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Configuration__h
|
#ifndef Configuration__h
|
||||||
#define Configuration__h
|
#define Configuration__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Platform.h"
|
#include "Platform.h"
|
||||||
|
|
@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len);
|
||||||
void Console_Flush (void)
|
void Console_Flush (void)
|
||||||
{
|
{
|
||||||
INTEGER error;
|
INTEGER error;
|
||||||
error = Platform_Write(((LONGINT)(1)), (LONGINT)(uintptr_t)Console_line, Console_pos);
|
error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADDRESS)Console_line, Console_pos);
|
||||||
Console_pos = 0;
|
Console_pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Console__h
|
#ifndef Console__h
|
||||||
#define Console__h
|
#define Console__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
|
@ -258,7 +258,7 @@ static void Files_Flush (Files_Buffer buf)
|
||||||
if (buf->org != f->pos) {
|
if (buf->org != f->pos) {
|
||||||
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
|
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
|
||||||
}
|
}
|
||||||
error = Platform_Write(f->fd, (LONGINT)(uintptr_t)buf->data, buf->size);
|
error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADDRESS)buf->data, buf->size);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
|
||||||
}
|
}
|
||||||
|
|
@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
|
||||||
} else {
|
} else {
|
||||||
min = n;
|
min = n;
|
||||||
}
|
}
|
||||||
__MOVE((LONGINT)(uintptr_t)buf->data + offset, (LONGINT)(uintptr_t)x + xpos, min);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)buf->data + offset, (LONGINT)(SYSTEM_ADDRESS)x + xpos, min);
|
||||||
offset += min;
|
offset += min;
|
||||||
(*r).offset = offset;
|
(*r).offset = offset;
|
||||||
xpos += min;
|
xpos += min;
|
||||||
|
|
@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
|
||||||
} else {
|
} else {
|
||||||
min = n;
|
min = n;
|
||||||
}
|
}
|
||||||
__MOVE((LONGINT)(uintptr_t)x + xpos, (LONGINT)(uintptr_t)buf->data + offset, min);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)x + xpos, (LONGINT)(SYSTEM_ADDRESS)buf->data + offset, min);
|
||||||
offset += min;
|
offset += min;
|
||||||
(*r).offset = offset;
|
(*r).offset = offset;
|
||||||
if (offset > buf->size) {
|
if (offset > buf->size) {
|
||||||
|
|
@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
|
||||||
*res = 3;
|
*res = 3;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n);
|
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n);
|
||||||
while (n > 0) {
|
while (n > 0) {
|
||||||
error = Platform_Write(fdnew, (LONGINT)(uintptr_t)buf, n);
|
error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADDRESS)buf, n);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
ignore = Platform_Close(fdold);
|
ignore = Platform_Close(fdold);
|
||||||
ignore = Platform_Close(fdnew);
|
ignore = Platform_Close(fdnew);
|
||||||
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
|
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
|
||||||
}
|
}
|
||||||
error = Platform_Read(fdold, (LONGINT)(uintptr_t)buf, ((LONGINT)(4096)), &n);
|
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADDRESS)buf, ((LONGINT)(4096)), &n);
|
||||||
}
|
}
|
||||||
ignore = Platform_Close(fdold);
|
ignore = Platform_Close(fdold);
|
||||||
ignore = Platform_Close(fdnew);
|
ignore = Platform_Close(fdnew);
|
||||||
|
|
@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
|
||||||
j += 1;
|
j += 1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
__MOVE((LONGINT)(uintptr_t)src, (LONGINT)(uintptr_t)dest, src__len);
|
__MOVE((LONGINT)(SYSTEM_ADDRESS)src, (LONGINT)(SYSTEM_ADDRESS)dest, src__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1009,7 +1009,7 @@ static void Files_Finalize (SYSTEM_PTR o)
|
||||||
{
|
{
|
||||||
Files_File f = NIL;
|
Files_File f = NIL;
|
||||||
LONGINT res;
|
LONGINT res;
|
||||||
f = (Files_File)(uintptr_t)o;
|
f = (Files_File)(SYSTEM_ADDRESS)o;
|
||||||
if (f->fd >= 0) {
|
if (f->fd >= 0) {
|
||||||
Files_CloseOSFile(f);
|
Files_CloseOSFile(f);
|
||||||
if (f->tempFile) {
|
if (f->tempFile) {
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tspkaSfF */
|
||||||
|
|
||||||
#ifndef Files__h
|
#ifndef Files__h
|
||||||
#define Files__h
|
#define Files__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ export void Heap_Unlock (void);
|
||||||
extern void *Heap__init();
|
extern void *Heap__init();
|
||||||
extern LONGINT Platform_MainStackFrame;
|
extern LONGINT Platform_MainStackFrame;
|
||||||
extern LONGINT Platform_OSAllocate(LONGINT size);
|
extern LONGINT Platform_OSAllocate(LONGINT size);
|
||||||
#define Heap_FetchAddress(pointer) (LONGINT)(uintptr_t)(*((void**)((uintptr_t)pointer)))
|
#define Heap_FetchAddress(pointer) (LONGINT)(SYSTEM_ADDRESS)(*((void**)((SYSTEM_ADDRESS)pointer)))
|
||||||
#define Heap_HeapModuleInit() Heap__init()
|
#define Heap_HeapModuleInit() Heap__init()
|
||||||
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
|
#define Heap_OSAllocate(size) Platform_OSAllocate(size)
|
||||||
#define Heap_PlatformHalt(code) Platform_Halt(code)
|
#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, ((LONGINT)(20)));
|
__COPY(name, m->name, ((LONGINT)(20)));
|
||||||
m->refcnt = 0;
|
m->refcnt = 0;
|
||||||
m->enumPtrs = enumPtrs;
|
m->enumPtrs = enumPtrs;
|
||||||
m->next = (Heap_Module)(uintptr_t)Heap_modules;
|
m->next = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
|
||||||
Heap_modules = (SYSTEM_PTR)m;
|
Heap_modules = (SYSTEM_PTR)m;
|
||||||
_o_result = (void*)m;
|
_o_result = (void*)m;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -316,7 +316,7 @@ SYSTEM_PTR Heap_NEWREC (LONGINT tag)
|
||||||
__PUT(adr + 16, 0, LONGINT);
|
__PUT(adr + 16, 0, LONGINT);
|
||||||
Heap_allocated += blksz;
|
Heap_allocated += blksz;
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = (SYSTEM_PTR)(uintptr_t)(adr + 8);
|
_o_result = (SYSTEM_PTR)(SYSTEM_ADDRESS)(adr + 8);
|
||||||
return _o_result;
|
return _o_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
||||||
SYSTEM_PTR new;
|
SYSTEM_PTR new;
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
blksz = __ASHL(__ASHR(size + 63, 5), 5);
|
blksz = __ASHL(__ASHR(size + 63, 5), 5);
|
||||||
new = Heap_NEWREC((LONGINT)(uintptr_t)&blksz);
|
new = Heap_NEWREC((LONGINT)(SYSTEM_ADDRESS)&blksz);
|
||||||
tag = ((LONGINT)(uintptr_t)new + blksz) - 24;
|
tag = ((LONGINT)(SYSTEM_ADDRESS)new + blksz) - 24;
|
||||||
__PUT(tag - 8, 0, LONGINT);
|
__PUT(tag - 8, 0, LONGINT);
|
||||||
__PUT(tag, blksz, LONGINT);
|
__PUT(tag, blksz, LONGINT);
|
||||||
__PUT(tag + 8, -8, LONGINT);
|
__PUT(tag + 8, -8, LONGINT);
|
||||||
__PUT((LONGINT)(uintptr_t)new - 8, tag, LONGINT);
|
__PUT((LONGINT)(SYSTEM_ADDRESS)new - 8, tag, LONGINT);
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = new;
|
_o_result = new;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
__GET(tag, offset, LONGINT);
|
__GET(tag, offset, LONGINT);
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
p = Heap_FetchAddress(fld);
|
p = Heap_FetchAddress(fld);
|
||||||
__PUT(fld, (SYSTEM_PTR)(uintptr_t)n, SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)n, SYSTEM_PTR);
|
||||||
} else {
|
} else {
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
n = Heap_FetchAddress(fld);
|
n = Heap_FetchAddress(fld);
|
||||||
|
|
@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
if (!__ODD(tagbits)) {
|
if (!__ODD(tagbits)) {
|
||||||
__PUT(n - 8, tagbits + 1, LONGINT);
|
__PUT(n - 8, tagbits + 1, LONGINT);
|
||||||
__PUT(q - 8, tag + 1, LONGINT);
|
__PUT(q - 8, tag + 1, LONGINT);
|
||||||
__PUT(fld, (SYSTEM_PTR)(uintptr_t)p, SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADDRESS)p, SYSTEM_PTR);
|
||||||
p = q;
|
p = q;
|
||||||
q = n;
|
q = n;
|
||||||
tag = tagbits;
|
tag = tagbits;
|
||||||
|
|
@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
|
|
||||||
static void Heap_MarkP (SYSTEM_PTR p)
|
static void Heap_MarkP (SYSTEM_PTR p)
|
||||||
{
|
{
|
||||||
Heap_Mark((LONGINT)(uintptr_t)p);
|
Heap_Mark((LONGINT)(SYSTEM_ADDRESS)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Heap_Scan (void)
|
static void Heap_Scan (void)
|
||||||
|
|
@ -554,7 +554,7 @@ static void Heap_Finalize (void)
|
||||||
} else {
|
} else {
|
||||||
prev->next = n->next;
|
prev->next = n->next;
|
||||||
}
|
}
|
||||||
(*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj);
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
|
||||||
if (prev == NIL) {
|
if (prev == NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -573,7 +573,7 @@ void Heap_FINALL (void)
|
||||||
while (Heap_fin != NIL) {
|
while (Heap_fin != NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
Heap_fin = Heap_fin->next;
|
Heap_fin = Heap_fin->next;
|
||||||
(*n->finalize)((SYSTEM_PTR)(uintptr_t)n->obj);
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADDRESS)n->obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len)
|
||||||
}
|
}
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
nofcand = 0;
|
nofcand = 0;
|
||||||
sp = (LONGINT)(uintptr_t)&frame;
|
sp = (LONGINT)(SYSTEM_ADDRESS)&frame;
|
||||||
stack0 = Heap_PlatformMainStackFrame();
|
stack0 = Heap_PlatformMainStackFrame();
|
||||||
inc = (LONGINT)(uintptr_t)&align.p - (LONGINT)(uintptr_t)&align;
|
inc = (LONGINT)(SYSTEM_ADDRESS)&align.p - (LONGINT)(SYSTEM_ADDRESS)&align;
|
||||||
if (sp > stack0) {
|
if (sp > stack0) {
|
||||||
inc = -inc;
|
inc = -inc;
|
||||||
}
|
}
|
||||||
|
|
@ -623,7 +623,7 @@ void Heap_GC (BOOLEAN markStack)
|
||||||
LONGINT cand[10000];
|
LONGINT cand[10000];
|
||||||
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
|
if (Heap_lockdepth == 0 || (Heap_lockdepth == 1 && !markStack)) {
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
m = (Heap_Module)(uintptr_t)Heap_modules;
|
m = (Heap_Module)(SYSTEM_ADDRESS)Heap_modules;
|
||||||
while (m != NIL) {
|
while (m != NIL) {
|
||||||
if (m->enumPtrs != NIL) {
|
if (m->enumPtrs != NIL) {
|
||||||
(*m->enumPtrs)(Heap_MarkP);
|
(*m->enumPtrs)(Heap_MarkP);
|
||||||
|
|
@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
|
||||||
{
|
{
|
||||||
Heap_FinNode f;
|
Heap_FinNode f;
|
||||||
__NEW(f, Heap_FinDesc);
|
__NEW(f, Heap_FinDesc);
|
||||||
f->obj = (LONGINT)(uintptr_t)obj;
|
f->obj = (LONGINT)(SYSTEM_ADDRESS)obj;
|
||||||
f->finalize = finalize;
|
f->finalize = finalize;
|
||||||
f->marked = 1;
|
f->marked = 1;
|
||||||
f->next = Heap_fin;
|
f->next = Heap_fin;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin tskSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin tskSfF */
|
||||||
|
|
||||||
#ifndef Heap__h
|
#ifndef Heap__h
|
||||||
#define Heap__h
|
#define Heap__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Console.h"
|
#include "Console.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef Modules__h
|
#ifndef Modules__h
|
||||||
#define Modules__h
|
#define Modules__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPM.h"
|
#include "OPM.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPB__h
|
#ifndef OPB__h
|
||||||
#define OPB__h
|
#define OPB__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPC__h
|
#ifndef OPC__h
|
||||||
#define OPC__h
|
#define OPC__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "Configuration.h"
|
#include "Configuration.h"
|
||||||
|
|
@ -545,7 +545,7 @@ void OPM_FPrintReal (LONGINT *fp, REAL real)
|
||||||
{
|
{
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
LONGINT l;
|
LONGINT l;
|
||||||
__GET((LONGINT)(uintptr_t)&real, i, INTEGER);
|
__GET((LONGINT)(SYSTEM_ADDRESS)&real, i, INTEGER);
|
||||||
l = i;
|
l = i;
|
||||||
OPM_FPrint(&*fp, l);
|
OPM_FPrint(&*fp, l);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPM__h
|
#ifndef OPM__h
|
||||||
#define OPM__h
|
#define OPM__h
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
#define LARGE
|
#define LARGE
|
||||||
#include "SYSTEM.h"
|
#include "SYSTEM.h"
|
||||||
#include "OPB.h"
|
#include "OPB.h"
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
/* voc 1.95 [2016/08/22] for gcc LP64 on cygwin xtspkaSfF */
|
/* voc 1.95 [2016/08/23] for gcc LP64 on cygwin xtspkaSfF */
|
||||||
|
|
||||||
#ifndef OPP__h
|
#ifndef OPP__h
|
||||||
#define OPP__h
|
#define OPP__h
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue