Base expression casting on C int size, remove dependencies on form=LInt.

This commit is contained in:
David Brown 2016-08-31 17:15:44 +01:00
parent b3c71fb2f0
commit 0508097ffe
199 changed files with 6800 additions and 6540 deletions

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
@ -13,6 +13,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Platform.h"
@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len);
void Console_Flush (void)
{
INTEGER error;
error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos);
error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos);
Console_pos = 0;
}
@ -30,7 +30,7 @@ void Console_Char (CHAR ch)
if (Console_pos == 128) {
Console_Flush();
}
Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch;
Console_line[__X(Console_pos, 128)] = ch;
Console_pos += 1;
if (ch == 0x0a) {
Console_Flush();
@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n)
k = 10;
} else {
i1 = __ABS(i);
s[0] = (CHAR)(__MOD(i1, 10) + 48);
s[0] = (CHAR)((int)__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k = 1;
while (i1 > 0) {
s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48);
s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k += 1;
}
}
if (i < 0) {
s[__X(k, ((LONGINT)(32)))] = '-';
s[__X(k, 32)] = '-';
k += 1;
}
while (n > k) {
@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n)
}
while (k > 0) {
k -= 1;
Console_Char(s[__X(k, ((LONGINT)(32)))]);
Console_Char(s[__X(k, 32)]);
}
}
@ -89,9 +89,9 @@ void Console_Ln (void)
void Console_Bool (BOOLEAN b)
{
if (b) {
Console_String((CHAR*)"TRUE", (LONGINT)5);
Console_String((CHAR*)"TRUE", 5);
} else {
Console_String((CHAR*)"FALSE", (LONGINT)6);
Console_String((CHAR*)"FALSE", 6);
}
}
@ -115,7 +115,7 @@ void Console_Read (CHAR *ch)
LONGINT n;
INTEGER error;
Console_Flush();
error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n);
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n);
if (n != 1) {
*ch = 0x00;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h
#define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"
@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode)
{
__DUP(s, s__len, CHAR);
Console_Ln();
Console_String((CHAR*)"-- ", (LONGINT)4);
Console_String((CHAR*)"-- ", 4);
Console_String(s, s__len);
Console_String((CHAR*)": ", (LONGINT)3);
Console_String((CHAR*)": ", 3);
if (f != NIL) {
if (f->registerName[0] != 0x00) {
Console_String(f->registerName, ((LONGINT)(101)));
Console_String(f->registerName, 101);
} else {
Console_String(f->workName, ((LONGINT)(101)));
Console_String(f->workName, 101);
}
if (f->fd != 0) {
Console_String((CHAR*)"f.fd = ", (LONGINT)8);
Console_Int(f->fd, ((LONGINT)(1)));
Console_String((CHAR*)"f.fd = ", 8);
Console_Int(f->fd, 1);
}
}
if (errcode != 0) {
Console_String((CHAR*)" errcode = ", (LONGINT)12);
Console_Int(errcode, ((LONGINT)(1)));
Console_String((CHAR*)" errcode = ", 12);
Console_Int(errcode, 1);
}
Console_Ln();
__HALT(99);
@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na
name[i + 5] = '.';
i += 6;
while (n > 0) {
name[i] = (CHAR)(__MOD(n, 10) + 48);
name[i] = (CHAR)((int)__MOD(n, 10) + 48);
n = __DIV(n, 10);
i += 1;
}
@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na
i += 1;
n = Platform_PID;
while (n > 0) {
name[i] = (CHAR)(__MOD(n, 10) + 48);
name[i] = (CHAR)((int)__MOD(n, 10) + 48);
n = __DIV(n, 10);
i += 1;
}
@ -216,15 +216,15 @@ static void Files_Create (Files_File f)
CHAR err[32];
if (f->fd == -1) {
if (f->state == 1) {
Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101)));
Files_GetTempName(f->registerName, 101, (void*)f->workName, 101);
f->tempFile = 1;
} else if (f->state == 2) {
__COPY(f->registerName, f->workName, ((LONGINT)(101)));
__COPY(f->registerName, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
}
error = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
error = Platform_Unlink((void*)f->workName, 101);
error = Platform_New((void*)f->workName, 101, &f->fd);
done = error == 0;
if (done) {
f->next = Files_files;
@ -242,7 +242,7 @@ static void Files_Create (Files_File f)
} else {
__MOVE("file not created", err, 17);
}
Files_Err(err, ((LONGINT)(32)), f, error);
Files_Err(err, 32, f, error);
}
}
}
@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf)
if (buf->org != f->pos) {
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
}
error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size);
error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size);
if (error != 0) {
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
Files_Err((CHAR*)"error writing file", 19, f, error);
}
f->pos = buf->org + buf->size;
buf->chg = 0;
error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ);
if (error != 0) {
Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error);
Files_Err((CHAR*)"error identifying file", 23, f, error);
}
}
}
@ -304,7 +304,7 @@ void Files_Close (Files_File f)
}
error = Platform_Sync(f->fd);
if (error != 0) {
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
Files_Err((CHAR*)"error writing file", 19, f, error);
}
Files_CloseOSFile(f);
}
@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
__DUP(name, name__len, CHAR);
__NEW(f, Files_FileDesc);
f->workName[0] = 0x00;
__COPY(name, f->registerName, ((LONGINT)(101)));
__COPY(name, f->registerName, 101);
f->fd = -1;
f->state = 1;
f->len = 0;
@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
if (name[0] != 0x00) {
if (Files_HasDir((void*)name, name__len)) {
dir[0] = 0x00;
__COPY(name, path, ((LONGINT)(256)));
__COPY(name, path, 256);
} else {
pos = 0;
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, 256);
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256);
}
for (;;) {
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
error = Platform_OldRW((void*)path, 256, &fd);
done = error == 0;
if ((!done && Platform_TooManyFiles(error))) {
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error);
Files_Err((CHAR*)"too many files open", 20, f, error);
}
if ((!done && Platform_Inaccessible(error))) {
error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd);
error = Platform_OldRO((void*)path, 256, &fd);
done = error == 0;
}
if ((!done && !Platform_Absent(error))) {
Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20);
Console_String((CHAR*)"Warning: Files.Old ", 20);
Console_String(name, name__len);
Console_String((CHAR*)" error = ", (LONGINT)10);
Console_Int(error, ((LONGINT)(0)));
Console_String((CHAR*)" error = ", 10);
Console_Int(error, 0);
Console_Ln();
}
if (done) {
@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
f->pos = 0;
f->swapper = -1;
error = Platform_Size(fd, &f->len);
__COPY(name, f->workName, ((LONGINT)(101)));
__COPY(name, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
f->identity = identity;
@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
__DEL(name);
return _o_result;
} else {
Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256);
}
}
} else {
@ -518,8 +518,8 @@ void Files_Purge (Files_File f)
i += 1;
}
if (f->fd != -1) {
error = Platform_Truncate(f->fd, ((LONGINT)(0)));
error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet);
error = Platform_Truncate(f->fd, 0);
error = Platform_Seek(f->fd, 0, Platform_SeekSet);
}
f->pos = 0;
f->len = 0;
@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos)
if (f->pos != org) {
error = Platform_Seek(f->fd, org, Platform_SeekSet);
}
error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n);
error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n);
if (error != 0) {
Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error);
Files_Err((CHAR*)"read from file not done", 24, f, error);
}
f->pos = org + n;
buf->size = n;
@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else {
min = n;
}
__MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min);
__MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min);
offset += min;
(*r).offset = offset;
xpos += min;
@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len)
{
Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1)));
Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1);
}
Files_File Files_Base (Files_Rider *r, LONGINT *r__typ)
@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else {
min = n;
}
__MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min);
__MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min);
offset += min;
(*r).offset = offset;
if (offset > buf->size) {
@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
*res = 3;
return;
}
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n);
error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n);
while (n > 0) {
error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n);
error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n);
if (error != 0) {
ignore = Platform_Close(fdold);
ignore = Platform_Close(fdnew);
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
Files_Err((CHAR*)"cannot move file", 17, NIL, error);
}
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n);
error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n);
}
ignore = Platform_Close(fdold);
ignore = Platform_Close(fdnew);
@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
error = Platform_Unlink((void*)old, old__len);
*res = 0;
} else {
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
Files_Err((CHAR*)"cannot move file", 17, NIL, error);
}
}
} else {
@ -808,12 +808,12 @@ void Files_Register (Files_File f)
}
Files_Close(f);
if (f->registerName[0] != 0x00) {
Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode);
Files_Rename(f->workName, 101, f->registerName, 101, &errcode);
if (errcode != 0) {
__COPY(f->registerName, file, ((LONGINT)(104)));
__COPY(f->registerName, file, 104);
__HALT(99);
}
__COPY(f->registerName, f->workName, ((LONGINT)(101)));
__COPY(f->registerName, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
}
@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
j += 1;
}
} else {
__MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len);
__MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len);
}
}
@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x)
void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x)
{
CHAR b[2];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2)));
*x = (int)b[0] + __ASHL((int)b[1], 8);
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2);
*x = b[0] + __ASHL(b[1], 8);
}
void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
*x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24);
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
*x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
}
void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x)
{
CHAR b[4];
LONGINT l;
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24);
*x = (SET)l;
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = __VAL(SET, l);
}
void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4)));
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
Files_FlipBytes((void*)b, 4, (void*)&*x, 4);
}
void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x)
{
CHAR b[8];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8)));
Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8)));
Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8);
Files_FlipBytes((void*)b, 8, (void*)&*x, 8);
}
void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len)
@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
s = 0;
n = 0;
Files_Read(&*R, R__typ, (void*)&ch);
while ((int)ch >= 128) {
n += __ASH((int)((int)ch - 128), s);
while (ch >= 128) {
n += __ASH((ch - 128), s);
s += 7;
Files_Read(&*R, R__typ, (void*)&ch);
}
n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s);
n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s);
*x = n;
}
@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x)
CHAR b[2];
b[0] = (CHAR)x;
b[1] = (CHAR)__ASHR(x, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2)));
Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2);
}
void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x)
@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x)
b[1] = (CHAR)__ASHR(x, 8);
b[2] = (CHAR)__ASHR(x, 16);
b[3] = (CHAR)__ASHR(x, 24);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x)
{
CHAR b[4];
LONGINT i;
i = (LONGINT)x;
i = __VAL(LONGINT, x);
b[0] = (CHAR)i;
b[1] = (CHAR)__ASHR(i, 8);
b[2] = (CHAR)__ASHR(i, 16);
b[3] = (CHAR)__ASHR(i, 24);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x)
{
CHAR b[4];
Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_FlipBytes((void*)&x, 4, (void*)b, 4);
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x)
{
CHAR b[8];
Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8)));
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8)));
Files_FlipBytes((void*)&x, 8, (void*)b, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8);
}
void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len)
@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len
while (x[i] != 0x00) {
i += 1;
}
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1);
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
}
void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x)
@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o)
if (f->fd >= 0) {
Files_CloseOSFile(f);
if (f->tempFile) {
res = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
res = Platform_Unlink((void*)f->workName, 101);
}
}
}
@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len)
{
__DUP(path, path__len, CHAR);
if (Strings_Length(path, path__len) != 0) {
Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1));
Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1))));
__COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]);
} else {
Files_SearchPath = NIL;
@ -1055,6 +1055,6 @@ export void *Files__init(void)
Files_tempno = -1;
Heap_FileCount = 0;
Files_HOME[0] = 0x00;
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h
#define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */
#include "SYSTEM.h"
struct Heap__1 {
@ -116,7 +116,7 @@ void Heap_Unlock (void)
{
Heap_lockdepth -= 1;
if ((Heap_interrupted && Heap_lockdepth == 0)) {
Heap_PlatformHalt(((LONGINT)(-9)));
Heap_PlatformHalt(-9);
}
}
@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
}
m->types = 0;
m->cmds = NIL;
__COPY(name, m->name, ((LONGINT)(20)));
__COPY(name, m->name, 20);
m->refcnt = 0;
m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules;
@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
} else {
__NEW(c, Heap_CmdDesc);
}
__COPY(name, c->name, ((LONGINT)(24)));
__COPY(name, c->name, 24);
c->cmd = cmd;
c->next = m->cmds;
m->cmds = c;
@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
SYSTEM_PTR new;
Heap_Lock();
blksz = __ASHL(__ASHR(size + 31, 4), 4);
new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz);
tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12;
new = Heap_NEWREC((SYSTEM_ADRINT)&blksz);
tag = (__VAL(LONGINT, new) + blksz) - 12;
__PUT(tag - 4, 0, LONGINT);
__PUT(tag, blksz, LONGINT);
__PUT(tag + 4, -4, LONGINT);
__PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT);
__PUT(__VAL(LONGINT, new) - 4, tag, LONGINT);
Heap_Unlock();
_o_result = new;
return _o_result;
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
__GET(tag, offset, LONGINT);
fld = q + offset;
p = Heap_FetchAddress(fld);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
__PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR);
} else {
fld = q + offset;
n = Heap_FetchAddress(fld);
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
if (!__ODD(tagbits)) {
__PUT(n - 4, tagbits + 1, LONGINT);
__PUT(q - 4, tag + 1, LONGINT);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR);
__PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR);
p = q;
q = n;
tag = tagbits;
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
static void Heap_MarkP (SYSTEM_PTR p)
{
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
Heap_Mark(__VAL(LONGINT, p));
}
static void Heap_Scan (void)
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
} else {
prev->next = n->next;
}
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
if (prev == NIL) {
n = Heap_fin;
} else {
@ -572,7 +572,7 @@ void Heap_FINALL (void)
while (Heap_fin != NIL) {
n = Heap_fin;
Heap_fin = Heap_fin->next;
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
}
}
@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len)
}
if (n == 0) {
nofcand = 0;
sp = (LONGINT)(SYSTEM_ADRINT)&frame;
sp = (SYSTEM_ADRINT)&frame;
stack0 = Heap_PlatformMainStackFrame();
inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align;
inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align;
if (sp > stack0) {
inc = -inc;
}
@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack)
i22 += 23;
i23 += 24;
if ((i0 == -99 && i15 == 24)) {
Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000)));
Heap_MarkStack(32, (void*)cand, 10000);
break;
}
}
@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
{
Heap_FinNode f;
__NEW(f, Heap_FinDesc);
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
f->obj = __VAL(LONGINT, obj);
f->finalize = finalize;
f->marked = 1;
f->next = Heap_fin;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Console.h"
#include "Heap.h"
@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
Modules_resMsg[0] = 0x00;
} else {
Modules_res = 1;
__COPY(name, Modules_importing, ((LONGINT)(20)));
__COPY(name, Modules_importing, 20);
__MOVE(" module \"", Modules_resMsg, 10);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12);
Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
}
_o_result = m;
__DEL(name);
@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
} else {
Modules_res = 2;
__MOVE(" command \"", Modules_resMsg, 11);
__COPY(name, Modules_importing, ((LONGINT)(20)));
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20)));
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12);
__COPY(name, Modules_importing, 20);
Modules_Append((void*)Modules_resMsg, 256, mod->name, 20);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2);
Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
_o_result = NIL;
__DEL(name);
return _o_result;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h
#define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"
#include "OPS.h"
@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len)
x->conval->intval = -1;
x->conval->intval2 = len;
x->conval->ext = OPT_NewExt();
__COPY(str, *x->conval->ext, ((LONGINT)(256)));
__COPY(str, *x->conval->ext, 256);
_o_result = x;
return _o_result;
}
@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
} else if ((__IN(f, 0x70) && y->typ->form == 9)) {
if ((*x)->class == 7) {
k = (*x)->conval->intval;
if (k < 0 || k > (int)OPM_MaxSet) {
if (k < 0 || k > OPM_MaxSet) {
OPB_err(202);
} else if (y->class == 7) {
(*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval));
@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
case 22:
if (f == 3) {
if (z->class == 7) {
z->conval->intval = (int)__CAP((CHAR)z->conval->intval);
z->conval->intval = __CAP((CHAR)z->conval->intval);
z->obj = NIL;
} else {
z = NewOp__29(op, typ, z);
@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
z->typ = OPT_booltyp;
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37);
OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37);
OPM_LogWNum(*ConstOp__13_s->f, 0);
OPM_LogWLn();
break;
}
@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
case 4:
if (__IN(f, 0x70)) {
if (yval->intval != 0) {
xval->intval = __MOD(xval->intval, yval->intval);
xval->intval = (int)__MOD(xval->intval, yval->intval);
OPB_SetIntType(x);
} else {
OPB_err(205);
@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
OPB_err(203);
r = (LONGREAL)1;
}
(*x)->conval->intval = (int)__ENTIER(r);
(*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r);
OPB_SetIntType(*x);
}
}
(*x)->obj = NIL;
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) {
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) {
if ((*x)->left->typ == typ) {
*x = (*x)->left;
}
@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) {
(*x)->typ = OPT_chartyp;
(*x)->conval->intval = 0;
OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*y, OPB_NewIntConst(0));
} else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) {
(*y)->typ = OPT_chartyp;
(*y)->conval->intval = 0;
OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*x, OPB_NewIntConst(0));
}
}
_o_result = ok;
@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
typ = OPT_booltyp;
} else {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13);
OPM_LogWStr((CHAR*)"ELSE in Op()", 13);
OPM_LogWLn();
OPB_err(108);
typ = OPT_undftyp;
@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
NewOp__39(op, typ, &z, y);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
} else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) {
if ((*x)->class == 7) {
k = (*x)->conval->intval;
if (0 > k || k > (int)OPM_MaxSet) {
if (0 > k || k > OPM_MaxSet) {
OPB_err(202);
}
}
if (y->class == 7) {
l = y->conval->intval;
if (0 > l || l > (int)OPM_MaxSet) {
if (0 > l || l > OPM_MaxSet) {
OPB_err(202);
}
}
@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x)
OPB_err(93);
} else if ((*x)->class == 7) {
k = (*x)->conval->intval;
if ((0 <= k && k <= (int)OPM_MaxSet)) {
if ((0 <= k && k <= OPM_MaxSet)) {
(*x)->conval->setval = __SETOF(k);
} else {
OPB_err(202);
@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
OPT_Struct p = NIL, q = NIL;
if (OPM_Verbose) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22);
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
OPM_LogWLn();
}
y = ynode->typ;
f = x->form;
g = y->form;
if (OPM_Verbose) {
OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10);
OPM_LogWNum(y->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"y.form = ", 10);
OPM_LogWNum(y->form, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"f = ", (LONGINT)5);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"f = ", 5);
OPM_LogWNum(f, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"g = ", (LONGINT)5);
OPM_LogWNum(g, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"g = ", 5);
OPM_LogWNum(g, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18);
OPM_LogWNum(ynode->typ->size, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18);
OPM_LogWNum(ynode->typ->size, 0);
OPM_LogWLn();
}
if (ynode->class == 8 || (ynode->class == 9 && f != 14)) {
@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40);
OPM_LogWNum(f, 0);
OPM_LogWLn();
break;
}
@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
x = OPB_NewBoolConst(0);
break;
case 3:
x = OPB_NewIntConst(((LONGINT)(0)));
x = OPB_NewIntConst(0);
x->typ = OPT_chartyp;
break;
case 4: case 5: case 6:
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
break;
case 9:
x = OPB_NewIntConst(((LONGINT)(0)));
x = OPB_NewIntConst(0);
x->typ = OPT_inttyp;
break;
case 7:
@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
x = OPB_NewBoolConst(1);
break;
case 3:
x = OPB_NewIntConst(((LONGINT)(255)));
x = OPB_NewIntConst(255);
x->typ = OPT_chartyp;
break;
case 4: case 5: case 6:
@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
if (x->class == 8 || x->class == 9) {
OPB_err(126);
} else if (__IN(f, 0x70)) {
if (x->typ->size != (int)OPM_LIntSize) {
if (x->typ->size != OPM_LIntSize) {
OPB_Convert(&x, OPT_linttyp);
}
} else {
@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
case 12:
if (x->class != 8) {
OPB_err(110);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
} else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) {
(*OPB_typSize)(x->typ);
x->typ->pvused = 1;
x = OPB_NewIntConst(x->typ->size);
} else {
OPB_err(111);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
}
break;
case 21:
@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
OPB_err(126);
} else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) {
} else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) {
OPB_err(111);
x->typ = OPT_linttyp;
}
@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39);
OPM_LogWNum(fctno, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39);
OPM_LogWNum(fctno, 0);
OPM_LogWLn();
break;
}
@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
if (x->class == 8 || x->class == 9) {
OPB_err(126);
} else if (__IN(f, 0x70)) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) {
OPB_err(202);
}
p = NewOp__53(19, fctno, p, x);
@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
if (!__IN(f, 0x70) || x->class != 7) {
OPB_err(69);
} else if (x->typ->size == 1) {
L = (int)x->conval->intval;
L = x->conval->intval;
typ = p->typ;
while ((L > 0 && __IN(typ->comp, 0x0c))) {
typ = typ->BaseTyp;
@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
OPB_err(126);
} else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) {
} else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) {
OPB_err(111);
x->typ = OPT_linttyp;
}
@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno)
}
} else {
if (((fctno == 13 || fctno == 14) && parno == 1)) {
OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1))));
OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1));
p->subcl = fctno;
p->right->typ = p->left->typ;
} else if ((fctno == 17 && parno == 1)) {
@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno)
} else if (fctno == 32) {
if (parno == 1) {
x = NIL;
OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0))));
OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0));
x->conval = OPT_NewConst();
x->conval->intval = OPM_errpos;
OPB_Construct(15, &p, x);
@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y)
} else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) {
y->typ = OPT_chartyp;
y->conval->intval = 0;
OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*x, OPB_NewIntConst(0));
}
if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) {
subcl = 18;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h
#define OPB__h

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h
#define OPC__h
@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement);
import void OPC_Indent (INTEGER count);
import void OPC_Init (void);
import void OPC_InitTDesc (OPT_Struct typ);
import void OPC_IntLiteral (LONGINT n, LONGINT size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim);
import LONGINT OPC_NofPtrs (OPT_Struct typ);
import void OPC_SetInclude (BOOLEAN exclude);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"
@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
case 'B':
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_IntSize = (int)s[__X(i, s__len)] - 48;
OPM_IntSize = s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_PointerSize = (int)s[__X(i, s__len)] - 48;
OPM_PointerSize = s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_Alignment = (int)s[__X(i, s__len)] - 48;
OPM_Alignment = s[__X(i, s__len)] - 48;
}
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
Files_SetSearchPath((CHAR*)"", (LONGINT)1);
Files_SetSearchPath((CHAR*)"", 1);
break;
case 'F':
*opt = *opt ^ 0x020000;
@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
*opt = *opt ^ 0x040000;
break;
default:
OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19);
OPM_LogWStr((CHAR*)" warning: option ", 19);
OPM_LogW('-');
OPM_LogW(s[__X(i, s__len)]);
OPM_LogWStr((CHAR*)" ignored", (LONGINT)9);
OPM_LogWStr((CHAR*)" ignored", 9);
OPM_LogWLn();
break;
}
@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void)
CHAR s[256];
if (Platform_ArgCount == 1) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27);
OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41)));
OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27);
OPM_LogWStr(Configuration_versionLong, 41);
OPM_LogW('.');
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84);
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7);
OPM_LogWStr((CHAR*)"Usage:", 7);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr((CHAR*)"voc", (LONGINT)4);
OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr((CHAR*)"voc", 4);
OPM_LogWStr((CHAR*)" options {files {options}}.", 28);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33);
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36);
OPM_LogWStr((CHAR*)" m - generate code for main module", 36);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63);
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31);
OPM_LogWStr((CHAR*)" s - generate new symbol file", 31);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43);
OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25);
OPM_LogWStr((CHAR*)" r - check value ranges", 25);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35);
OPM_LogWStr((CHAR*)" x - turn off array indices check", 35);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80);
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48);
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101);
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67);
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24);
OPM_LogWStr((CHAR*)" c - don't call linker", 24);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29);
OPM_LogWStr((CHAR*)" f - don't use color output", 29);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57);
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21);
OPM_LogWStr((CHAR*)" V - verbose output", 21);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48);
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56);
OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39);
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39);
OPM_LogWLn();
_o_result = 0;
return _o_result;
} else {
OPM_S = 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
OPM_glbopt = 0xe9;
while (s[0] == '-') {
OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt);
OPM_ScanOptions((void*)s, 256, &OPM_glbopt);
OPM_S += 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
}
_o_result = 1;
return _o_result;
@ -276,12 +276,12 @@ void OPM_InitOptions (void)
CHAR s[256];
OPM_opt = OPM_glbopt;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
while (s[0] == '-') {
OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt);
OPM_ScanOptions((void*)s, 256, &OPM_opt);
OPM_S += 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
}
OPM_dontAsm = __IN(13, OPM_opt);
OPM_dontLink = __IN(14, OPM_opt);
@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len)
return;
}
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
__NEW(T, Texts_TextDesc);
Texts_Open(T, s, ((LONGINT)(256)));
OPM_LogWStr(s, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
Texts_Open(T, s, 256);
OPM_LogWStr(s, 256);
OPM_LogWStr((CHAR*)" ", 3);
__COPY(s, mname, mname__len);
__COPY(s, OPM_SourceFileName, ((LONGINT)(256)));
__COPY(s, OPM_SourceFileName, 256);
if (T->len == 0) {
OPM_LogWStr(s, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" not found.", (LONGINT)12);
OPM_LogWStr(s, 256);
OPM_LogWStr((CHAR*)" not found.", 12);
OPM_LogWLn();
} else {
Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0)));
Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0);
*done = 1;
}
OPM_S += 1;
@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n)
CHAR buf[1024];
if (n >= 0) {
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"31m", (LONGINT)4);
vt100_SetAttr((CHAR*)"31m", 4);
}
OPM_LogWStr((CHAR*)" err ", (LONGINT)7);
OPM_LogWStr((CHAR*)" err ", 7);
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
} else {
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"35m", (LONGINT)4);
vt100_SetAttr((CHAR*)"35m", 4);
}
OPM_LogWStr((CHAR*)" warning ", (LONGINT)11);
OPM_LogWStr((CHAR*)" warning ", 11);
n = -n;
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
}
OPM_LogWNum(n, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128)));
OPM_LogWNum(n, 1);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
}
static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos)
@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos)
CHAR line[1023];
INTEGER i;
CHAR ch;
f = Files_Old(OPM_SourceFileName, ((LONGINT)(256)));
f = Files_Old(OPM_SourceFileName, 256);
OPM_FindLine(f, &r, Files_Rider__typ, pos);
i = 0;
Files_Read(&r, Files_Rider__typ, (void*)&ch);
while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) {
line[__X(i, ((LONGINT)(1023)))] = ch;
line[__X(i, 1023)] = ch;
i += 1;
Files_Read(&r, Files_Rider__typ, (void*)&ch);
}
line[__X(i, ((LONGINT)(1023)))] = 0x00;
line[__X(i, 1023)] = 0x00;
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)": ", (LONGINT)3);
OPM_LogWStr(line, ((LONGINT)(1023)));
OPM_LogWNum(OPM_ErrorLineNumber, 4);
OPM_LogWStr((CHAR*)": ", 3);
OPM_LogWStr(line, 1023);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)7);
OPM_LogWStr((CHAR*)" ", 7);
if (pos >= OPM_ErrorLineLimitPos) {
pos = OPM_ErrorLineLimitPos - 1;
}
i = (int)(pos - OPM_ErrorLineStartPos);
i = (pos - OPM_ErrorLineStartPos);
while (i > 0) {
OPM_LogW(' ');
i -= 1;
}
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"32m", (LONGINT)4);
vt100_SetAttr((CHAR*)"32m", 4);
}
OPM_LogW('^');
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
Files_Close(f);
}
@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos)
OPM_lasterrpos = pos;
OPM_ShowLine(pos);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr((CHAR*)" ", 3);
if (n < 249) {
OPM_LogWStr((CHAR*)" pos", (LONGINT)6);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pos", 6);
OPM_LogWNum(pos, 6);
OPM_LogErrMsg(n);
} else if (n == 255) {
OPM_LogWStr((CHAR*)"pos", (LONGINT)4);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pc ", (LONGINT)6);
OPM_LogWNum(OPM_breakpc, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)"pos", 4);
OPM_LogWNum(pos, 6);
OPM_LogWStr((CHAR*)" pc ", 6);
OPM_LogWNum(OPM_breakpc, 1);
} else if (n == 254) {
OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13);
OPM_LogWStr((CHAR*)"pc not found", 13);
} else {
OPM_LogWStr(OPM_objname, ((LONGINT)(64)));
OPM_LogWStr(OPM_objname, 64);
if (n == 253) {
OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31);
OPM_LogWStr((CHAR*)" is new, compile with option e", 31);
} else if (n == 252) {
OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37);
OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37);
} else if (n == 251) {
OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57);
OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57);
} else if (n == 250) {
OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45);
OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45);
} else if (n == 249) {
OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49);
OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49);
}
}
}
@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos)
if (pos >= 0) {
OPM_ShowLine(pos);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" pos", (LONGINT)6);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pos", 6);
OPM_LogWNum(pos, 6);
}
OPM_LogErrMsg(n);
if (pos < 0) {
@ -532,27 +532,27 @@ void OPM_err (INTEGER n)
void OPM_FPrint (LONGINT *fp, LONGINT val)
{
*fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT);
*fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT);
}
void OPM_FPrintSet (LONGINT *fp, SET set)
{
OPM_FPrint(&*fp, (LONGINT)set);
OPM_FPrint(&*fp, __VAL(LONGINT, set));
}
void OPM_FPrintReal (LONGINT *fp, REAL real)
{
INTEGER i;
LONGINT l;
__GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT);
__GET((SYSTEM_ADRINT)&real, l, LONGINT);
OPM_FPrint(&*fp, l);
}
void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr)
{
LONGINT l, h;
__GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT);
__GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT);
__GET((SYSTEM_ADRINT)&lr, l, LONGINT);
__GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT);
OPM_FPrint(&*fp, l);
OPM_FPrint(&*fp, h);
}
@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG
if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) {
Texts_Scan(&*S, S__typ);
if ((*S).class == 3) {
*size = (int)(*S).i;
*size = (*S).i;
Texts_Scan(&*S, S__typ);
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
if ((*S).class == 3) {
*align = (int)(*S).i;
*align = (*S).i;
Texts_Scan(&*S, S__typ);
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
__DEL(name);
}
@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j)
static void OPM_VerboseListSizes (void)
{
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29);
OPM_LogWStr((CHAR*)"Type Size Alignement", 29);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14);
OPM_LogWNum(OPM_CharSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"CHAR ", 14);
OPM_LogWNum(OPM_CharSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14);
OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"BOOLEAN ", 14);
OPM_LogWNum(OPM_BoolSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14);
OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"SHORTINT ", 14);
OPM_LogWNum(OPM_SIntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14);
OPM_LogWNum(OPM_IntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"INTEGER ", 14);
OPM_LogWNum(OPM_IntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14);
OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"LONGINT ", 14);
OPM_LogWNum(OPM_LIntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", (LONGINT)14);
OPM_LogWNum(OPM_SetSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"SET ", 14);
OPM_LogWNum(OPM_SetSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14);
OPM_LogWNum(OPM_RealSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"REAL ", 14);
OPM_LogWNum(OPM_RealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14);
OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"LONGREAL ", 14);
OPM_LogWNum(OPM_LRealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14);
OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"PTR ", 14);
OPM_LogWNum(OPM_PointerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14);
OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"PROC ", 14);
OPM_LogWNum(OPM_ProcSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14);
OPM_LogWNum(OPM_RecSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"RECORD ", 14);
OPM_LogWNum(OPM_RecSize, 4);
OPM_LogWLn();
OPM_LogWLn();
}
@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done)
{
CHAR ch;
OPM_FileName fileName;
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32)));
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5);
OPM_oldSFile = Files_Old(fileName, 32);
*done = OPM_oldSFile != NIL;
if (*done) {
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0)));
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch);
if (ch != 0xf7) {
OPM_err(-306);
@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i)
void OPM_SymWSet (SET s)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s);
Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s));
}
void OPM_SymWReal (REAL r)
@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void)
void OPM_NewSym (CHAR *modName, LONGINT modName__len)
{
OPM_FileName fileName;
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
OPM_newSFile = Files_New(fileName, ((LONGINT)(32)));
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5);
OPM_newSFile = Files_New(fileName, 32);
if (OPM_newSFile != NIL) {
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0)));
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
} else {
OPM_err(153);
@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len)
void OPM_Write (CHAR ch)
{
Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch);
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch);
}
void OPM_WriteString (CHAR *s, LONGINT s__len)
@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len)
while (s[__X(i, s__len)] != 0x00) {
i += 1;
}
Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i);
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
while (s[__X(i, s__len)] != 0x00) {
i += 1;
}
Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i);
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteHex (LONGINT i)
{
CHAR s[3];
INTEGER digit;
digit = __ASHR((int)i, 4);
digit = __ASHR(i, 4);
if (digit < 10) {
s[0] = (CHAR)(48 + digit);
} else {
s[0] = (CHAR)(87 + digit);
}
digit = __MASK((int)i, -16);
digit = __MASK(i, -16);
if (digit < 10) {
s[1] = (CHAR)(48 + digit);
} else {
s[1] = (CHAR)(87 + digit);
}
s[2] = 0x00;
OPM_WriteString(s, ((LONGINT)(3)));
OPM_WriteString(s, 3);
}
void OPM_WriteInt (LONGINT i)
@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i)
if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) {
OPM_Write('(');
OPM_WriteInt(i + 1);
OPM_WriteString((CHAR*)"-1)", (LONGINT)4);
OPM_WriteString((CHAR*)"-1)", 4);
} else {
i1 = __ABS(i);
s[0] = (CHAR)(__MOD(i1, 10) + 48);
s[0] = (CHAR)((int)__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k = 1;
while (i1 > 0) {
s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48);
s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k += 1;
}
if (i < 0) {
s[__X(k, ((LONGINT)(20)))] = '-';
s[__X(k, 20)] = '-';
k += 1;
}
while (k > 0) {
k -= 1;
OPM_Write(s[__X(k, ((LONGINT)(20)))]);
OPM_Write(s[__X(k, 20)]);
}
}
}
@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
CHAR s[32];
CHAR ch;
INTEGER i;
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) {
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) {
if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7);
OPM_WriteString((CHAR*)"(REAL)", 7);
} else {
OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11);
OPM_WriteString((CHAR*)"(LONGREAL)", 11);
}
OPM_WriteInt((int)__ENTIER(r));
OPM_WriteInt((SYSTEM_INT32)__ENTIER(r));
} else {
Texts_OpenWriter(&W, Texts_Writer__typ);
if (suffx == 'f') {
@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23);
}
__NEW(T, Texts_TextDesc);
Texts_Open(T, (CHAR*)"", (LONGINT)1);
Texts_Open(T, (CHAR*)"", 1);
Texts_Append(T, W.buf);
Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0)));
Texts_OpenReader(&R, Texts_Reader__typ, T, 0);
i = 0;
Texts_Read(&R, Texts_Reader__typ, &ch);
while (ch != 0x00) {
s[__X(i, ((LONGINT)(32)))] = ch;
s[__X(i, 32)] = ch;
i += 1;
Texts_Read(&R, Texts_Reader__typ, &ch);
}
s[__X(i, ((LONGINT)(32)))] = 0x00;
s[__X(i, 32)] = 0x00;
i = 0;
ch = s[0];
while ((ch != 'D' && ch != 0x00)) {
i += 1;
ch = s[__X(i, ((LONGINT)(32)))];
ch = s[__X(i, 32)];
}
if (ch == 'D') {
s[__X(i, ((LONGINT)(32)))] = 'e';
s[__X(i, 32)] = 'e';
}
OPM_WriteString(s, ((LONGINT)(32)));
OPM_WriteString(s, 32);
}
}
void OPM_WriteLn (void)
{
Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a);
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a);
}
static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
Files_Rider R1;
CHAR buffer[4096];
if (F != NIL) {
Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0)));
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096)));
Files_Set(&R1, Files_Rider__typ, F, 0);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096);
while (4096 - R1.res > 0) {
Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096)));
Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096);
}
}
}
@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len)
{
CHAR FName[32];
__COPY(moduleName, OPM_modName, ((LONGINT)(32)));
OPM_HFile = Files_New((CHAR*)"", (LONGINT)1);
__COPY(moduleName, OPM_modName, 32);
OPM_HFile = Files_New((CHAR*)"", 1);
if (OPM_HFile != NIL) {
Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0)));
Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0);
} else {
OPM_err(153);
}
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3);
OPM_BFile = Files_New(FName, ((LONGINT)(32)));
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3);
OPM_BFile = Files_New(FName, 32);
if (OPM_BFile != NIL) {
Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0)));
Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0);
} else {
OPM_err(153);
}
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3);
OPM_HIFile = Files_New(FName, ((LONGINT)(32)));
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3);
OPM_HIFile = Files_New(FName, 32);
if (OPM_HIFile != NIL) {
Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0)));
Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0);
} else {
OPM_err(153);
}
@ -961,9 +961,9 @@ void OPM_CloseFiles (void)
CHAR FName[32];
INTEGER res;
if (OPM_noerr) {
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0)));
OPM_LogWStr((CHAR*)" chars.", (LONGINT)8);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0);
OPM_LogWStr((CHAR*)" chars.", 8);
}
if (OPM_noerr) {
if (__STRCMP(OPM_modName, "SYSTEM") == 0) {
@ -975,10 +975,10 @@ void OPM_CloseFiles (void)
Files_Register(OPM_HIFile);
Files_Register(OPM_BFile);
} else {
OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3);
Files_Delete(FName, ((LONGINT)(32)), &res);
OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
Files_Delete(FName, ((LONGINT)(32)), &res);
OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3);
Files_Delete(FName, 32, &res);
OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5);
Files_Delete(FName, 32, &res);
Files_Register(OPM_BFile);
}
}
@ -987,11 +987,11 @@ void OPM_CloseFiles (void)
OPM_HIFile = NIL;
OPM_newSFile = NIL;
OPM_oldSFile = NIL;
Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0);
Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0);
}
static void EnumPtrs(void (*P)(void*))
@ -1032,15 +1032,15 @@ export void *OPM__init(void)
/* BEGIN */
Texts_OpenWriter(&OPM_W, Texts_Writer__typ);
OPM_MODULES[0] = 0x00;
Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024);
__MOVE(".", OPM_OBERON, 2);
Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024)));
Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024);
Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024);
OPM_CharSize = 1;
OPM_BoolSize = 1;
OPM_SIntSize = 1;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h
#define OPM__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPB.h"
#include "OPM.h"
@ -58,7 +58,7 @@ static void OPP_err (INTEGER n)
static void OPP_CheckSym (INTEGER s)
{
if ((int)OPP_sym == s) {
if (OPP_sym == s) {
OPS_Get(&OPP_sym);
} else {
OPM_err(s);
@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x)
OPP_Expression(&*x);
if ((*x)->class != 7) {
OPP_err(50);
*x = OPB_NewIntConst(((LONGINT)(1)));
*x = OPB_NewIntConst(1);
}
}
@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
OPP_err(51);
sf = 0;
}
*sysflag = (int)sf;
*sysflag = sf;
OPP_CheckSym(23);
} else {
*sysflag = default_;
@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ)
OPT_Find(&id);
if (id == NIL) {
if (OPP_nofFwdPtr < 64) {
OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ;
OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ;
OPP_nofFwdPtr += 1;
} else {
OPP_err(224);
}
(*typ)->link = OPT_NewObj();
__COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256)));
__COPY(OPS_name, (*typ)->link->name, 256);
(*typ)->BaseTyp = OPT_undftyp;
OPS_Get(&OPP_sym);
} else {
@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x)
} else if (OPP_sym == 18) {
OPS_Get(&OPP_sym);
if (OPP_sym == 38) {
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPS_Get(&OPP_sym);
if ((*x)->typ != NIL) {
if ((*x)->typ->form == 13) {
@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x)
OPT_Node y = NIL;
SHORTINT m;
INTEGER n;
m = (int)(*x)->obj->adr;
m = (*x)->obj->adr;
n = 0;
if (OPP_sym == 30) {
OPS_Get(&OPP_sym);
@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x)
*x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44);
OPM_LogWNum(OPS_numtyp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44);
OPM_LogWNum(OPS_numtyp, 0);
OPM_LogWLn();
break;
}
@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x)
*x = NIL;
}
if (*x == NIL) {
*x = OPB_NewIntConst(((LONGINT)(1)));
*x = OPB_NewIntConst(1);
(*x)->typ = OPT_undftyp;
}
}
@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St
} else {
*mode = 1;
}
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPP_CheckSym(38);
OPP_CheckSym(20);
if (OPP_sym == 38) {
@ -932,8 +932,8 @@ static void GetCode__19 (void)
(*ProcedureDeclaration__16_s->proc)->conval->ext = ext;
n = 0;
if (OPP_sym == 37) {
while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) {
(*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))];
while (OPS_str[__X(n, 256)] != 0x00) {
(*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)];
n += 1;
}
(*ext)[0] = (CHAR)n;
@ -949,7 +949,7 @@ static void GetCode__19 (void)
n = 1;
}
OPS_Get(&OPP_sym);
(*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c;
(*ext)[__X(n, 256)] = (CHAR)c;
}
if (OPP_sym == 19) {
OPS_Get(&OPP_sym);
@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void)
}
OPP_Receiver(&objMode, objName, &objTyp, &recTyp);
if (OPP_sym == 38) {
__COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256)));
__COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256);
OPP_CheckMark(&*ProcedureDeclaration__16_s->vis);
OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd);
OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc);
@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
TProcDecl__23();
} else if (OPP_sym == 38) {
OPT_Find(&fwd);
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPP_CheckMark(&vis);
if ((vis != 0 && mode == 6)) {
mode = 7;
@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) {
OPP_err(60);
}
} else if ((int)LabelTyp->form != f) {
} else if (LabelTyp->form != f) {
OPP_err(60);
}
if (OPP_sym == 21) {
OPS_Get(&OPP_sym);
OPP_ConstExpression(&y);
yval = y->conval->intval;
if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) {
if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) {
OPP_err(60);
}
if (yval < xval) {
@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
if (i == 0) {
break;
}
if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) {
if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) {
if (tab[__X(i - 1, 128)].low <= yval) {
if (tab[__X(i - 1, 128)].high >= xval) {
OPP_err(62);
}
break;
}
tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))];
tab[__X(i, 128)] = tab[__X(i - 1, 128)];
i -= 1;
}
tab[__X(i, ((LONGINT)(128)))].low = xval;
tab[__X(i, ((LONGINT)(128)))].high = yval;
tab[__X(i, 128)].low = xval;
tab[__X(i, 128)].high = yval;
*n += 1;
} else {
OPP_err(213);
@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x)
}
if (n > 0) {
low = tab[0].low;
high = tab[__X(n - 1, ((LONGINT)(128)))].high;
high = tab[__X(n - 1, 128)].high;
if (high - low > 512) {
OPP_err(209);
}
@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat)
OPS_Get(&OPP_sym);
OPP_ConstExpression(&z);
} else {
z = OPB_NewIntConst(((LONGINT)(1)));
z = OPB_NewIntConst(1);
}
pos = OPM_errpos;
x = OPB_NewLeaf(id);
@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPP_ConstExpression(&x);
} else {
OPP_err(9);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
}
obj->mode = 3;
obj->typ = x->typ;
@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
if (__IN(obj->typ->comp, 0x1c)) {
i = 0;
while (i < OPP_nofFwdPtr) {
typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))];
typ = OPP_FwdPtr[__X(i, 64)];
i += 1;
if (__STRCMP(typ->link->name, obj->name) == 0) {
typ->BaseTyp = obj->typ;
@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
}
i = 0;
while (i < OPP_nofFwdPtr) {
if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) {
if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) {
OPP_err(128);
}
OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL;
OPP_FwdPtr[__X(i, 64)] = NIL;
i += 1;
}
OPT_topScope->adr = OPM_errpos;
@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt)
OPS_Get(&OPP_sym);
} else {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46);
OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15);
OPM_LogWNum(OPP_sym, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" sym: ", 15);
OPM_LogWNum(OPP_sym, 1);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15);
OPM_LogWStr(OPS_name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" OPS.name: ", 15);
OPM_LogWStr(OPS_name, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15);
OPM_LogWStr(OPS_str, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" OPS.str: ", 15);
OPM_LogWStr(OPS_str, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15);
OPM_LogWNum(OPS_numtyp, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15);
OPM_LogWNum(OPS_numtyp, 1);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15);
OPM_LogWNum(OPS_intval, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" OPS.intval: ", 15);
OPM_LogWNum(OPS_intval, 1);
OPM_LogWLn();
OPP_err(16);
}
if (OPP_sym == 38) {
OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11);
OPM_LogWStr(OPS_name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)"compiling ", 11);
OPM_LogWStr(OPS_name, 256);
OPM_LogW('.');
OPT_Init(OPS_name, opt);
OPS_Get(&OPP_sym);
@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt)
OPS_Get(&OPP_sym);
for (;;) {
if (OPP_sym == 38) {
__COPY(OPS_name, aliasName, ((LONGINT)(256)));
__COPY(aliasName, impName, ((LONGINT)(256)));
__COPY(OPS_name, aliasName, 256);
__COPY(aliasName, impName, 256);
OPS_Get(&OPP_sym);
if (OPP_sym == 34) {
OPS_Get(&OPP_sym);
if (OPP_sym == 38) {
__COPY(OPS_name, impName, ((LONGINT)(256)));
__COPY(OPS_name, impName, 256);
OPS_Get(&OPP_sym);
} else {
OPP_err(38);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"
@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym)
if (OPS_intval == 2) {
*sym = 35;
OPS_numtyp = 1;
OPS_intval = (int)OPS_str[0];
OPS_intval = OPS_str[0];
} else {
*sym = 37;
}
@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex)
{
INTEGER _o_result;
if (ch <= '9') {
_o_result = (int)ch - 48;
_o_result = ch - 48;
return _o_result;
} else if (hex) {
_o_result = ((int)ch - 65) + 10;
_o_result = (ch - 65) + 10;
return _o_result;
} else {
OPS_err(2);
@ -173,7 +173,7 @@ static void OPS_Number (void)
OPS_numtyp = 1;
if (n <= 2) {
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -188,7 +188,7 @@ static void OPS_Number (void)
OPS_intval = -1;
}
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -199,8 +199,8 @@ static void OPS_Number (void)
while (i < n) {
d = Ord__7(dig[i], 0);
i += 1;
if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) {
OPS_intval = OPS_intval * 10 + (int)d;
if (OPS_intval <= __DIV(2147483647 - d, 10)) {
OPS_intval = OPS_intval * 10 + d;
} else {
OPS_err(203);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"
#include "OPS.h"
@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size)
OPT_Struct _o_result;
INTEGER i;
i = 1;
while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) {
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
i += 1;
}
_o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))];
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
}
@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
__ASSERT(dir == 1 || dir == -1, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
i = 0;
while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) {
while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) {
i += 1;
}
__ASSERT(i < 19, 0);
_o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))];
_o_result = OPT_IntTypes[__X(i + dir, 20)];
return _o_result;
}
@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void)
{
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256);
ext = __NEWARR(NIL, 1, 1, 1, 0, 256);
_o_result = ext;
return _o_result;
}
@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt)
OPT_topScope = OPT_universe;
OPT_OpenScope(0, NIL);
OPT_SYSimported = 0;
__COPY(name, OPT_SelfName, ((LONGINT)(256)));
__COPY(name, OPT_topScope->name, ((LONGINT)(256)));
__COPY(name, OPT_SelfName, 256);
__COPY(name, OPT_topScope->name, 256);
OPT_GlbMod[0] = OPT_topScope;
OPT_nofGmod = 1;
OPT_newsf = __IN(4, opt);
@ -281,13 +281,13 @@ void OPT_Close (void)
OPT_CloseScope();
i = 0;
while (i < 64) {
OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL;
OPT_GlbMod[__X(i, 64)] = NIL;
i += 1;
}
i = 16;
while (i < 255) {
OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL;
OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL;
OPT_impCtxt.ref[__X(i, 255)] = NIL;
OPT_impCtxt.old[__X(i, 255)] = NIL;
i += 1;
}
}
@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
}
ob1->left = NIL;
ob1->right = NIL;
__COPY(name, ob1->name, ((LONGINT)(256)));
__COPY(name, ob1->name, 256);
mnolev = OPT_topScope->mnolev;
ob1->mnolev = mnolev;
break;
@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len)
i = 0;
do {
ch = name[__X(i, name__len)];
OPM_FPrint(&*fp, (int)ch);
OPM_FPrint(&*fp, ch);
i += 1;
} while (!(ch == 0x00));
}
@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp)
{
OPM_LogWLn();
if (btyp == NIL) {
OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12);
OPM_LogWStr((CHAR*)"btyp is nil", 12);
OPM_LogWLn();
}
OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23);
OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23);
OPM_LogWStr(btyp->strobj->name, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14);
OPM_LogWNum(btyp->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.form = ", 14);
OPM_LogWNum(btyp->form, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14);
OPM_LogWNum(btyp->comp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.comp = ", 14);
OPM_LogWNum(btyp->comp, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13);
OPM_LogWNum(btyp->mno, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.mno = ", 13);
OPM_LogWNum(btyp->mno, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16);
OPM_LogWNum(btyp->extlev, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16);
OPM_LogWNum(btyp->extlev, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14);
OPM_LogWNum(btyp->size, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.size = ", 14);
OPM_LogWNum(btyp->size, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15);
OPM_LogWNum(btyp->align, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.align = ", 15);
OPM_LogWNum(btyp->align, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16);
OPM_LogWNum(btyp->txtpos, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16);
OPM_LogWNum(btyp->txtpos, 0);
OPM_LogWLn();
}
@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ)
btyp = typ->BaseTyp;
strobj = typ->strobj;
if ((strobj != NIL && strobj->name[0] != 0x00)) {
OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256)));
OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256)));
OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256);
OPT_FPrintName(&idfp, (void*)strobj->name, 256);
}
if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) {
OPT_IdFPrint(btyp);
@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr)
}
}
} else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) {
OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13)));
OPM_FPrint(&*FPrintStr__12_s->pvfp, 13);
OPM_FPrint(&*FPrintStr__12_s->pvfp, adr);
OPT_nofhdfld += 1;
}
@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible)
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis);
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256)));
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256);
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr);
OPT_FPrintStr(fld->typ);
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp);
@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj)
FPrintTProcs__17(obj->left);
if (obj->mode == 13) {
if (obj->vis != 0) {
OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13)));
OPM_FPrint(&*FPrintStr__12_s->pbfp, 13);
OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16));
OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link);
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256)));
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256);
}
}
FPrintTProcs__17(obj->right);
@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ)
OPM_FPrint(&pvfp, typ->align);
OPM_FPrint(&pvfp, typ->n);
OPT_nofhdfld = 0;
FPrintFlds__13(typ->link, ((LONGINT)(0)), 1);
FPrintFlds__13(typ->link, 0, 1);
if (OPT_nofhdfld > 2048) {
OPM_Mark(225, typ->txtpos);
}
@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj)
OPM_FPrintLReal(&fprint, obj->conval->realval);
break;
case 10:
OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256)));
OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256);
break;
case 11:
break;
@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj)
} else if (obj->mode == 9) {
OPT_FPrintSign(&fprint, obj->typ, obj->link);
ext = obj->conval->ext;
m = (int)(*ext)[0];
m = (*ext)[0];
f = 1;
OPM_FPrint(&fprint, m);
while (f <= m) {
OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]);
OPM_FPrint(&fprint, (*ext)[__X(f, 256)]);
f += 1;
}
} else if (obj->mode == 5) {
@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode)
INTEGER i, j;
CHAR ch;
if (obj->mnolev != 0) {
__COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64)));
__COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64);
i = 0;
while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) {
while (OPM_objname[__X(i, 64)] != 0x00) {
i += 1;
}
OPM_objname[__X(i, ((LONGINT)(64)))] = '.';
OPM_objname[__X(i, 64)] = '.';
j = 0;
i += 1;
do {
ch = obj->name[__X(j, ((LONGINT)(256)))];
OPM_objname[__X(i, ((LONGINT)(64)))] = ch;
ch = obj->name[__X(j, 256)];
OPM_objname[__X(i, 64)] = ch;
j += 1;
i += 1;
} while (!(ch == 0x00));
} else {
__COPY(obj->name, OPM_objname, ((LONGINT)(64)));
__COPY(obj->name, OPM_objname, 64);
}
if (errcode == 249) {
if (OPM_noerr) {
@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno)
*mno = OPT_impCtxt.glbmno[0];
} else {
if (mn == 16) {
OPT_InName((void*)name, ((LONGINT)(256)));
OPT_InName((void*)name, 256);
if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) {
OPT_err(154);
}
i = 0;
while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) {
while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) {
i += 1;
}
if (i < OPT_nofGmod) {
@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno)
} else {
head = OPT_NewObj();
head->mode = 12;
__COPY(name, head->name, ((LONGINT)(256)));
__COPY(name, head->name, 256);
*mno = OPT_nofGmod;
head->mnolev = -*mno;
if (OPT_nofGmod < 64) {
OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head;
OPT_GlbMod[__X(*mno, 64)] = head;
OPT_nofGmod += 1;
} else {
OPT_err(227);
}
}
OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno;
OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno;
OPT_impCtxt.nofm += 1;
} else {
*mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))];
*mno = OPT_impCtxt.glbmno[__X(-mn, 64)];
}
}
}
@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
switch (f) {
case 1: case 3: case 2:
OPM_SymRCh(&ch);
conval->intval = (int)ch;
conval->intval = ch;
break;
case 4: case 5: case 6:
conval->intval = OPM_SymRInt();
@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
i = 0;
do {
OPM_SymRCh(&ch);
(*ext)[__X(i, ((LONGINT)(256)))] = ch;
(*ext)[__X(i, 256)] = ch;
i += 1;
} while (!(ch == 0x00));
conval->intval2 = i;
@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
conval->intval = 0;
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37);
OPM_LogWNum(f, 0);
OPM_LogWLn();
break;
}
@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par)
}
OPT_InStruct(&new->typ);
new->adr = OPM_SymRInt();
OPT_InName((void*)new->name, ((LONGINT)(256)));
OPT_InName((void*)new->name, 256);
last = new;
tag = OPM_SymRInt();
}
@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void)
obj->vis = 1;
}
OPT_InStruct(&obj->typ);
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
obj->adr = OPM_SymRInt();
} else {
obj->mode = 4;
@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
obj->conval->intval = -1;
OPT_InSign(mno, &obj->typ, &obj->link);
obj->vis = 1;
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
obj->adr = __ASHL(OPM_SymRInt(), 16);
} else {
obj->mode = 13;
@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag)
_o_result = OPT_IntType(OPM_SymRInt());
return _o_result;
} else {
_o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))];
_o_result = OPT_impCtxt.ref[__X(tag, 255)];
return _o_result;
}
__RETCHK;
@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ)
OPT_impCtxt.minr = ref;
}
OPT_InMod(&mno);
OPT_InName((void*)name, ((LONGINT)(256)));
OPT_InName((void*)name, 256);
obj = OPT_NewObj();
if (name[0] == 0x00) {
if (OPT_impCtxt.self) {
old = NIL;
} else {
__MOVE("@", obj->name, 2);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
obj->name[0] = 0x00;
}
*typ = OPT_NewStr(0, 1);
} else {
__COPY(name, obj->name, ((LONGINT)(256)));
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
__COPY(name, obj->name, 256);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
if (old != NIL) {
OPT_FPrintObj(old);
OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp;
OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp;
if (OPT_impCtxt.self) {
*typ = OPT_NewStr(0, 1);
} else {
@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ)
*typ = OPT_NewStr(0, 1);
}
}
OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ;
OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old;
OPT_impCtxt.ref[__X(ref, 255)] = *typ;
OPT_impCtxt.old[__X(ref, 255)] = old;
(*typ)->ref = ref + 255;
(*typ)->mno = mno;
(*typ)->allocated = 1;
@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ)
obj->vis = 0;
tag = OPM_SymRInt();
if (tag == 35) {
(*typ)->sysflag = (int)OPM_SymRInt();
(*typ)->sysflag = OPM_SymRInt();
tag = OPM_SymRInt();
}
switch (tag) {
@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ)
OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35);
OPM_LogWNum(tag, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35);
OPM_LogWNum(tag, 0);
OPM_LogWLn();
break;
}
@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ)
if (obj->name[0] != 0x00) {
OPT_FPrintObj(obj);
}
old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))];
old = OPT_impCtxt.old[__X(ref, 255)];
if (old != NIL) {
t->strobj = old;
if (OPT_impCtxt.self) {
@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ)
if (old->history != 5) {
if (old->fprint != obj->fprint) {
old->history = 2;
} else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
} else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 3;
}
}
} else if (old->fprint != obj->fprint) {
old->history = 2;
} else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
} else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 3;
} else if (old->vis == 0) {
old->history = 1;
@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ)
old->history = 0;
}
} else {
if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 5;
}
if (old->fprint != obj->fprint) {
@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno)
obj->mode = 9;
ext = OPT_NewExt();
obj->conval->ext = ext;
s = (int)OPM_SymRInt();
s = OPM_SymRInt();
(*ext)[0] = (CHAR)s;
i = 1;
while (i <= s) {
OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]);
OPM_SymRCh(&(*ext)[__X(i, 256)]);
i += 1;
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32);
OPM_LogWNum(tag, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
OPM_LogWNum(tag, 0);
OPM_LogWLn();
break;
}
@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno)
}
OPT_InStruct(&obj->typ);
}
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
}
OPT_FPrintObj(obj);
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
}
if (tag != 19) {
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
if (OPT_impCtxt.self) {
if (old != NIL) {
if (old->vis == 0) {
@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
OPT_impCtxt.nofm = 0;
OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0;
OPT_impCtxt.reffp = 0;
OPM_OldSym((void*)name, ((LONGINT)(256)), &*done);
OPM_OldSym((void*)name, 256, &*done);
if (*done) {
OPT_InMod(&mno);
OPT_impCtxt.nextTag = OPM_SymRInt();
@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
}
OPT_Insert(aliasName, &obj);
obj->mode = 11;
obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right;
OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj;
obj->scope = OPT_GlbMod[__X(mno, 64)]->right;
OPT_GlbMod[__X(mno, 64)]->link = obj;
obj->mnolev = -mno;
obj->typ = OPT_notyp;
OPM_CloseOldSym();
@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len)
static void OPT_OutMod (INTEGER mno)
{
if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) {
OPM_SymWInt(((LONGINT)(16)));
OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm;
if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) {
OPM_SymWInt(16);
OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm;
OPT_expCtxt.nofm += 1;
OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256)));
OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256);
} else {
OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]);
OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]);
}
}
@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr)
}
}
} else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) {
OPM_SymWInt(((LONGINT)(27)));
OPM_SymWInt(27);
OPM_SymWInt(adr);
OPT_nofhdfld += 1;
}
@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible)
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
if (fld->vis == 2) {
OPM_SymWInt(((LONGINT)(26)));
OPM_SymWInt(26);
} else {
OPM_SymWInt(((LONGINT)(25)));
OPM_SymWInt(25);
}
OPT_OutStr(fld->typ);
OPT_OutName((void*)fld->name, ((LONGINT)(256)));
OPT_OutName((void*)fld->name, 256);
OPM_SymWInt(fld->adr);
} else {
OPT_OutHdFld(fld->typ, fld, fld->adr + adr);
@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par)
OPT_OutStr(result);
while (par != NIL) {
if (par->mode == 1) {
OPM_SymWInt(((LONGINT)(23)));
OPM_SymWInt(23);
} else {
OPM_SymWInt(((LONGINT)(24)));
OPM_SymWInt(24);
}
OPT_OutStr(par->typ);
OPM_SymWInt(par->adr);
OPT_OutName((void*)par->name, ((LONGINT)(256)));
OPT_OutName((void*)par->name, 256);
par = par->link;
}
OPM_SymWInt(((LONGINT)(18)));
OPM_SymWInt(18);
}
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj)
@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj)
}
if (obj->vis != 0) {
if (obj->vis != 0) {
OPM_SymWInt(((LONGINT)(29)));
OPM_SymWInt(29);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
OPM_SymWInt(__ASHR(obj->adr, 16));
} else {
OPM_SymWInt(((LONGINT)(30)));
OPM_SymWInt(30);
OPM_SymWInt(__ASHR(obj->adr, 16));
}
}
@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWInt(typ->size);
}
} else {
OPM_SymWInt(((LONGINT)(34)));
OPM_SymWInt(34);
typ->ref = OPT_expCtxt.ref;
OPT_expCtxt.ref += 1;
if (OPT_expCtxt.ref >= 255) {
@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ)
OPT_OutMod(typ->mno);
strobj = typ->strobj;
if ((strobj != NIL && strobj->name[0] != 0x00)) {
OPT_OutName((void*)strobj->name, ((LONGINT)(256)));
OPT_OutName((void*)strobj->name, 256);
switch (strobj->history) {
case 2:
OPT_FPrintErr(strobj, 252);
@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWCh(0x00);
}
if (typ->sysflag != 0) {
OPM_SymWInt(((LONGINT)(35)));
OPM_SymWInt(35);
OPM_SymWInt(typ->sysflag);
}
switch (typ->form) {
case 13:
OPM_SymWInt(((LONGINT)(36)));
OPM_SymWInt(36);
OPT_OutStr(typ->BaseTyp);
break;
case 14:
OPM_SymWInt(((LONGINT)(40)));
OPM_SymWInt(40);
OPT_OutSign(typ->BaseTyp, typ->link);
break;
case 15:
switch (typ->comp) {
case 2:
OPM_SymWInt(((LONGINT)(37)));
OPM_SymWInt(37);
OPT_OutStr(typ->BaseTyp);
OPM_SymWInt(typ->n);
break;
case 3:
OPM_SymWInt(((LONGINT)(38)));
OPM_SymWInt(38);
OPT_OutStr(typ->BaseTyp);
break;
case 4:
OPM_SymWInt(((LONGINT)(39)));
OPM_SymWInt(39);
if (typ->BaseTyp == NIL) {
OPT_OutStr(OPT_notyp);
} else {
@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWInt(typ->align);
OPM_SymWInt(typ->n);
OPT_nofhdfld = 0;
OPT_OutFlds(typ->link, ((LONGINT)(0)), 1);
OPT_OutFlds(typ->link, 0, 1);
if (OPT_nofhdfld > 2048) {
OPM_Mark(223, typ->txtpos);
}
OPT_OutTProcs(typ, typ->link);
OPM_SymWInt(((LONGINT)(18)));
OPM_SymWInt(18);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39);
OPM_LogWNum(typ->comp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39);
OPM_LogWNum(typ->comp, 0);
OPM_LogWLn();
break;
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39);
OPM_LogWNum(typ->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39);
OPM_LogWNum(typ->form, 0);
OPM_LogWLn();
break;
}
@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj)
OPM_SymWLReal(obj->conval->realval);
break;
case 10:
OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256)));
OPT_OutName((void*)*obj->conval->ext, 256);
break;
case 11:
break;
@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj)
OPT_FPrintErr(obj, 251);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42);
OPM_LogWNum(obj->history, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42);
OPM_LogWNum(obj->history, 0);
OPM_LogWLn();
break;
}
switch (obj->mode) {
case 3:
OPT_OutConstant(obj);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 5:
if (obj->typ->strobj == obj) {
OPM_SymWInt(((LONGINT)(19)));
OPM_SymWInt(19);
OPT_OutStr(obj->typ);
} else {
OPM_SymWInt(((LONGINT)(20)));
OPM_SymWInt(20);
OPT_OutStr(obj->typ);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
}
break;
case 1:
if (obj->vis == 2) {
OPM_SymWInt(((LONGINT)(22)));
OPM_SymWInt(22);
} else {
OPM_SymWInt(((LONGINT)(21)));
OPM_SymWInt(21);
}
OPT_OutStr(obj->typ);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) {
OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref);
}
break;
case 7:
OPM_SymWInt(((LONGINT)(31)));
OPM_SymWInt(31);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 10:
OPM_SymWInt(((LONGINT)(32)));
OPM_SymWInt(32);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 9:
OPM_SymWInt(((LONGINT)(33)));
OPM_SymWInt(33);
OPT_OutSign(obj->typ, obj->link);
ext = obj->conval->ext;
j = (int)(*ext)[0];
j = (*ext)[0];
i = 1;
OPM_SymWInt(j);
while (i <= j) {
OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]);
OPM_SymWCh((*ext)[__X(i, 256)]);
i += 1;
}
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38);
OPM_LogWNum(obj->mode, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38);
OPM_LogWNum(obj->mode, 0);
OPM_LogWLn();
break;
}
@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
OPT_Import((CHAR*)"@self", OPT_SelfName, &done);
OPT_nofGmod = nofmod;
if (OPM_noerr) {
OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256)));
OPM_NewSym((void*)OPT_SelfName, 256);
if (OPM_noerr) {
OPM_SymWInt(((LONGINT)(16)));
OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256)));
OPM_SymWInt(16);
OPT_OutName((void*)OPT_SelfName, 256);
OPT_expCtxt.reffp = 0;
OPT_expCtxt.ref = 16;
OPT_expCtxt.nofm = 1;
OPT_expCtxt.locmno[0] = 0;
i = 1;
while (i < 64) {
OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1;
OPT_expCtxt.locmno[__X(i, 64)] = -1;
i += 1;
}
OPT_OutObj(OPT_topScope->right);
@ -1874,11 +1874,11 @@ export void *OPT__init(void)
OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp);
OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp);
OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0)));
OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1)));
OPT_EnterBoolConst((CHAR*)"FALSE", 0);
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
OPT_EnterProc((CHAR*)"HALT", 0);
OPT_EnterProc((CHAR*)"NEW", 1);
OPT_EnterProc((CHAR*)"ABS", 2);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h
#define OPT__h

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
typedef
@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
Platform_ArgVecPtr av = NIL;
Platform_MainStackFrame = argvadr;
Platform_ArgCount = argc;
av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr;
av = __VAL(Platform_ArgVecPtr, argvadr);
Platform_ArgVector = (*av)[0];
Platform_HaltCode = -128;
Platform_HeapInitHeap();
@ -262,8 +262,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
{
Platform_ArgVec av = NIL;
if (n < Platform_ArgCount) {
av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector;
__COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len);
av = __VAL(Platform_ArgVec, Platform_ArgVector);
__COPY(*(*av)[__X(n, 1024)], val, val__len);
}
}
@ -272,17 +272,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val)
CHAR s[64];
LONGINT k, d, i;
s[0] = 0x00;
Platform_GetArg(n, (void*)s, ((LONGINT)(64)));
Platform_GetArg(n, (void*)s, 64);
i = 0;
if (s[0] == '-') {
i = 1;
}
k = 0;
d = (int)s[__X(i, ((LONGINT)(64)))] - 48;
d = s[__X(i, 64)] - 48;
while ((d >= 0 && d <= 9)) {
k = k * 10 + d;
i += 1;
d = (int)s[__X(i, ((LONGINT)(64)))] - 48;
d = s[__X(i, 64)] - 48;
}
if (s[0] == '-') {
k = -k;
@ -300,10 +300,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len)
CHAR arg[256];
__DUP(s, s__len, CHAR);
i = 0;
Platform_GetArg(i, (void*)arg, ((LONGINT)(256)));
Platform_GetArg(i, (void*)arg, 256);
while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) {
i += 1;
Platform_GetArg(i, (void*)arg, ((LONGINT)(256)));
Platform_GetArg(i, (void*)arg, 256);
}
_o_result = i;
__DEL(s);
@ -327,7 +327,7 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler)
static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d)
{
*d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da;
*d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da;
*t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se;
}
@ -350,8 +350,8 @@ LONGINT Platform_Time (void)
LONGINT _o_result;
LONGINT ms;
Platform_gettimeval();
ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
_o_result = __MOD(ms - Platform_TimeStart, 2147483647);
ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
_o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647);
return _o_result;
}
@ -359,7 +359,7 @@ void Platform_Delay (LONGINT ms)
{
LONGINT s, ns;
s = __DIV(ms, 1000);
ns = __MOD(ms, 1000) * 1000000;
ns = (int)__MOD(ms, 1000) * 1000000;
Platform_nanosleep(s, ns);
}
@ -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 _o_result;
*n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len);
*n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len);
if (*n < 0) {
*n = 0;
_o_result = Platform_err();
@ -613,7 +613,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len)
INTEGER _o_result;
INTEGER r;
r = Platform_chdir(n, n__len);
Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256)));
Platform_getcwd((void*)Platform_CWD, 256);
if (r < 0) {
_o_result = Platform_err();
return _o_result;
@ -658,7 +658,7 @@ static void Platform_errposint (LONGINT l)
if (l > 10) {
Platform_errposint(__DIV(l, 10));
}
Platform_errch((CHAR)(48 + __MOD(l, 10)));
Platform_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
static void Platform_errint (LONGINT l)
@ -674,52 +674,52 @@ static void Platform_DisplayHaltCode (LONGINT code)
{
switch (code) {
case -1:
Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19);
Platform_errstring((CHAR*)"Assertion failure.", 19);
break;
case -2:
Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20);
Platform_errstring((CHAR*)"Index out of range.", 20);
break;
case -3:
Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49);
Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49);
break;
case -4:
Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47);
Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47);
break;
case -5:
Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19);
Platform_errstring((CHAR*)"Type guard failed.", 19);
break;
case -6:
Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49);
Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49);
break;
case -7:
Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32);
Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32);
break;
case -8:
Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20);
Platform_errstring((CHAR*)"Value out of range.", 20);
break;
case -9:
Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60);
Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60);
break;
case -10:
Platform_errstring((CHAR*)"NIL access.", (LONGINT)12);
Platform_errstring((CHAR*)"NIL access.", 12);
break;
case -11:
Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17);
Platform_errstring((CHAR*)"Alignment error.", 17);
break;
case -12:
Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16);
Platform_errstring((CHAR*)"Divide by zero.", 16);
break;
case -13:
Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31);
Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31);
break;
case -14:
Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27);
Platform_errstring((CHAR*)"Invalid function argument.", 27);
break;
case -15:
Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52);
Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52);
break;
case -20:
Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60);
Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60);
break;
default:
break;
@ -733,9 +733,9 @@ void Platform_Halt (LONGINT code)
if (Platform_HaltHandler != NIL) {
(*Platform_HaltHandler)(code);
}
Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20);
Platform_errstring((CHAR*)"Terminated by Halt(", 20);
Platform_errint(code);
Platform_errstring((CHAR*)"). ", (LONGINT)4);
Platform_errstring((CHAR*)"). ", 4);
if (code < 0) {
Platform_DisplayHaltCode(code);
}
@ -746,11 +746,11 @@ void Platform_Halt (LONGINT code)
void Platform_AssertFail (LONGINT code)
{
INTEGER e;
Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19);
Platform_errstring((CHAR*)"Assertion failure.", 19);
if (code != 0) {
Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14);
Platform_errstring((CHAR*)" ASSERT code ", 14);
Platform_errint(code);
Platform_errstring((CHAR*)".", (LONGINT)2);
Platform_errstring((CHAR*)".", 2);
}
Platform_errln();
Platform_exit(__VAL(INTEGER, code));
@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void)
{
INTEGER i;
i = 1;
__GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN);
__GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN);
}
__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}};
@ -782,7 +782,7 @@ export void *Platform__init(void)
Platform_TimeStart = 0;
Platform_TimeStart = Platform_Time();
Platform_CWD[0] = 0x00;
Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256)));
Platform_getcwd((void*)Platform_CWD, 256);
Platform_PID = Platform_getpid();
Platform_SeekSet = Platform_seekset();
Platform_SeekCur = Platform_seekcur();

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Platform__h
#define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x)
{
INTEGER _o_result;
INTEGER i;
__GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER);
__GET((SYSTEM_ADRINT)&x + 2, i, INTEGER);
_o_result = __MASK(__ASHR(i, 7), -256);
return _o_result;
}
@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x)
void Reals_SetExpo (REAL *x, INTEGER ex)
{
CHAR c;
__GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR);
__PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR);
__PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
__GET((SYSTEM_ADRINT)x + 3, c, CHAR);
__PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__GET((SYSTEM_ADRINT)x + 2, c, CHAR);
__PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
}
INTEGER Reals_ExpoL (LONGREAL x)
{
INTEGER _o_result;
INTEGER i;
__GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER);
__GET((SYSTEM_ADRINT)&x + 6, i, INTEGER);
_o_result = __MASK(__ASHR(i, 4), -2048);
return _o_result;
}
@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len)
}
k = 0;
if (n > 9) {
i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
j = (int)__ENTIER(x - i * (LONGREAL)1000000000);
i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000);
if (j < 0) {
j = 0;
}
while (k < 9) {
d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48);
d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48);
j = __DIV(j, 10);
k += 1;
}
} else {
i = (int)__ENTIER(x);
i = (SYSTEM_INT32)__ENTIER(x);
}
while (k < (int)n) {
d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48);
while (k < n) {
d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48);
i = __DIV(i, 10);
k += 1;
}
@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO
CHAR by;
i = 0;
l = b__len;
while ((int)i < l) {
while (i < l) {
by = __VAL(CHAR, b[__X(i, b__len)]);
d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4));
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16));
d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4));
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16));
i += 1;
}
}
void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len)
{
Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1)));
Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1);
}
void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len)
{
Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1)));
Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Reals__h
#define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len)
INTEGER i;
__DUP(s, s__len, CHAR);
i = 0;
while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) {
while ((i < s__len && s[__X(i, s__len)] != 0x00)) {
i += 1;
}
_o_result = i;
@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__
n1 = Strings_Length(dest, dest__len);
n2 = Strings_Length(extra, extra__len);
i = 0;
while ((i < n2 && (int)(i + n1) < dest__len)) {
while ((i < n2 && (i + n1) < dest__len)) {
dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)];
i += 1;
}
if ((int)(i + n1) < dest__len) {
if ((i + n1) < dest__len) {
dest[__X(i + n1, dest__len)] = 0x00;
}
__DEL(extra);
@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest,
Strings_Append(dest, dest__len, (void*)source, source__len);
return;
}
if ((int)(pos + n2) < dest__len) {
if ((pos + n2) < dest__len) {
i = n1;
while (i >= pos) {
if ((int)(i + n2) < dest__len) {
if ((i + n2) < dest__len) {
dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)];
}
i -= 1;
@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n)
s[__X(i - n, s__len)] = s[__X(i, s__len)];
i += 1;
}
if ((int)(i - n) < s__len) {
if ((i - n) < s__len) {
s[__X(i - n, s__len)] = 0x00;
}
} else {
@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n,
INTEGER len, destLen, i;
__DUP(source, source__len, CHAR);
len = Strings_Length(source, source__len);
destLen = (int)dest__len - 1;
destLen = dest__len - 1;
if (pos < 0) {
pos = 0;
}
@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n,
return;
}
i = 0;
while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) {
while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) {
if (i < destLen) {
dest[__X(i, dest__len)] = source[__X(pos + i, source__len)];
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Strings__h
#define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Files.h"
#include "Modules.h"
@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
Texts_FontsFont _o_result;
Texts_FontsFont F = NIL;
__NEW(F, Texts_FontDesc);
__COPY(name, F->name, ((LONGINT)(32)));
__COPY(name, F->name, 32);
_o_result = F;
return _o_result;
}
@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t
e->file = ((Texts_Alien)E)->file;
e->org = ((Texts_Alien)E)->org;
e->span = ((Texts_Alien)E)->span;
__COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32)));
__COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32)));
__COPY(((Texts_Alien)E)->mod, e->mod, 32);
__COPY(((Texts_Alien)E)->proc, e->proc, 32);
(*msg__).e = (Texts_Elem)e;
} else __WITHCHK;
} else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) {
if (__IS(msg__typ, Texts_IdentifyMsg, 1)) {
Texts_IdentifyMsg *msg__ = (void*)msg;
__COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32)));
__COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32)));
__COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32);
__COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32);
(*msg__).mod[31] = 0x01;
} else __WITHCHK;
} else if (__IS(msg__typ, Texts_FileMsg, 1)) {
@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void)
}
}
while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) {
*Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48;
*Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48;
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch);
}
}
@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
}
if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') {
do {
(*S).s[__X(i, ((LONGINT)(64)))] = ch;
(*S).s[__X(i, 64)] = ch;
i += 1;
Texts_Read((void*)&*S, S__typ, &ch);
} while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63));
(*S).s[__X(i, ((LONGINT)(64)))] = 0x00;
(*S).s[__X(i, 64)] = 0x00;
(*S).len = i;
(*S).class = 1;
} else if (ch == '"') {
Texts_Read((void*)&*S, S__typ, &ch);
while ((((ch != '"' && ch >= ' ')) && i != 63)) {
(*S).s[__X(i, ((LONGINT)(64)))] = ch;
(*S).s[__X(i, 64)] = ch;
i += 1;
Texts_Read((void*)&*S, S__typ, &ch);
}
(*S).s[__X(i, ((LONGINT)(64)))] = 0x00;
(*S).s[__X(i, 64)] = 0x00;
(*S).len = i + 1;
Texts_Read((void*)&*S, S__typ, &ch);
(*S).class = 2;
@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
hex = 0;
j = 0;
for (;;) {
d[__X(i, ((LONGINT)(32)))] = ch;
d[__X(i, 32)] = ch;
i += 1;
Texts_Read((void*)&*S, S__typ, &ch);
if (ch < '0') {
@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
if ('9' < ch) {
if (('A' <= ch && ch <= 'F')) {
hex = 1;
ch = (CHAR)((int)ch - 7);
ch = (CHAR)(ch - 7);
} else if (('a' <= ch && ch <= 'f')) {
hex = 1;
ch = (CHAR)((int)ch - 39);
ch = (CHAR)(ch - 39);
} else {
break;
}
@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
if (i - j > 8) {
j = i - 8;
}
k = (int)d[__X(j, ((LONGINT)(32)))] - 48;
k = d[__X(j, 32)] - 48;
j += 1;
if ((i - j == 7 && k >= 8)) {
k -= 16;
}
while (j < i) {
k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48);
k = __ASHL(k, 4) + (d[__X(j, 32)] - 48);
j += 1;
}
if (neg) {
@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
Texts_Read((void*)&*S, S__typ, &ch);
h = i;
while (('0' <= ch && ch <= '9')) {
d[__X(i, ((LONGINT)(32)))] = ch;
d[__X(i, 32)] = ch;
i += 1;
Texts_Read((void*)&*S, S__typ, &ch);
}
@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
y = (LONGREAL)0;
g = (LONGREAL)1;
do {
y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48);
y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48);
j += 1;
} while (!(j == h));
while (j < i) {
g = g / (LONGREAL)(LONGREAL)10;
y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y;
y = (d[__X(j, 32)] - 48) * g + y;
j += 1;
}
ReadScaleFactor__32();
@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
x = (REAL)0;
f = (REAL)1;
do {
x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48);
x = x * (REAL)10 + (d[__X(j, 32)] - 48);
j += 1;
} while (!(j == h));
while (j < i) {
f = f / (REAL)(REAL)10;
x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x;
x = (d[__X(j, 32)] - 48) * f + x;
j += 1;
}
if (ch == 'E') {
@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
(*S).class = 3;
k = 0;
do {
k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48);
k = k * 10 + (d[__X(j, 32)] - 48);
j += 1;
} while (!(j == i));
if (neg) {
@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ)
(*W).fnt = Texts_FontsDefault;
(*W).col = 15;
(*W).voff = 0;
(*W).file = Files_New((CHAR*)"", (LONGINT)1);
Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0)));
(*W).file = Files_New((CHAR*)"", 1);
Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0);
}
void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt)
@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n)
i = 0;
if (x < 0) {
if (x == (-2147483647-1)) {
Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13);
Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13);
return;
} else {
n -= 1;
@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n)
x0 = x;
}
do {
a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48);
a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48);
x0 = __DIV(x0, 10);
i += 1;
} while (!(x0 == 0));
while (n > (int)i) {
while (n > i) {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
}
@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n)
}
do {
i -= 1;
Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]);
Texts_Write(&*W, W__typ, a[__X(i, 22)]);
} while (!(i == 0));
}
@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x)
do {
y = __MASK(x, -16);
if (y < 10) {
a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48);
a[__X(i, 20)] = (CHAR)(y + 48);
} else {
a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55);
a[__X(i, 20)] = (CHAR)(y + 55);
}
x = __ASHR(x, 4);
i += 1;
} while (!(i == 8));
do {
i -= 1;
Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]);
Texts_Write(&*W, W__typ, a[__X(i, 20)]);
} while (!(i == 0));
}
@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n)
CHAR d[9];
e = Reals_Expo(x);
if (e == 0) {
Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4);
Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4);
do {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
} while (!(n <= 3));
} else if (e == 255) {
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5);
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5);
while (n > 4) {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n)
x = x * 1.0000000e-001;
e += 1;
}
Reals_Convert(x, n, (void*)d, ((LONGINT)(9)));
Reals_Convert(x, n, (void*)d, 9);
n -= 1;
Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]);
Texts_Write(&*W, W__typ, d[__X(n, 9)]);
Texts_Write(&*W, W__typ, '.');
do {
n -= 1;
Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]);
Texts_Write(&*W, W__typ, d[__X(n, 9)]);
} while (!(n == 0));
Texts_Write(&*W, W__typ, 'E');
if (e < 0) {
@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n)
{
while (n > 0) {
*WriteRealFix__53_s->i -= 1;
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]);
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]);
n -= 1;
}
}
@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN
Texts_Write(&*W, W__typ, '0');
seq__56(' ', k + 1);
} else if (e == 255) {
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5);
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5);
seq__56(' ', n - 4);
} else {
e = __ASHR((e - 127) * 77, 8);
@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN
}
e += 1;
i = k + e;
Reals_Convert(x, i, (void*)d, ((LONGINT)(9)));
Reals_Convert(x, i, (void*)d, 9);
if (e > 0) {
seq__56(' ', ((n - e) - k) - 2);
Texts_Write(&*W, W__typ, sign);
@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x)
{
INTEGER i;
CHAR d[8];
Reals_ConvertH(x, (void*)d, ((LONGINT)(8)));
Reals_ConvertH(x, (void*)d, 8);
i = 0;
do {
Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]);
Texts_Write(&*W, W__typ, d[__X(i, 8)]);
i += 1;
} while (!(i == 8));
}
@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
CHAR d[16];
e = Reals_ExpoL(x);
if (e == 0) {
Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4);
Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4);
do {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
} while (!(n <= 3));
} else if (e == 2047) {
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5);
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5);
while (n > 4) {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
} else {
Texts_Write(&*W, W__typ, ' ');
}
e = (int)__ASHR((int)(e - 1023) * 77, 8);
e = __ASHR((e - 1023) * 77, 8);
if (e >= 0) {
x = x / (LONGREAL)Reals_TenL(e);
} else {
@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
x = 1.00000000000000e-001 * x;
e += 1;
}
Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16)));
Reals_ConvertL(x, n, (void*)d, 16);
n -= 1;
Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]);
Texts_Write(&*W, W__typ, d[__X(n, 16)]);
Texts_Write(&*W, W__typ, '.');
do {
n -= 1;
Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]);
Texts_Write(&*W, W__typ, d[__X(n, 16)]);
} while (!(n == 0));
Texts_Write(&*W, W__typ, 'D');
if (e < 0) {
@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x)
{
INTEGER i;
CHAR d[16];
Reals_ConvertHL(x, (void*)d, ((LONGINT)(16)));
Reals_ConvertHL(x, (void*)d, 16);
i = 0;
do {
Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]);
Texts_Write(&*W, W__typ, d[__X(i, 16)]);
i += 1;
} while (!(i == 16));
}
@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x)
{
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch);
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48));
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48));
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48));
}
void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d)
@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT
Files_Read(&*r, r__typ, (void*)&eno);
if (eno > *Load0__16_s->ecnt) {
*Load0__16_s->ecnt = eno;
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32)));
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32)));
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32);
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32);
}
org = Files_Pos(&*r, r__typ);
M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32)));
M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32);
if (M != NIL) {
Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32)));
Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32);
if (Cmd != NIL) {
(*Cmd)();
}
@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT
a->file = *Load0__16_s->f;
a->org = org;
a->span = span;
__COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32)));
__COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32)));
__COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32);
__COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32);
*e = (Texts_Elem)a;
}
}
@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
while (fno != 0) {
if (fno > fcnt) {
fcnt = fno;
Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32)));
fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32)));
Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32);
fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32);
}
Files_Read(&msg.r, Files_Rider__typ, (void*)&col);
Files_Read(&msg.r, Files_Rider__typ, (void*)&voff);
@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len)
__DUP(name, name__len, CHAR);
f = Files_Old(name, name__len);
if (f == NIL) {
f = Files_New((CHAR*)"", (LONGINT)1);
f = Files_New((CHAR*)"", 1);
}
Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0)));
Files_Set(&r, Files_Rider__typ, f, 0);
Files_Read(&r, Files_Rider__typ, (void*)&tag);
Files_Read(&r, Files_Rider__typ, (void*)&version);
if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) {
@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len)
u->col = 15;
__NEW(p, Texts_PieceDesc);
if ((tag == 0xf7 && version == 0x07)) {
Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28)));
Files_Set(&r, Files_Rider__typ, f, 28);
Files_ReadLInt(&r, Files_Rider__typ, &hlen);
Files_Set(&r, Files_Rider__typ, f, 22 + hlen);
Files_ReadLInt(&r, Files_Rider__typ, &T->len);
@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E
Files_Rider r1;
LONGINT org, span;
SHORTINT eno;
__COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32)));
__COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32)));
__COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32);
__COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32);
eno = 1;
while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) {
while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) {
eno += 1;
}
Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ));
Files_WriteLInt(&*r, r__typ, ((LONGINT)(0)));
Files_WriteLInt(&*r, r__typ, ((LONGINT)(0)));
Files_WriteLInt(&*r, r__typ, ((LONGINT)(0)));
Files_WriteLInt(&*r, r__typ, 0);
Files_WriteLInt(&*r, r__typ, 0);
Files_WriteLInt(&*r, r__typ, 0);
Files_Write(&*r, r__typ, eno);
if (eno == *Store__39_s->ecnt) {
*Store__39_s->ecnt += 1;
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32)));
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32)));
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32);
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32);
}
(*Store__39_s->msg).pos = pos;
org = Files_Pos(&*r, r__typ);
@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
org = Files_Pos(&*r, r__typ);
msg.id = 1;
msg.r = *r;
Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0)));
Files_WriteLInt(&msg.r, Files_Rider__typ, 0);
u = T->head->next;
pos = 0;
delta = 0;
@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
iden.mod[0] = 0x01;
}
if (iden.mod[0] != 0x00) {
fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt;
fnts[__X(fcnt, 32)] = u->fnt;
fno = 1;
while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) {
while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) {
fno += 1;
}
Files_Write(&msg.r, Files_Rider__typ, fno);
if (fno == fcnt) {
fcnt += 1;
Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32)));
Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32);
}
Files_Write(&msg.r, Files_Rider__typ, u->col);
Files_Write(&msg.r, Files_Rider__typ, u->voff);
@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org);
delta = ((Texts_Piece)u)->len;
while (delta > 1024) {
Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024)));
Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024)));
Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024);
Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024);
delta -= 1024;
}
Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta);
Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta);
Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta);
Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta);
}
} else __WITHCHK;
} else {
@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
}
__GUARDEQR(r, r__typ, Files_Rider) = msg.r;
if (T->notify != NIL) {
(*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0)));
(*T->notify)(T, 3, 0, 0);
}
Store__39_s = _s.lnk;
}
@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len)
CHAR bak[64];
__DUP(name, name__len, CHAR);
f = Files_New(name, name__len);
Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0)));
Files_Set(&r, Files_Rider__typ, f, 0);
Files_Write(&r, Files_Rider__typ, 0xf0);
Files_Write(&r, Files_Rider__typ, 0x01);
Texts_Store(&r, Files_Rider__typ, T);
@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len)
while (name[__X(i, name__len)] != 0x00) {
i += 1;
}
__COPY(name, bak, ((LONGINT)(64)));
bak[__X(i, ((LONGINT)(64)))] = '.';
bak[__X(i + 1, ((LONGINT)(64)))] = 'B';
bak[__X(i + 2, ((LONGINT)(64)))] = 'a';
bak[__X(i + 3, ((LONGINT)(64)))] = 'k';
bak[__X(i + 4, ((LONGINT)(64)))] = 0x00;
Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res);
__COPY(name, bak, 64);
bak[__X(i, 64)] = '.';
bak[__X(i + 1, 64)] = 'B';
bak[__X(i + 2, 64)] = 'a';
bak[__X(i + 3, 64)] = 'k';
bak[__X(i + 4, 64)] = 0x00;
Files_Rename(name, name__len, bak, 64, &res);
Files_Register(f);
__DEL(name);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Texts__h
#define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Heap.h"
@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done)
OPV_AdrAndSize(OPT_topScope);
OPT_Export(&ext, &new);
if (OPM_noerr) {
OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256)));
OPM_OpenFiles((void*)OPT_SelfName, 256);
OPC_Init();
OPV_Module(p);
if (OPM_noerr) {
if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
OPM_DeleteNewSym();
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"32m", (LONGINT)4);
vt100_SetAttr((CHAR*)"32m", 4);
}
OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16);
OPM_LogWStr((CHAR*)" Main program.", 16);
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
} else {
if (new) {
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"32m", (LONGINT)4);
vt100_SetAttr((CHAR*)"32m", 4);
}
OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19);
OPM_LogWStr((CHAR*)" New symbol file.", 19);
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
OPM_RegisterNewSym();
} else if (ext) {
OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24);
OPM_LogWStr((CHAR*)" Extended symbol file.", 24);
OPM_RegisterNewSym();
}
}
@ -94,7 +94,7 @@ void Vishap_Translate (void)
modulesobj[0] = 0x00;
if (OPM_OpenPar()) {
for (;;) {
OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256)));
OPM_Init(&done, (void*)Vishap_mname, 256);
if (!done) {
return;
}
@ -104,21 +104,21 @@ void Vishap_Translate (void)
Vishap_Module(&done);
if (!done) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27);
OPM_LogWStr((CHAR*)"Module compilation failed.", 27);
OPM_LogWLn();
Platform_Exit(1);
}
if (!OPM_dontAsm) {
if (OPM_dontLink) {
extTools_Assemble(OPM_modName, ((LONGINT)(32)));
extTools_Assemble(OPM_modName, 32);
} else {
if (!(OPM_mainProg || OPM_mainLinkStat)) {
extTools_Assemble(OPM_modName, ((LONGINT)(32)));
Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048)));
Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048)));
Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048)));
extTools_Assemble(OPM_modName, 32);
Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048);
Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048);
Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048);
} else {
extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048)));
extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048);
}
}
}
@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig)
Platform_Exit(0);
} else {
if ((sig == 4 && Platform_HaltCode == -15)) {
OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35);
OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35);
OPM_LogWLn();
}
Platform_Exit(2);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
typedef

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef errors__h
#define errors__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"
@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
Console_String(title, title__len);
Console_String(cmd, cmd__len);
Console_Ln();
Console_String((CHAR*)"-- failed: status ", (LONGINT)19);
Console_Int(status, ((LONGINT)(1)));
Console_String((CHAR*)", exitcode ", (LONGINT)12);
Console_Int(exitcode, ((LONGINT)(1)));
Console_String((CHAR*)".", (LONGINT)2);
Console_String((CHAR*)"-- failed: status ", 19);
Console_Int(status, 1);
Console_String((CHAR*)", exitcode ", 12);
Console_Int(exitcode, 1);
Console_String((CHAR*)".", 2);
Console_Ln();
if ((status == 0 && exitcode == 127)) {
Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47);
Console_String((CHAR*)"Is the C compiler in the current command path\?", 47);
Console_Ln();
}
if (status != 0) {
@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len)
CHAR cmd[1023];
__DUP(moduleName, moduleName__len, CHAR);
__MOVE("gcc -g", cmd, 7);
Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023)));
Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023)));
extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023)));
Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023);
Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023);
Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023);
Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023);
extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023);
__DEL(moduleName);
}
@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati
CHAR cmd[1023];
__DUP(additionalopts, additionalopts__len, CHAR);
__MOVE("gcc -g", cmd, 7);
Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023)));
Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023)));
Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023)));
Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023);
Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023);
Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023);
Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023);
Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023);
if (statically) {
Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023);
}
Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023)));
Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023)));
extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023);
Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023);
Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023);
Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023);
Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023);
Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023);
extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023);
__DEL(additionalopts);
}
@ -102,11 +102,11 @@ export void *extTools__init(void)
__MODULE_IMPORT(Strings);
__REGMOD("extTools", 0);
/* BEGIN */
Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023)));
Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023);
Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023);
Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023);
Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023);
Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023);
Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef extTools__h
#define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Console.h"
#include "Strings.h"
@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len)
}
e = s;
do {
b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48);
b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48);
int_ = __DIV(int_, 10);
e += 1;
} while (!(int_ == 0));
b[__X(e, ((LONGINT)(21)))] = 0x00;
vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1);
b[__X(e, 21)] = 0x00;
vt100_Reverse0((void*)b, 21, s, e - 1);
}
__COPY(b, str, str__len);
}
@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len)
{
CHAR cmd[9];
__DUP(letter, letter__len, CHAR);
__COPY(vt100_CSI, cmd, ((LONGINT)(9)));
Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9)));
Console_String(cmd, ((LONGINT)(9)));
__COPY(vt100_CSI, cmd, 9);
Strings_Append(letter, letter__len, (void*)cmd, 9);
Console_String(cmd, 9);
__DEL(letter);
}
@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len)
CHAR nstr[2];
CHAR cmd[7];
__DUP(letter, letter__len, CHAR);
vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2)));
__COPY(vt100_CSI, cmd, ((LONGINT)(7)));
Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7)));
Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7)));
Console_String(cmd, ((LONGINT)(7)));
vt100_IntToStr(n, (void*)nstr, 2);
__COPY(vt100_CSI, cmd, 7);
Strings_Append(nstr, 2, (void*)cmd, 7);
Strings_Append(letter, letter__len, (void*)cmd, 7);
Console_String(cmd, 7);
__DEL(letter);
}
@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len)
CHAR nstr[2];
CHAR cmd[7];
__DUP(letter, letter__len, CHAR);
vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2)));
__COPY(vt100_CSI, cmd, ((LONGINT)(7)));
Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7)));
Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7)));
Console_String(cmd, ((LONGINT)(7)));
vt100_IntToStr(n, (void*)nstr, 2);
__COPY(vt100_CSI, cmd, 7);
Strings_Append(letter, letter__len, (void*)cmd, 7);
Strings_Append(nstr, 2, (void*)cmd, 7);
Console_String(cmd, 7);
__DEL(letter);
}
@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l
CHAR nstr[5], mstr[5];
CHAR cmd[12];
__DUP(letter, letter__len, CHAR);
vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5)));
vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5)));
__COPY(vt100_CSI, cmd, ((LONGINT)(12)));
Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12)));
Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12)));
Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12)));
Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12)));
Console_String(cmd, ((LONGINT)(12)));
vt100_IntToStr(n, (void*)nstr, 5);
vt100_IntToStr(m, (void*)mstr, 5);
__COPY(vt100_CSI, cmd, 12);
Strings_Append(nstr, 5, (void*)cmd, 12);
Strings_Append((CHAR*)";", 2, (void*)cmd, 12);
Strings_Append(mstr, 5, (void*)cmd, 12);
Strings_Append(letter, letter__len, (void*)cmd, 12);
Console_String(cmd, 12);
__DEL(letter);
}
void vt100_CUU (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"A", 2);
}
void vt100_CUD (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"B", 2);
}
void vt100_CUF (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"C", 2);
}
void vt100_CUB (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"D", 2);
}
void vt100_CNL (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"E", 2);
}
void vt100_CPL (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"F", 2);
}
void vt100_CHA (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"G", 2);
}
void vt100_CUP (INTEGER n, INTEGER m)
{
vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2);
vt100_EscSeq2(n, m, (CHAR*)"H", 2);
}
void vt100_ED (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"J", 2);
}
void vt100_EL (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"K", 2);
}
void vt100_SU (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"S", 2);
}
void vt100_SD (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"T", 2);
}
void vt100_HVP (INTEGER n, INTEGER m)
{
vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2);
vt100_EscSeq2(n, m, (CHAR*)"f", 2);
}
void vt100_SGR (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"m", 2);
}
void vt100_SGR2 (INTEGER n, INTEGER m)
{
vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2);
vt100_EscSeq2(n, m, (CHAR*)"m", 2);
}
void vt100_DSR (INTEGER n)
{
vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2);
vt100_EscSeq(6, (CHAR*)"n", 2);
}
void vt100_SCP (void)
{
vt100_EscSeq0((CHAR*)"s", (LONGINT)2);
vt100_EscSeq0((CHAR*)"s", 2);
}
void vt100_RCP (void)
{
vt100_EscSeq0((CHAR*)"u", (LONGINT)2);
vt100_EscSeq0((CHAR*)"u", 2);
}
void vt100_DECTCEMl (void)
{
vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5);
vt100_EscSeq0((CHAR*)"\?25l", 5);
}
void vt100_DECTCEMh (void)
{
vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5);
vt100_EscSeq0((CHAR*)"\?25h", 5);
}
void vt100_SetAttr (CHAR *attr, LONGINT attr__len)
{
CHAR tmpstr[16];
__DUP(attr, attr__len, CHAR);
__COPY(vt100_CSI, tmpstr, ((LONGINT)(16)));
Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16)));
Console_String(tmpstr, ((LONGINT)(16)));
__COPY(vt100_CSI, tmpstr, 16);
Strings_Append(attr, attr__len, (void*)tmpstr, 16);
Console_String(tmpstr, 16);
__DEL(attr);
}
@ -252,7 +252,7 @@ export void *vt100__init(void)
__REGCMD("RCP", vt100_RCP);
__REGCMD("SCP", vt100_SCP);
/* BEGIN */
__COPY("\033", vt100_CSI, ((LONGINT)(5)));
Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5)));
__COPY("\033", vt100_CSI, 5);
Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef vt100__h
#define vt100__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
@ -13,6 +13,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Platform.h"
@ -21,7 +21,7 @@ export void Console_String (CHAR *s, LONGINT s__len);
void Console_Flush (void)
{
INTEGER error;
error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos);
error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos);
Console_pos = 0;
}
@ -30,7 +30,7 @@ void Console_Char (CHAR ch)
if (Console_pos == 128) {
Console_Flush();
}
Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch;
Console_line[__X(Console_pos, 128)] = ch;
Console_pos += 1;
if (ch == 0x0a) {
Console_Flush();
@ -58,17 +58,17 @@ void Console_Int (LONGINT i, LONGINT n)
k = 10;
} else {
i1 = __ABS(i);
s[0] = (CHAR)(__MOD(i1, 10) + 48);
s[0] = (CHAR)((int)__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k = 1;
while (i1 > 0) {
s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48);
s[__X(k, 32)] = (CHAR)((int)__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k += 1;
}
}
if (i < 0) {
s[__X(k, ((LONGINT)(32)))] = '-';
s[__X(k, 32)] = '-';
k += 1;
}
while (n > k) {
@ -77,7 +77,7 @@ void Console_Int (LONGINT i, LONGINT n)
}
while (k > 0) {
k -= 1;
Console_Char(s[__X(k, ((LONGINT)(32)))]);
Console_Char(s[__X(k, 32)]);
}
}
@ -89,9 +89,9 @@ void Console_Ln (void)
void Console_Bool (BOOLEAN b)
{
if (b) {
Console_String((CHAR*)"TRUE", (LONGINT)5);
Console_String((CHAR*)"TRUE", 5);
} else {
Console_String((CHAR*)"FALSE", (LONGINT)6);
Console_String((CHAR*)"FALSE", 6);
}
}
@ -115,7 +115,7 @@ void Console_Read (CHAR *ch)
LONGINT n;
INTEGER error;
Console_Flush();
error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n);
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n);
if (n != 1) {
*ch = 0x00;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h
#define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"
@ -110,23 +110,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode)
{
__DUP(s, s__len, CHAR);
Console_Ln();
Console_String((CHAR*)"-- ", (LONGINT)4);
Console_String((CHAR*)"-- ", 4);
Console_String(s, s__len);
Console_String((CHAR*)": ", (LONGINT)3);
Console_String((CHAR*)": ", 3);
if (f != NIL) {
if (f->registerName[0] != 0x00) {
Console_String(f->registerName, ((LONGINT)(101)));
Console_String(f->registerName, 101);
} else {
Console_String(f->workName, ((LONGINT)(101)));
Console_String(f->workName, 101);
}
if (f->fd != 0) {
Console_String((CHAR*)"f.fd = ", (LONGINT)8);
Console_Int(f->fd, ((LONGINT)(1)));
Console_String((CHAR*)"f.fd = ", 8);
Console_Int(f->fd, 1);
}
}
if (errcode != 0) {
Console_String((CHAR*)" errcode = ", (LONGINT)12);
Console_Int(errcode, ((LONGINT)(1)));
Console_String((CHAR*)" errcode = ", 12);
Console_Int(errcode, 1);
}
Console_Ln();
__HALT(99);
@ -192,7 +192,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na
name[i + 5] = '.';
i += 6;
while (n > 0) {
name[i] = (CHAR)(__MOD(n, 10) + 48);
name[i] = (CHAR)((int)__MOD(n, 10) + 48);
n = __DIV(n, 10);
i += 1;
}
@ -200,7 +200,7 @@ static void Files_GetTempName (CHAR *finalName, LONGINT finalName__len, CHAR *na
i += 1;
n = Platform_PID;
while (n > 0) {
name[i] = (CHAR)(__MOD(n, 10) + 48);
name[i] = (CHAR)((int)__MOD(n, 10) + 48);
n = __DIV(n, 10);
i += 1;
}
@ -216,15 +216,15 @@ static void Files_Create (Files_File f)
CHAR err[32];
if (f->fd == -1) {
if (f->state == 1) {
Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101)));
Files_GetTempName(f->registerName, 101, (void*)f->workName, 101);
f->tempFile = 1;
} else if (f->state == 2) {
__COPY(f->registerName, f->workName, ((LONGINT)(101)));
__COPY(f->registerName, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
}
error = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
error = Platform_Unlink((void*)f->workName, 101);
error = Platform_New((void*)f->workName, 101, &f->fd);
done = error == 0;
if (done) {
f->next = Files_files;
@ -242,7 +242,7 @@ static void Files_Create (Files_File f)
} else {
__MOVE("file not created", err, 17);
}
Files_Err(err, ((LONGINT)(32)), f, error);
Files_Err(err, 32, f, error);
}
}
}
@ -257,15 +257,15 @@ static void Files_Flush (Files_Buffer buf)
if (buf->org != f->pos) {
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
}
error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size);
error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size);
if (error != 0) {
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
Files_Err((CHAR*)"error writing file", 19, f, error);
}
f->pos = buf->org + buf->size;
buf->chg = 0;
error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ);
if (error != 0) {
Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error);
Files_Err((CHAR*)"error identifying file", 23, f, error);
}
}
}
@ -304,7 +304,7 @@ void Files_Close (Files_File f)
}
error = Platform_Sync(f->fd);
if (error != 0) {
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
Files_Err((CHAR*)"error writing file", 19, f, error);
}
Files_CloseOSFile(f);
}
@ -324,7 +324,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
__DUP(name, name__len, CHAR);
__NEW(f, Files_FileDesc);
f->workName[0] = 0x00;
__COPY(name, f->registerName, ((LONGINT)(101)));
__COPY(name, f->registerName, 101);
f->fd = -1;
f->state = 1;
f->len = 0;
@ -437,28 +437,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
if (name[0] != 0x00) {
if (Files_HasDir((void*)name, name__len)) {
dir[0] = 0x00;
__COPY(name, path, ((LONGINT)(256)));
__COPY(name, path, 256);
} else {
pos = 0;
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, 256);
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256);
}
for (;;) {
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
error = Platform_OldRW((void*)path, 256, &fd);
done = error == 0;
if ((!done && Platform_TooManyFiles(error))) {
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error);
Files_Err((CHAR*)"too many files open", 20, f, error);
}
if ((!done && Platform_Inaccessible(error))) {
error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd);
error = Platform_OldRO((void*)path, 256, &fd);
done = error == 0;
}
if ((!done && !Platform_Absent(error))) {
Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20);
Console_String((CHAR*)"Warning: Files.Old ", 20);
Console_String(name, name__len);
Console_String((CHAR*)" error = ", (LONGINT)10);
Console_Int(error, ((LONGINT)(0)));
Console_String((CHAR*)" error = ", 10);
Console_Int(error, 0);
Console_Ln();
}
if (done) {
@ -476,7 +476,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
f->pos = 0;
f->swapper = -1;
error = Platform_Size(fd, &f->len);
__COPY(name, f->workName, ((LONGINT)(101)));
__COPY(name, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
f->identity = identity;
@ -492,8 +492,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
__DEL(name);
return _o_result;
} else {
Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256);
}
}
} else {
@ -518,8 +518,8 @@ void Files_Purge (Files_File f)
i += 1;
}
if (f->fd != -1) {
error = Platform_Truncate(f->fd, ((LONGINT)(0)));
error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet);
error = Platform_Truncate(f->fd, 0);
error = Platform_Seek(f->fd, 0, Platform_SeekSet);
}
f->pos = 0;
f->len = 0;
@ -584,9 +584,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos)
if (f->pos != org) {
error = Platform_Seek(f->fd, org, Platform_SeekSet);
}
error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n);
error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n);
if (error != 0) {
Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error);
Files_Err((CHAR*)"read from file not done", 24, f, error);
}
f->pos = org + n;
buf->size = n;
@ -656,7 +656,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else {
min = n;
}
__MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min);
__MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min);
offset += min;
(*r).offset = offset;
xpos += min;
@ -668,7 +668,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len)
{
Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1)));
Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1);
}
Files_File Files_Base (Files_Rider *r, LONGINT *r__typ)
@ -721,7 +721,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else {
min = n;
}
__MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min);
__MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min);
offset += min;
(*r).offset = offset;
if (offset > buf->size) {
@ -772,15 +772,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
*res = 3;
return;
}
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n);
error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n);
while (n > 0) {
error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n);
error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n);
if (error != 0) {
ignore = Platform_Close(fdold);
ignore = Platform_Close(fdnew);
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
Files_Err((CHAR*)"cannot move file", 17, NIL, error);
}
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n);
error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n);
}
ignore = Platform_Close(fdold);
ignore = Platform_Close(fdnew);
@ -788,7 +788,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
error = Platform_Unlink((void*)old, old__len);
*res = 0;
} else {
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
Files_Err((CHAR*)"cannot move file", 17, NIL, error);
}
}
} else {
@ -808,12 +808,12 @@ void Files_Register (Files_File f)
}
Files_Close(f);
if (f->registerName[0] != 0x00) {
Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode);
Files_Rename(f->workName, 101, f->registerName, 101, &errcode);
if (errcode != 0) {
__COPY(f->registerName, file, ((LONGINT)(104)));
__COPY(f->registerName, file, 104);
__HALT(99);
}
__COPY(f->registerName, f->workName, ((LONGINT)(101)));
__COPY(f->registerName, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
}
@ -838,7 +838,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
j += 1;
}
} else {
__MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len);
__MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len);
}
}
@ -850,38 +850,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x)
void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x)
{
CHAR b[2];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2)));
*x = (int)b[0] + __ASHL((int)b[1], 8);
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2);
*x = b[0] + __ASHL(b[1], 8);
}
void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
*x = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24);
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
*x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
}
void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x)
{
CHAR b[4];
LONGINT l;
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
l = ((int)((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24);
*x = (SET)l;
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = __VAL(SET, l);
}
void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4)));
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
Files_FlipBytes((void*)b, 4, (void*)&*x, 4);
}
void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x)
{
CHAR b[8];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8)));
Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8)));
Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8);
Files_FlipBytes((void*)b, 8, (void*)&*x, 8);
}
void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len)
@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
s = 0;
n = 0;
Files_Read(&*R, R__typ, (void*)&ch);
while ((int)ch >= 128) {
n += __ASH((int)((int)ch - 128), s);
while (ch >= 128) {
n += __ASH((ch - 128), s);
s += 7;
Files_Read(&*R, R__typ, (void*)&ch);
}
n += __ASH((int)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s);
n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s);
*x = n;
}
@ -941,7 +941,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x)
CHAR b[2];
b[0] = (CHAR)x;
b[1] = (CHAR)__ASHR(x, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2)));
Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2);
}
void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x)
@ -951,33 +951,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x)
b[1] = (CHAR)__ASHR(x, 8);
b[2] = (CHAR)__ASHR(x, 16);
b[3] = (CHAR)__ASHR(x, 24);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x)
{
CHAR b[4];
LONGINT i;
i = (LONGINT)x;
i = __VAL(LONGINT, x);
b[0] = (CHAR)i;
b[1] = (CHAR)__ASHR(i, 8);
b[2] = (CHAR)__ASHR(i, 16);
b[3] = (CHAR)__ASHR(i, 24);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x)
{
CHAR b[4];
Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_FlipBytes((void*)&x, 4, (void*)b, 4);
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x)
{
CHAR b[8];
Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8)));
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8)));
Files_FlipBytes((void*)&x, 8, (void*)b, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8);
}
void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len)
@ -987,7 +987,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len
while (x[i] != 0x00) {
i += 1;
}
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1);
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
}
void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x)
@ -1012,7 +1012,7 @@ static void Files_Finalize (SYSTEM_PTR o)
if (f->fd >= 0) {
Files_CloseOSFile(f);
if (f->tempFile) {
res = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
res = Platform_Unlink((void*)f->workName, 101);
}
}
}
@ -1021,7 +1021,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len)
{
__DUP(path, path__len, CHAR);
if (Strings_Length(path, path__len) != 0) {
Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1));
Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1))));
__COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]);
} else {
Files_SearchPath = NIL;
@ -1055,6 +1055,6 @@ export void *Files__init(void)
Files_tempno = -1;
Heap_FileCount = 0;
Files_HOME[0] = 0x00;
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h
#define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */
#include "SYSTEM.h"
struct Heap__1 {
@ -116,7 +116,7 @@ void Heap_Unlock (void)
{
Heap_lockdepth -= 1;
if ((Heap_interrupted && Heap_lockdepth == 0)) {
Heap_PlatformHalt(((LONGINT)(-9)));
Heap_PlatformHalt(-9);
}
}
@ -131,7 +131,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
}
m->types = 0;
m->cmds = NIL;
__COPY(name, m->name, ((LONGINT)(20)));
__COPY(name, m->name, 20);
m->refcnt = 0;
m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules;
@ -148,7 +148,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
} else {
__NEW(c, Heap_CmdDesc);
}
__COPY(name, c->name, ((LONGINT)(24)));
__COPY(name, c->name, 24);
c->cmd = cmd;
c->next = m->cmds;
m->cmds = c;
@ -326,12 +326,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
SYSTEM_PTR new;
Heap_Lock();
blksz = __ASHL(__ASHR(size + 31, 4), 4);
new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz);
tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12;
new = Heap_NEWREC((SYSTEM_ADRINT)&blksz);
tag = (__VAL(LONGINT, new) + blksz) - 12;
__PUT(tag - 4, 0, LONGINT);
__PUT(tag, blksz, LONGINT);
__PUT(tag + 4, -4, LONGINT);
__PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT);
__PUT(__VAL(LONGINT, new) - 4, tag, LONGINT);
Heap_Unlock();
_o_result = new;
return _o_result;
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
__GET(tag, offset, LONGINT);
fld = q + offset;
p = Heap_FetchAddress(fld);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
__PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR);
} else {
fld = q + offset;
n = Heap_FetchAddress(fld);
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
if (!__ODD(tagbits)) {
__PUT(n - 4, tagbits + 1, LONGINT);
__PUT(q - 4, tag + 1, LONGINT);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR);
__PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR);
p = q;
q = n;
tag = tagbits;
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
static void Heap_MarkP (SYSTEM_PTR p)
{
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
Heap_Mark(__VAL(LONGINT, p));
}
static void Heap_Scan (void)
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
} else {
prev->next = n->next;
}
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
if (prev == NIL) {
n = Heap_fin;
} else {
@ -572,7 +572,7 @@ void Heap_FINALL (void)
while (Heap_fin != NIL) {
n = Heap_fin;
Heap_fin = Heap_fin->next;
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
}
}
@ -589,9 +589,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len)
}
if (n == 0) {
nofcand = 0;
sp = (LONGINT)(SYSTEM_ADRINT)&frame;
sp = (SYSTEM_ADRINT)&frame;
stack0 = Heap_PlatformMainStackFrame();
inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align;
inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align;
if (sp > stack0) {
inc = -inc;
}
@ -680,7 +680,7 @@ void Heap_GC (BOOLEAN markStack)
i22 += 23;
i23 += 24;
if ((i0 == -99 && i15 == 24)) {
Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000)));
Heap_MarkStack(32, (void*)cand, 10000);
break;
}
}
@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
{
Heap_FinNode f;
__NEW(f, Heap_FinDesc);
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
f->obj = __VAL(LONGINT, obj);
f->finalize = finalize;
f->marked = 1;
f->next = Heap_fin;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Console.h"
#include "Heap.h"
@ -83,10 +83,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
Modules_resMsg[0] = 0x00;
} else {
Modules_res = 1;
__COPY(name, Modules_importing, ((LONGINT)(20)));
__COPY(name, Modules_importing, 20);
__MOVE(" module \"", Modules_resMsg, 10);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12);
Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
}
_o_result = m;
__DEL(name);
@ -111,11 +111,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
} else {
Modules_res = 2;
__MOVE(" command \"", Modules_resMsg, 11);
__COPY(name, Modules_importing, ((LONGINT)(20)));
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20)));
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12);
__COPY(name, Modules_importing, 20);
Modules_Append((void*)Modules_resMsg, 256, mod->name, 20);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2);
Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
_o_result = NIL;
__DEL(name);
return _o_result;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h
#define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"
#include "OPS.h"
@ -271,7 +271,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len)
x->conval->intval = -1;
x->conval->intval2 = len;
x->conval->ext = OPT_NewExt();
__COPY(str, *x->conval->ext, ((LONGINT)(256)));
__COPY(str, *x->conval->ext, 256);
_o_result = x;
return _o_result;
}
@ -468,7 +468,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
} else if ((__IN(f, 0x70) && y->typ->form == 9)) {
if ((*x)->class == 7) {
k = (*x)->conval->intval;
if (k < 0 || k > (int)OPM_MaxSet) {
if (k < 0 || k > OPM_MaxSet) {
OPB_err(202);
} else if (y->class == 7) {
(*x)->conval->intval = OPB_BoolToInt(__IN(k, y->conval->setval));
@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
case 22:
if (f == 3) {
if (z->class == 7) {
z->conval->intval = (int)__CAP((CHAR)z->conval->intval);
z->conval->intval = __CAP((CHAR)z->conval->intval);
z->obj = NIL;
} else {
z = NewOp__29(op, typ, z);
@ -666,8 +666,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
z->typ = OPT_booltyp;
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -826,8 +826,8 @@ static INTEGER ConstCmp__14 (void)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37);
OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37);
OPM_LogWNum(*ConstOp__13_s->f, 0);
OPM_LogWLn();
break;
}
@ -1002,7 +1002,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
case 4:
if (__IN(f, 0x70)) {
if (yval->intval != 0) {
xval->intval = __MOD(xval->intval, yval->intval);
xval->intval = (int)__MOD(xval->intval, yval->intval);
OPB_SetIntType(x);
} else {
OPB_err(205);
@ -1105,8 +1105,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -1149,12 +1149,12 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
OPB_err(203);
r = (LONGREAL)1;
}
(*x)->conval->intval = (int)__ENTIER(r);
(*x)->conval->intval = (SYSTEM_INT32)__ENTIER(r);
OPB_SetIntType(*x);
}
}
(*x)->obj = NIL;
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) {
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) {
if ((*x)->left->typ == typ) {
*x = (*x)->left;
}
@ -1207,11 +1207,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) {
(*x)->typ = OPT_chartyp;
(*x)->conval->intval = 0;
OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*y, OPB_NewIntConst(0));
} else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) {
(*y)->typ = OPT_chartyp;
(*y)->conval->intval = 0;
OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*x, OPB_NewIntConst(0));
}
}
_o_result = ok;
@ -1475,7 +1475,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
typ = OPT_booltyp;
} else {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13);
OPM_LogWStr((CHAR*)"ELSE in Op()", 13);
OPM_LogWLn();
OPB_err(108);
typ = OPT_undftyp;
@ -1483,8 +1483,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
NewOp__39(op, typ, &z, y);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -1501,13 +1501,13 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
} else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) {
if ((*x)->class == 7) {
k = (*x)->conval->intval;
if (0 > k || k > (int)OPM_MaxSet) {
if (0 > k || k > OPM_MaxSet) {
OPB_err(202);
}
}
if (y->class == 7) {
l = y->conval->intval;
if (0 > l || l > (int)OPM_MaxSet) {
if (0 > l || l > OPM_MaxSet) {
OPB_err(202);
}
}
@ -1537,7 +1537,7 @@ void OPB_SetElem (OPT_Node *x)
OPB_err(93);
} else if ((*x)->class == 7) {
k = (*x)->conval->intval;
if ((0 <= k && k <= (int)OPM_MaxSet)) {
if ((0 <= k && k <= OPM_MaxSet)) {
(*x)->conval->setval = __SETOF(k);
} else {
OPB_err(202);
@ -1556,24 +1556,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
OPT_Struct p = NIL, q = NIL;
if (OPM_Verbose) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22);
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
OPM_LogWLn();
}
y = ynode->typ;
f = x->form;
g = y->form;
if (OPM_Verbose) {
OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10);
OPM_LogWNum(y->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"y.form = ", 10);
OPM_LogWNum(y->form, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"f = ", (LONGINT)5);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"f = ", 5);
OPM_LogWNum(f, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"g = ", (LONGINT)5);
OPM_LogWNum(g, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"g = ", 5);
OPM_LogWNum(g, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18);
OPM_LogWNum(ynode->typ->size, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18);
OPM_LogWNum(ynode->typ->size, 0);
OPM_LogWLn();
}
if (ynode->class == 8 || (ynode->class == 9 && f != 14)) {
@ -1681,8 +1681,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40);
OPM_LogWNum(f, 0);
OPM_LogWLn();
break;
}
@ -1774,14 +1774,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
x = OPB_NewBoolConst(0);
break;
case 3:
x = OPB_NewIntConst(((LONGINT)(0)));
x = OPB_NewIntConst(0);
x->typ = OPT_chartyp;
break;
case 4: case 5: case 6:
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
break;
case 9:
x = OPB_NewIntConst(((LONGINT)(0)));
x = OPB_NewIntConst(0);
x->typ = OPT_inttyp;
break;
case 7:
@ -1805,7 +1805,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
x = OPB_NewBoolConst(1);
break;
case 3:
x = OPB_NewIntConst(((LONGINT)(255)));
x = OPB_NewIntConst(255);
x->typ = OPT_chartyp;
break;
case 4: case 5: case 6:
@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
if (x->class == 8 || x->class == 9) {
OPB_err(126);
} else if (__IN(f, 0x70)) {
if (x->typ->size != (int)OPM_LIntSize) {
if (x->typ->size != OPM_LIntSize) {
OPB_Convert(&x, OPT_linttyp);
}
} else {
@ -1927,14 +1927,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
case 12:
if (x->class != 8) {
OPB_err(110);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
} else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) {
(*OPB_typSize)(x->typ);
x->typ->pvused = 1;
x = OPB_NewIntConst(x->typ->size);
} else {
OPB_err(111);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
}
break;
case 21:
@ -1952,7 +1952,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
OPB_err(126);
} else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) {
} else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) {
OPB_err(111);
x->typ = OPT_linttyp;
}
@ -1993,8 +1993,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39);
OPM_LogWNum(fctno, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39);
OPM_LogWNum(fctno, 0);
OPM_LogWLn();
break;
}
@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
if (x->class == 8 || x->class == 9) {
OPB_err(126);
} else if (__IN(f, 0x70)) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (int)OPM_MaxSet))) {
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) {
OPB_err(202);
}
p = NewOp__53(19, fctno, p, x);
@ -2063,7 +2063,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
if (!__IN(f, 0x70) || x->class != 7) {
OPB_err(69);
} else if (x->typ->size == 1) {
L = (int)x->conval->intval;
L = x->conval->intval;
typ = p->typ;
while ((L > 0 && __IN(typ->comp, 0x0c))) {
typ = typ->BaseTyp;
@ -2221,7 +2221,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
OPB_err(126);
} else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (int)OPM_PointerSize))) {
} else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) {
OPB_err(111);
x->typ = OPT_linttyp;
}
@ -2321,7 +2321,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno)
}
} else {
if (((fctno == 13 || fctno == 14) && parno == 1)) {
OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1))));
OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1));
p->subcl = fctno;
p->right->typ = p->left->typ;
} else if ((fctno == 17 && parno == 1)) {
@ -2343,7 +2343,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno)
} else if (fctno == 32) {
if (parno == 1) {
x = NIL;
OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0))));
OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0));
x->conval = OPT_NewConst();
x->conval->intval = OPM_errpos;
OPB_Construct(15, &p, x);
@ -2578,7 +2578,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y)
} else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) {
y->typ = OPT_chartyp;
y->conval->intval = 0;
OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*x, OPB_NewIntConst(0));
}
if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) {
subcl = 18;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h
#define OPB__h

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h
#define OPC__h
@ -37,6 +37,7 @@ import void OPC_Increment (BOOLEAN decrement);
import void OPC_Indent (INTEGER count);
import void OPC_Init (void);
import void OPC_InitTDesc (OPT_Struct typ);
import void OPC_IntLiteral (LONGINT n, LONGINT size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim);
import LONGINT OPC_NofPtrs (OPT_Struct typ);
import void OPC_SetInclude (BOOLEAN exclude);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"
@ -154,20 +154,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
case 'B':
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_IntSize = (int)s[__X(i, s__len)] - 48;
OPM_IntSize = s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_PointerSize = (int)s[__X(i, s__len)] - 48;
OPM_PointerSize = s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_Alignment = (int)s[__X(i, s__len)] - 48;
OPM_Alignment = s[__X(i, s__len)] - 48;
}
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
Files_SetSearchPath((CHAR*)"", (LONGINT)1);
Files_SetSearchPath((CHAR*)"", 1);
break;
case 'F':
*opt = *opt ^ 0x020000;
@ -182,10 +182,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
*opt = *opt ^ 0x040000;
break;
default:
OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19);
OPM_LogWStr((CHAR*)" warning: option ", 19);
OPM_LogW('-');
OPM_LogW(s[__X(i, s__len)]);
OPM_LogWStr((CHAR*)" ignored", (LONGINT)9);
OPM_LogWStr((CHAR*)" ignored", 9);
OPM_LogWLn();
break;
}
@ -199,71 +199,71 @@ BOOLEAN OPM_OpenPar (void)
CHAR s[256];
if (Platform_ArgCount == 1) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27);
OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41)));
OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27);
OPM_LogWStr(Configuration_versionLong, 41);
OPM_LogW('.');
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84);
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7);
OPM_LogWStr((CHAR*)"Usage:", 7);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr((CHAR*)"voc", (LONGINT)4);
OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr((CHAR*)"voc", 4);
OPM_LogWStr((CHAR*)" options {files {options}}.", 28);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33);
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36);
OPM_LogWStr((CHAR*)" m - generate code for main module", 36);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63);
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31);
OPM_LogWStr((CHAR*)" s - generate new symbol file", 31);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43);
OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25);
OPM_LogWStr((CHAR*)" r - check value ranges", 25);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35);
OPM_LogWStr((CHAR*)" x - turn off array indices check", 35);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80);
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48);
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101);
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67);
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24);
OPM_LogWStr((CHAR*)" c - don't call linker", 24);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29);
OPM_LogWStr((CHAR*)" f - don't use color output", 29);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57);
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21);
OPM_LogWStr((CHAR*)" V - verbose output", 21);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48);
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56);
OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39);
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39);
OPM_LogWLn();
_o_result = 0;
return _o_result;
} else {
OPM_S = 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
OPM_glbopt = 0xe9;
while (s[0] == '-') {
OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt);
OPM_ScanOptions((void*)s, 256, &OPM_glbopt);
OPM_S += 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
}
_o_result = 1;
return _o_result;
@ -276,12 +276,12 @@ void OPM_InitOptions (void)
CHAR s[256];
OPM_opt = OPM_glbopt;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
while (s[0] == '-') {
OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt);
OPM_ScanOptions((void*)s, 256, &OPM_opt);
OPM_S += 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
}
OPM_dontAsm = __IN(13, OPM_opt);
OPM_dontLink = __IN(14, OPM_opt);
@ -307,19 +307,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len)
return;
}
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
__NEW(T, Texts_TextDesc);
Texts_Open(T, s, ((LONGINT)(256)));
OPM_LogWStr(s, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
Texts_Open(T, s, 256);
OPM_LogWStr(s, 256);
OPM_LogWStr((CHAR*)" ", 3);
__COPY(s, mname, mname__len);
__COPY(s, OPM_SourceFileName, ((LONGINT)(256)));
__COPY(s, OPM_SourceFileName, 256);
if (T->len == 0) {
OPM_LogWStr(s, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" not found.", (LONGINT)12);
OPM_LogWStr(s, 256);
OPM_LogWStr((CHAR*)" not found.", 12);
OPM_LogWLn();
} else {
Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0)));
Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0);
*done = 1;
}
OPM_S += 1;
@ -378,25 +378,25 @@ static void OPM_LogErrMsg (INTEGER n)
CHAR buf[1024];
if (n >= 0) {
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"31m", (LONGINT)4);
vt100_SetAttr((CHAR*)"31m", 4);
}
OPM_LogWStr((CHAR*)" err ", (LONGINT)7);
OPM_LogWStr((CHAR*)" err ", 7);
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
} else {
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"35m", (LONGINT)4);
vt100_SetAttr((CHAR*)"35m", 4);
}
OPM_LogWStr((CHAR*)" warning ", (LONGINT)11);
OPM_LogWStr((CHAR*)" warning ", 11);
n = -n;
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
}
OPM_LogWNum(n, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128)));
OPM_LogWNum(n, 1);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
}
static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos)
@ -438,37 +438,37 @@ static void OPM_ShowLine (LONGINT pos)
CHAR line[1023];
INTEGER i;
CHAR ch;
f = Files_Old(OPM_SourceFileName, ((LONGINT)(256)));
f = Files_Old(OPM_SourceFileName, 256);
OPM_FindLine(f, &r, Files_Rider__typ, pos);
i = 0;
Files_Read(&r, Files_Rider__typ, (void*)&ch);
while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) {
line[__X(i, ((LONGINT)(1023)))] = ch;
line[__X(i, 1023)] = ch;
i += 1;
Files_Read(&r, Files_Rider__typ, (void*)&ch);
}
line[__X(i, ((LONGINT)(1023)))] = 0x00;
line[__X(i, 1023)] = 0x00;
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)": ", (LONGINT)3);
OPM_LogWStr(line, ((LONGINT)(1023)));
OPM_LogWNum(OPM_ErrorLineNumber, 4);
OPM_LogWStr((CHAR*)": ", 3);
OPM_LogWStr(line, 1023);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)7);
OPM_LogWStr((CHAR*)" ", 7);
if (pos >= OPM_ErrorLineLimitPos) {
pos = OPM_ErrorLineLimitPos - 1;
}
i = (int)(pos - OPM_ErrorLineStartPos);
i = (pos - OPM_ErrorLineStartPos);
while (i > 0) {
OPM_LogW(' ');
i -= 1;
}
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"32m", (LONGINT)4);
vt100_SetAttr((CHAR*)"32m", 4);
}
OPM_LogW('^');
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
Files_Close(f);
}
@ -484,30 +484,30 @@ void OPM_Mark (INTEGER n, LONGINT pos)
OPM_lasterrpos = pos;
OPM_ShowLine(pos);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr((CHAR*)" ", 3);
if (n < 249) {
OPM_LogWStr((CHAR*)" pos", (LONGINT)6);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pos", 6);
OPM_LogWNum(pos, 6);
OPM_LogErrMsg(n);
} else if (n == 255) {
OPM_LogWStr((CHAR*)"pos", (LONGINT)4);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pc ", (LONGINT)6);
OPM_LogWNum(OPM_breakpc, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)"pos", 4);
OPM_LogWNum(pos, 6);
OPM_LogWStr((CHAR*)" pc ", 6);
OPM_LogWNum(OPM_breakpc, 1);
} else if (n == 254) {
OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13);
OPM_LogWStr((CHAR*)"pc not found", 13);
} else {
OPM_LogWStr(OPM_objname, ((LONGINT)(64)));
OPM_LogWStr(OPM_objname, 64);
if (n == 253) {
OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31);
OPM_LogWStr((CHAR*)" is new, compile with option e", 31);
} else if (n == 252) {
OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37);
OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37);
} else if (n == 251) {
OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57);
OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57);
} else if (n == 250) {
OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45);
OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45);
} else if (n == 249) {
OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49);
OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49);
}
}
}
@ -515,8 +515,8 @@ void OPM_Mark (INTEGER n, LONGINT pos)
if (pos >= 0) {
OPM_ShowLine(pos);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" pos", (LONGINT)6);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pos", 6);
OPM_LogWNum(pos, 6);
}
OPM_LogErrMsg(n);
if (pos < 0) {
@ -532,27 +532,27 @@ void OPM_err (INTEGER n)
void OPM_FPrint (LONGINT *fp, LONGINT val)
{
*fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT);
*fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT);
}
void OPM_FPrintSet (LONGINT *fp, SET set)
{
OPM_FPrint(&*fp, (LONGINT)set);
OPM_FPrint(&*fp, __VAL(LONGINT, set));
}
void OPM_FPrintReal (LONGINT *fp, REAL real)
{
INTEGER i;
LONGINT l;
__GET((LONGINT)(SYSTEM_ADRINT)&real, l, LONGINT);
__GET((SYSTEM_ADRINT)&real, l, LONGINT);
OPM_FPrint(&*fp, l);
}
void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr)
{
LONGINT l, h;
__GET((LONGINT)(SYSTEM_ADRINT)&lr, l, LONGINT);
__GET((LONGINT)(SYSTEM_ADRINT)&lr + 4, h, LONGINT);
__GET((SYSTEM_ADRINT)&lr, l, LONGINT);
__GET((SYSTEM_ADRINT)&lr + 4, h, LONGINT);
OPM_FPrint(&*fp, l);
OPM_FPrint(&*fp, h);
}
@ -563,19 +563,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG
if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) {
Texts_Scan(&*S, S__typ);
if ((*S).class == 3) {
*size = (int)(*S).i;
*size = (*S).i;
Texts_Scan(&*S, S__typ);
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
if ((*S).class == 3) {
*align = (int)(*S).i;
*align = (*S).i;
Texts_Scan(&*S, S__typ);
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
__DEL(name);
}
@ -604,40 +604,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j)
static void OPM_VerboseListSizes (void)
{
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29);
OPM_LogWStr((CHAR*)"Type Size Alignement", 29);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14);
OPM_LogWNum(OPM_CharSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"CHAR ", 14);
OPM_LogWNum(OPM_CharSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14);
OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"BOOLEAN ", 14);
OPM_LogWNum(OPM_BoolSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14);
OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"SHORTINT ", 14);
OPM_LogWNum(OPM_SIntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14);
OPM_LogWNum(OPM_IntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"INTEGER ", 14);
OPM_LogWNum(OPM_IntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14);
OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"LONGINT ", 14);
OPM_LogWNum(OPM_LIntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", (LONGINT)14);
OPM_LogWNum(OPM_SetSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"SET ", 14);
OPM_LogWNum(OPM_SetSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14);
OPM_LogWNum(OPM_RealSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"REAL ", 14);
OPM_LogWNum(OPM_RealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14);
OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"LONGREAL ", 14);
OPM_LogWNum(OPM_LRealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14);
OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"PTR ", 14);
OPM_LogWNum(OPM_PointerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14);
OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"PROC ", 14);
OPM_LogWNum(OPM_ProcSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14);
OPM_LogWNum(OPM_RecSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"RECORD ", 14);
OPM_LogWNum(OPM_RecSize, 4);
OPM_LogWLn();
OPM_LogWLn();
}
@ -720,11 +720,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done)
{
CHAR ch;
OPM_FileName fileName;
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32)));
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5);
OPM_oldSFile = Files_Old(fileName, 32);
*done = OPM_oldSFile != NIL;
if (*done) {
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0)));
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch);
if (ch != 0xf7) {
OPM_err(-306);
@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i)
void OPM_SymWSet (SET s)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s);
Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s));
}
void OPM_SymWReal (REAL r)
@ -780,10 +780,10 @@ void OPM_DeleteNewSym (void)
void OPM_NewSym (CHAR *modName, LONGINT modName__len)
{
OPM_FileName fileName;
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
OPM_newSFile = Files_New(fileName, ((LONGINT)(32)));
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5);
OPM_newSFile = Files_New(fileName, 32);
if (OPM_newSFile != NIL) {
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0)));
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
} else {
OPM_err(153);
@ -792,7 +792,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len)
void OPM_Write (CHAR ch)
{
Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch);
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch);
}
void OPM_WriteString (CHAR *s, LONGINT s__len)
@ -802,7 +802,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len)
while (s[__X(i, s__len)] != 0x00) {
i += 1;
}
Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i);
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
@ -812,27 +812,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
while (s[__X(i, s__len)] != 0x00) {
i += 1;
}
Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i);
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteHex (LONGINT i)
{
CHAR s[3];
INTEGER digit;
digit = __ASHR((int)i, 4);
digit = __ASHR(i, 4);
if (digit < 10) {
s[0] = (CHAR)(48 + digit);
} else {
s[0] = (CHAR)(87 + digit);
}
digit = __MASK((int)i, -16);
digit = __MASK(i, -16);
if (digit < 10) {
s[1] = (CHAR)(48 + digit);
} else {
s[1] = (CHAR)(87 + digit);
}
s[2] = 0x00;
OPM_WriteString(s, ((LONGINT)(3)));
OPM_WriteString(s, 3);
}
void OPM_WriteInt (LONGINT i)
@ -842,24 +842,24 @@ void OPM_WriteInt (LONGINT i)
if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) {
OPM_Write('(');
OPM_WriteInt(i + 1);
OPM_WriteString((CHAR*)"-1)", (LONGINT)4);
OPM_WriteString((CHAR*)"-1)", 4);
} else {
i1 = __ABS(i);
s[0] = (CHAR)(__MOD(i1, 10) + 48);
s[0] = (CHAR)((int)__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k = 1;
while (i1 > 0) {
s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48);
s[__X(k, 20)] = (CHAR)((int)__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k += 1;
}
if (i < 0) {
s[__X(k, ((LONGINT)(20)))] = '-';
s[__X(k, 20)] = '-';
k += 1;
}
while (k > 0) {
k -= 1;
OPM_Write(s[__X(k, ((LONGINT)(20)))]);
OPM_Write(s[__X(k, 20)]);
}
}
}
@ -872,13 +872,13 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
CHAR s[32];
CHAR ch;
INTEGER i;
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int)__ENTIER(r)))) {
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((SYSTEM_INT32)__ENTIER(r)))) {
if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7);
OPM_WriteString((CHAR*)"(REAL)", 7);
} else {
OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11);
OPM_WriteString((CHAR*)"(LONGREAL)", 11);
}
OPM_WriteInt((int)__ENTIER(r));
OPM_WriteInt((SYSTEM_INT32)__ENTIER(r));
} else {
Texts_OpenWriter(&W, Texts_Writer__typ);
if (suffx == 'f') {
@ -887,33 +887,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23);
}
__NEW(T, Texts_TextDesc);
Texts_Open(T, (CHAR*)"", (LONGINT)1);
Texts_Open(T, (CHAR*)"", 1);
Texts_Append(T, W.buf);
Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0)));
Texts_OpenReader(&R, Texts_Reader__typ, T, 0);
i = 0;
Texts_Read(&R, Texts_Reader__typ, &ch);
while (ch != 0x00) {
s[__X(i, ((LONGINT)(32)))] = ch;
s[__X(i, 32)] = ch;
i += 1;
Texts_Read(&R, Texts_Reader__typ, &ch);
}
s[__X(i, ((LONGINT)(32)))] = 0x00;
s[__X(i, 32)] = 0x00;
i = 0;
ch = s[0];
while ((ch != 'D' && ch != 0x00)) {
i += 1;
ch = s[__X(i, ((LONGINT)(32)))];
ch = s[__X(i, 32)];
}
if (ch == 'D') {
s[__X(i, ((LONGINT)(32)))] = 'e';
s[__X(i, 32)] = 'e';
}
OPM_WriteString(s, ((LONGINT)(32)));
OPM_WriteString(s, 32);
}
}
void OPM_WriteLn (void)
{
Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a);
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a);
}
static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
@ -921,11 +921,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
Files_Rider R1;
CHAR buffer[4096];
if (F != NIL) {
Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0)));
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096)));
Files_Set(&R1, Files_Rider__typ, F, 0);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096);
while (4096 - R1.res > 0) {
Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096)));
Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096);
}
}
}
@ -933,24 +933,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len)
{
CHAR FName[32];
__COPY(moduleName, OPM_modName, ((LONGINT)(32)));
OPM_HFile = Files_New((CHAR*)"", (LONGINT)1);
__COPY(moduleName, OPM_modName, 32);
OPM_HFile = Files_New((CHAR*)"", 1);
if (OPM_HFile != NIL) {
Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0)));
Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0);
} else {
OPM_err(153);
}
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3);
OPM_BFile = Files_New(FName, ((LONGINT)(32)));
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3);
OPM_BFile = Files_New(FName, 32);
if (OPM_BFile != NIL) {
Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0)));
Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0);
} else {
OPM_err(153);
}
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3);
OPM_HIFile = Files_New(FName, ((LONGINT)(32)));
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3);
OPM_HIFile = Files_New(FName, 32);
if (OPM_HIFile != NIL) {
Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0)));
Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0);
} else {
OPM_err(153);
}
@ -961,9 +961,9 @@ void OPM_CloseFiles (void)
CHAR FName[32];
INTEGER res;
if (OPM_noerr) {
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0)));
OPM_LogWStr((CHAR*)" chars.", (LONGINT)8);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0);
OPM_LogWStr((CHAR*)" chars.", 8);
}
if (OPM_noerr) {
if (__STRCMP(OPM_modName, "SYSTEM") == 0) {
@ -975,10 +975,10 @@ void OPM_CloseFiles (void)
Files_Register(OPM_HIFile);
Files_Register(OPM_BFile);
} else {
OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3);
Files_Delete(FName, ((LONGINT)(32)), &res);
OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
Files_Delete(FName, ((LONGINT)(32)), &res);
OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3);
Files_Delete(FName, 32, &res);
OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5);
Files_Delete(FName, 32, &res);
Files_Register(OPM_BFile);
}
}
@ -987,11 +987,11 @@ void OPM_CloseFiles (void)
OPM_HIFile = NIL;
OPM_newSFile = NIL;
OPM_oldSFile = NIL;
Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0);
Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0);
}
static void EnumPtrs(void (*P)(void*))
@ -1032,15 +1032,15 @@ export void *OPM__init(void)
/* BEGIN */
Texts_OpenWriter(&OPM_W, Texts_Writer__typ);
OPM_MODULES[0] = 0x00;
Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024);
__MOVE(".", OPM_OBERON, 2);
Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024)));
Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024);
Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024);
OPM_CharSize = 1;
OPM_BoolSize = 1;
OPM_SIntSize = 1;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h
#define OPM__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPB.h"
#include "OPM.h"
@ -58,7 +58,7 @@ static void OPP_err (INTEGER n)
static void OPP_CheckSym (INTEGER s)
{
if ((int)OPP_sym == s) {
if (OPP_sym == s) {
OPS_Get(&OPP_sym);
} else {
OPM_err(s);
@ -104,7 +104,7 @@ static void OPP_ConstExpression (OPT_Node *x)
OPP_Expression(&*x);
if ((*x)->class != 7) {
OPP_err(50);
*x = OPB_NewIntConst(((LONGINT)(1)));
*x = OPB_NewIntConst(1);
}
}
@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
OPP_err(51);
sf = 0;
}
*sysflag = (int)sf;
*sysflag = sf;
OPP_CheckSym(23);
} else {
*sysflag = default_;
@ -308,13 +308,13 @@ static void OPP_PointerType (OPT_Struct *typ)
OPT_Find(&id);
if (id == NIL) {
if (OPP_nofFwdPtr < 64) {
OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ;
OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ;
OPP_nofFwdPtr += 1;
} else {
OPP_err(224);
}
(*typ)->link = OPT_NewObj();
__COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256)));
__COPY(OPS_name, (*typ)->link->name, 256);
(*typ)->BaseTyp = OPT_undftyp;
OPS_Get(&OPP_sym);
} else {
@ -518,7 +518,7 @@ static void OPP_selector (OPT_Node *x)
} else if (OPP_sym == 18) {
OPS_Get(&OPP_sym);
if (OPP_sym == 38) {
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPS_Get(&OPP_sym);
if ((*x)->typ != NIL) {
if ((*x)->typ->form == 13) {
@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x)
OPT_Node y = NIL;
SHORTINT m;
INTEGER n;
m = (int)(*x)->obj->adr;
m = (*x)->obj->adr;
n = 0;
if (OPP_sym == 30) {
OPS_Get(&OPP_sym);
@ -742,8 +742,8 @@ static void OPP_Factor (OPT_Node *x)
*x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44);
OPM_LogWNum(OPS_numtyp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44);
OPM_LogWNum(OPS_numtyp, 0);
OPM_LogWLn();
break;
}
@ -776,7 +776,7 @@ static void OPP_Factor (OPT_Node *x)
*x = NIL;
}
if (*x == NIL) {
*x = OPB_NewIntConst(((LONGINT)(1)));
*x = OPB_NewIntConst(1);
(*x)->typ = OPT_undftyp;
}
}
@ -858,7 +858,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St
} else {
*mode = 1;
}
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPP_CheckSym(38);
OPP_CheckSym(20);
if (OPP_sym == 38) {
@ -932,8 +932,8 @@ static void GetCode__19 (void)
(*ProcedureDeclaration__16_s->proc)->conval->ext = ext;
n = 0;
if (OPP_sym == 37) {
while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) {
(*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))];
while (OPS_str[__X(n, 256)] != 0x00) {
(*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)];
n += 1;
}
(*ext)[0] = (CHAR)n;
@ -949,7 +949,7 @@ static void GetCode__19 (void)
n = 1;
}
OPS_Get(&OPP_sym);
(*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c;
(*ext)[__X(n, 256)] = (CHAR)c;
}
if (OPP_sym == 19) {
OPS_Get(&OPP_sym);
@ -1023,7 +1023,7 @@ static void TProcDecl__23 (void)
}
OPP_Receiver(&objMode, objName, &objTyp, &recTyp);
if (OPP_sym == 38) {
__COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256)));
__COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256);
OPP_CheckMark(&*ProcedureDeclaration__16_s->vis);
OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd);
OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc);
@ -1122,7 +1122,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
TProcDecl__23();
} else if (OPP_sym == 38) {
OPT_Find(&fwd);
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPP_CheckMark(&vis);
if ((vis != 0 && mode == 6)) {
mode = 7;
@ -1183,14 +1183,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) {
OPP_err(60);
}
} else if ((int)LabelTyp->form != f) {
} else if (LabelTyp->form != f) {
OPP_err(60);
}
if (OPP_sym == 21) {
OPS_Get(&OPP_sym);
OPP_ConstExpression(&y);
yval = y->conval->intval;
if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) {
if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) {
OPP_err(60);
}
if (yval < xval) {
@ -1207,17 +1207,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
if (i == 0) {
break;
}
if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) {
if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) {
if (tab[__X(i - 1, 128)].low <= yval) {
if (tab[__X(i - 1, 128)].high >= xval) {
OPP_err(62);
}
break;
}
tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))];
tab[__X(i, 128)] = tab[__X(i - 1, 128)];
i -= 1;
}
tab[__X(i, ((LONGINT)(128)))].low = xval;
tab[__X(i, ((LONGINT)(128)))].high = yval;
tab[__X(i, 128)].low = xval;
tab[__X(i, 128)].high = yval;
*n += 1;
} else {
OPP_err(213);
@ -1276,7 +1276,7 @@ static void CasePart__31 (OPT_Node *x)
}
if (n > 0) {
low = tab[0].low;
high = tab[__X(n - 1, ((LONGINT)(128)))].high;
high = tab[__X(n - 1, 128)].high;
if (high - low > 512) {
OPP_err(209);
}
@ -1479,7 +1479,7 @@ static void OPP_StatSeq (OPT_Node *stat)
OPS_Get(&OPP_sym);
OPP_ConstExpression(&z);
} else {
z = OPB_NewIntConst(((LONGINT)(1)));
z = OPB_NewIntConst(1);
}
pos = OPM_errpos;
x = OPB_NewLeaf(id);
@ -1642,7 +1642,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPP_ConstExpression(&x);
} else {
OPP_err(9);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
}
obj->mode = 3;
obj->typ = x->typ;
@ -1673,7 +1673,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
if (__IN(obj->typ->comp, 0x1c)) {
i = 0;
while (i < OPP_nofFwdPtr) {
typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))];
typ = OPP_FwdPtr[__X(i, 64)];
i += 1;
if (__STRCMP(typ->link->name, obj->name) == 0) {
typ->BaseTyp = obj->typ;
@ -1735,10 +1735,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
}
i = 0;
while (i < OPP_nofFwdPtr) {
if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) {
if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) {
OPP_err(128);
}
OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL;
OPP_FwdPtr[__X(i, 64)] = NIL;
i += 1;
}
OPT_topScope->adr = OPM_errpos;
@ -1784,28 +1784,28 @@ void OPP_Module (OPT_Node *prog, SET opt)
OPS_Get(&OPP_sym);
} else {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46);
OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15);
OPM_LogWNum(OPP_sym, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" sym: ", 15);
OPM_LogWNum(OPP_sym, 1);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15);
OPM_LogWStr(OPS_name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" OPS.name: ", 15);
OPM_LogWStr(OPS_name, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15);
OPM_LogWStr(OPS_str, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" OPS.str: ", 15);
OPM_LogWStr(OPS_str, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15);
OPM_LogWNum(OPS_numtyp, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15);
OPM_LogWNum(OPS_numtyp, 1);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15);
OPM_LogWNum(OPS_intval, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" OPS.intval: ", 15);
OPM_LogWNum(OPS_intval, 1);
OPM_LogWLn();
OPP_err(16);
}
if (OPP_sym == 38) {
OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11);
OPM_LogWStr(OPS_name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)"compiling ", 11);
OPM_LogWStr(OPS_name, 256);
OPM_LogW('.');
OPT_Init(OPS_name, opt);
OPS_Get(&OPP_sym);
@ -1814,13 +1814,13 @@ void OPP_Module (OPT_Node *prog, SET opt)
OPS_Get(&OPP_sym);
for (;;) {
if (OPP_sym == 38) {
__COPY(OPS_name, aliasName, ((LONGINT)(256)));
__COPY(aliasName, impName, ((LONGINT)(256)));
__COPY(OPS_name, aliasName, 256);
__COPY(aliasName, impName, 256);
OPS_Get(&OPP_sym);
if (OPP_sym == 34) {
OPS_Get(&OPP_sym);
if (OPP_sym == 38) {
__COPY(OPS_name, impName, ((LONGINT)(256)));
__COPY(OPS_name, impName, 256);
OPS_Get(&OPP_sym);
} else {
OPP_err(38);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"
@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym)
if (OPS_intval == 2) {
*sym = 35;
OPS_numtyp = 1;
OPS_intval = (int)OPS_str[0];
OPS_intval = OPS_str[0];
} else {
*sym = 37;
}
@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex)
{
INTEGER _o_result;
if (ch <= '9') {
_o_result = (int)ch - 48;
_o_result = ch - 48;
return _o_result;
} else if (hex) {
_o_result = ((int)ch - 65) + 10;
_o_result = (ch - 65) + 10;
return _o_result;
} else {
OPS_err(2);
@ -173,7 +173,7 @@ static void OPS_Number (void)
OPS_numtyp = 1;
if (n <= 2) {
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -188,7 +188,7 @@ static void OPS_Number (void)
OPS_intval = -1;
}
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -199,8 +199,8 @@ static void OPS_Number (void)
while (i < n) {
d = Ord__7(dig[i], 0);
i += 1;
if (OPS_intval <= __DIV(2147483647 - (int)d, 10)) {
OPS_intval = OPS_intval * 10 + (int)d;
if (OPS_intval <= __DIV(2147483647 - d, 10)) {
OPS_intval = OPS_intval * 10 + d;
} else {
OPS_err(203);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "OPM.h"
#include "OPS.h"
@ -162,10 +162,10 @@ OPT_Struct OPT_IntType (LONGINT size)
OPT_Struct _o_result;
INTEGER i;
i = 1;
while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) {
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
i += 1;
}
_o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))];
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
}
@ -177,11 +177,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
__ASSERT(dir == 1 || dir == -1, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
i = 0;
while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) {
while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) {
i += 1;
}
__ASSERT(i < 19, 0);
_o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))];
_o_result = OPT_IntTypes[__X(i + dir, 20)];
return _o_result;
}
@ -234,7 +234,7 @@ OPT_ConstExt OPT_NewExt (void)
{
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256);
ext = __NEWARR(NIL, 1, 1, 1, 0, 256);
_o_result = ext;
return _o_result;
}
@ -265,8 +265,8 @@ void OPT_Init (OPS_Name name, SET opt)
OPT_topScope = OPT_universe;
OPT_OpenScope(0, NIL);
OPT_SYSimported = 0;
__COPY(name, OPT_SelfName, ((LONGINT)(256)));
__COPY(name, OPT_topScope->name, ((LONGINT)(256)));
__COPY(name, OPT_SelfName, 256);
__COPY(name, OPT_topScope->name, 256);
OPT_GlbMod[0] = OPT_topScope;
OPT_nofGmod = 1;
OPT_newsf = __IN(4, opt);
@ -281,13 +281,13 @@ void OPT_Close (void)
OPT_CloseScope();
i = 0;
while (i < 64) {
OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL;
OPT_GlbMod[__X(i, 64)] = NIL;
i += 1;
}
i = 16;
while (i < 255) {
OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL;
OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL;
OPT_impCtxt.ref[__X(i, 255)] = NIL;
OPT_impCtxt.old[__X(i, 255)] = NIL;
i += 1;
}
}
@ -398,7 +398,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
}
ob1->left = NIL;
ob1->right = NIL;
__COPY(name, ob1->name, ((LONGINT)(256)));
__COPY(name, ob1->name, 256);
mnolev = OPT_topScope->mnolev;
ob1->mnolev = mnolev;
break;
@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len)
i = 0;
do {
ch = name[__X(i, name__len)];
OPM_FPrint(&*fp, (int)ch);
OPM_FPrint(&*fp, ch);
i += 1;
} while (!(ch == 0x00));
}
@ -423,32 +423,32 @@ static void OPT_DebugStruct (OPT_Struct btyp)
{
OPM_LogWLn();
if (btyp == NIL) {
OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12);
OPM_LogWStr((CHAR*)"btyp is nil", 12);
OPM_LogWLn();
}
OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23);
OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23);
OPM_LogWStr(btyp->strobj->name, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14);
OPM_LogWNum(btyp->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.form = ", 14);
OPM_LogWNum(btyp->form, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14);
OPM_LogWNum(btyp->comp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.comp = ", 14);
OPM_LogWNum(btyp->comp, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13);
OPM_LogWNum(btyp->mno, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.mno = ", 13);
OPM_LogWNum(btyp->mno, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16);
OPM_LogWNum(btyp->extlev, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16);
OPM_LogWNum(btyp->extlev, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14);
OPM_LogWNum(btyp->size, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.size = ", 14);
OPM_LogWNum(btyp->size, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15);
OPM_LogWNum(btyp->align, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.align = ", 15);
OPM_LogWNum(btyp->align, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16);
OPM_LogWNum(btyp->txtpos, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16);
OPM_LogWNum(btyp->txtpos, 0);
OPM_LogWLn();
}
@ -480,8 +480,8 @@ void OPT_IdFPrint (OPT_Struct typ)
btyp = typ->BaseTyp;
strobj = typ->strobj;
if ((strobj != NIL && strobj->name[0] != 0x00)) {
OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256)));
OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256)));
OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256);
OPT_FPrintName(&idfp, (void*)strobj->name, 256);
}
if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) {
OPT_IdFPrint(btyp);
@ -532,7 +532,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr)
}
}
} else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) {
OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13)));
OPM_FPrint(&*FPrintStr__12_s->pvfp, 13);
OPM_FPrint(&*FPrintStr__12_s->pvfp, adr);
OPT_nofhdfld += 1;
}
@ -543,7 +543,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible)
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis);
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256)));
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256);
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr);
OPT_FPrintStr(fld->typ);
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp);
@ -561,10 +561,10 @@ static void FPrintTProcs__17 (OPT_Object obj)
FPrintTProcs__17(obj->left);
if (obj->mode == 13) {
if (obj->vis != 0) {
OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13)));
OPM_FPrint(&*FPrintStr__12_s->pbfp, 13);
OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16));
OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link);
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256)));
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256);
}
}
FPrintTProcs__17(obj->right);
@ -618,7 +618,7 @@ void OPT_FPrintStr (OPT_Struct typ)
OPM_FPrint(&pvfp, typ->align);
OPM_FPrint(&pvfp, typ->n);
OPT_nofhdfld = 0;
FPrintFlds__13(typ->link, ((LONGINT)(0)), 1);
FPrintFlds__13(typ->link, 0, 1);
if (OPT_nofhdfld > 2048) {
OPM_Mark(225, typ->txtpos);
}
@ -663,7 +663,7 @@ void OPT_FPrintObj (OPT_Object obj)
OPM_FPrintLReal(&fprint, obj->conval->realval);
break;
case 10:
OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256)));
OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256);
break;
case 11:
break;
@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj)
} else if (obj->mode == 9) {
OPT_FPrintSign(&fprint, obj->typ, obj->link);
ext = obj->conval->ext;
m = (int)(*ext)[0];
m = (*ext)[0];
f = 1;
OPM_FPrint(&fprint, m);
while (f <= m) {
OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]);
OPM_FPrint(&fprint, (*ext)[__X(f, 256)]);
f += 1;
}
} else if (obj->mode == 5) {
@ -700,22 +700,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode)
INTEGER i, j;
CHAR ch;
if (obj->mnolev != 0) {
__COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64)));
__COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64);
i = 0;
while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) {
while (OPM_objname[__X(i, 64)] != 0x00) {
i += 1;
}
OPM_objname[__X(i, ((LONGINT)(64)))] = '.';
OPM_objname[__X(i, 64)] = '.';
j = 0;
i += 1;
do {
ch = obj->name[__X(j, ((LONGINT)(256)))];
OPM_objname[__X(i, ((LONGINT)(64)))] = ch;
ch = obj->name[__X(j, 256)];
OPM_objname[__X(i, 64)] = ch;
j += 1;
i += 1;
} while (!(ch == 0x00));
} else {
__COPY(obj->name, OPM_objname, ((LONGINT)(64)));
__COPY(obj->name, OPM_objname, 64);
}
if (errcode == 249) {
if (OPM_noerr) {
@ -808,12 +808,12 @@ static void OPT_InMod (SHORTINT *mno)
*mno = OPT_impCtxt.glbmno[0];
} else {
if (mn == 16) {
OPT_InName((void*)name, ((LONGINT)(256)));
OPT_InName((void*)name, 256);
if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) {
OPT_err(154);
}
i = 0;
while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) {
while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) {
i += 1;
}
if (i < OPT_nofGmod) {
@ -821,20 +821,20 @@ static void OPT_InMod (SHORTINT *mno)
} else {
head = OPT_NewObj();
head->mode = 12;
__COPY(name, head->name, ((LONGINT)(256)));
__COPY(name, head->name, 256);
*mno = OPT_nofGmod;
head->mnolev = -*mno;
if (OPT_nofGmod < 64) {
OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head;
OPT_GlbMod[__X(*mno, 64)] = head;
OPT_nofGmod += 1;
} else {
OPT_err(227);
}
}
OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno;
OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno;
OPT_impCtxt.nofm += 1;
} else {
*mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))];
*mno = OPT_impCtxt.glbmno[__X(-mn, 64)];
}
}
}
@ -848,7 +848,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
switch (f) {
case 1: case 3: case 2:
OPM_SymRCh(&ch);
conval->intval = (int)ch;
conval->intval = ch;
break;
case 4: case 5: case 6:
conval->intval = OPM_SymRInt();
@ -871,7 +871,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
i = 0;
do {
OPM_SymRCh(&ch);
(*ext)[__X(i, ((LONGINT)(256)))] = ch;
(*ext)[__X(i, 256)] = ch;
i += 1;
} while (!(ch == 0x00));
conval->intval2 = i;
@ -881,8 +881,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
conval->intval = 0;
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37);
OPM_LogWNum(f, 0);
OPM_LogWLn();
break;
}
@ -910,7 +910,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par)
}
OPT_InStruct(&new->typ);
new->adr = OPM_SymRInt();
OPT_InName((void*)new->name, ((LONGINT)(256)));
OPT_InName((void*)new->name, 256);
last = new;
tag = OPM_SymRInt();
}
@ -931,7 +931,7 @@ static OPT_Object OPT_InFld (void)
obj->vis = 1;
}
OPT_InStruct(&obj->typ);
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
obj->adr = OPM_SymRInt();
} else {
obj->mode = 4;
@ -962,7 +962,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
obj->conval->intval = -1;
OPT_InSign(mno, &obj->typ, &obj->link);
obj->vis = 1;
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
obj->adr = __ASHL(OPM_SymRInt(), 16);
} else {
obj->mode = 13;
@ -983,7 +983,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag)
_o_result = OPT_IntType(OPM_SymRInt());
return _o_result;
} else {
_o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))];
_o_result = OPT_impCtxt.ref[__X(tag, 255)];
return _o_result;
}
__RETCHK;
@ -1007,23 +1007,23 @@ static void OPT_InStruct (OPT_Struct *typ)
OPT_impCtxt.minr = ref;
}
OPT_InMod(&mno);
OPT_InName((void*)name, ((LONGINT)(256)));
OPT_InName((void*)name, 256);
obj = OPT_NewObj();
if (name[0] == 0x00) {
if (OPT_impCtxt.self) {
old = NIL;
} else {
__MOVE("@", obj->name, 2);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
obj->name[0] = 0x00;
}
*typ = OPT_NewStr(0, 1);
} else {
__COPY(name, obj->name, ((LONGINT)(256)));
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
__COPY(name, obj->name, 256);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
if (old != NIL) {
OPT_FPrintObj(old);
OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp;
OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp;
if (OPT_impCtxt.self) {
*typ = OPT_NewStr(0, 1);
} else {
@ -1037,8 +1037,8 @@ static void OPT_InStruct (OPT_Struct *typ)
*typ = OPT_NewStr(0, 1);
}
}
OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ;
OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old;
OPT_impCtxt.ref[__X(ref, 255)] = *typ;
OPT_impCtxt.old[__X(ref, 255)] = old;
(*typ)->ref = ref + 255;
(*typ)->mno = mno;
(*typ)->allocated = 1;
@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ)
obj->vis = 0;
tag = OPM_SymRInt();
if (tag == 35) {
(*typ)->sysflag = (int)OPM_SymRInt();
(*typ)->sysflag = OPM_SymRInt();
tag = OPM_SymRInt();
}
switch (tag) {
@ -1117,8 +1117,8 @@ static void OPT_InStruct (OPT_Struct *typ)
OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35);
OPM_LogWNum(tag, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35);
OPM_LogWNum(tag, 0);
OPM_LogWLn();
break;
}
@ -1130,7 +1130,7 @@ static void OPT_InStruct (OPT_Struct *typ)
if (obj->name[0] != 0x00) {
OPT_FPrintObj(obj);
}
old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))];
old = OPT_impCtxt.old[__X(ref, 255)];
if (old != NIL) {
t->strobj = old;
if (OPT_impCtxt.self) {
@ -1138,13 +1138,13 @@ static void OPT_InStruct (OPT_Struct *typ)
if (old->history != 5) {
if (old->fprint != obj->fprint) {
old->history = 2;
} else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
} else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 3;
}
}
} else if (old->fprint != obj->fprint) {
old->history = 2;
} else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
} else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 3;
} else if (old->vis == 0) {
old->history = 1;
@ -1152,7 +1152,7 @@ static void OPT_InStruct (OPT_Struct *typ)
old->history = 0;
}
} else {
if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 5;
}
if (old->fprint != obj->fprint) {
@ -1211,17 +1211,17 @@ static OPT_Object OPT_InObj (SHORTINT mno)
obj->mode = 9;
ext = OPT_NewExt();
obj->conval->ext = ext;
s = (int)OPM_SymRInt();
s = OPM_SymRInt();
(*ext)[0] = (CHAR)s;
i = 1;
while (i <= s) {
OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]);
OPM_SymRCh(&(*ext)[__X(i, 256)]);
i += 1;
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32);
OPM_LogWNum(tag, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
OPM_LogWNum(tag, 0);
OPM_LogWLn();
break;
}
@ -1235,14 +1235,14 @@ static OPT_Object OPT_InObj (SHORTINT mno)
}
OPT_InStruct(&obj->typ);
}
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
}
OPT_FPrintObj(obj);
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
}
if (tag != 19) {
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
if (OPT_impCtxt.self) {
if (old != NIL) {
if (old->vis == 0) {
@ -1293,7 +1293,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
OPT_impCtxt.nofm = 0;
OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0;
OPT_impCtxt.reffp = 0;
OPM_OldSym((void*)name, ((LONGINT)(256)), &*done);
OPM_OldSym((void*)name, 256, &*done);
if (*done) {
OPT_InMod(&mno);
OPT_impCtxt.nextTag = OPM_SymRInt();
@ -1303,8 +1303,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
}
OPT_Insert(aliasName, &obj);
obj->mode = 11;
obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right;
OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj;
obj->scope = OPT_GlbMod[__X(mno, 64)]->right;
OPT_GlbMod[__X(mno, 64)]->link = obj;
obj->mnolev = -mno;
obj->typ = OPT_notyp;
OPM_CloseOldSym();
@ -1332,13 +1332,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len)
static void OPT_OutMod (INTEGER mno)
{
if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) {
OPM_SymWInt(((LONGINT)(16)));
OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm;
if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) {
OPM_SymWInt(16);
OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm;
OPT_expCtxt.nofm += 1;
OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256)));
OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256);
} else {
OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]);
OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]);
}
}
@ -1368,7 +1368,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr)
}
}
} else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) {
OPM_SymWInt(((LONGINT)(27)));
OPM_SymWInt(27);
OPM_SymWInt(adr);
OPT_nofhdfld += 1;
}
@ -1379,12 +1379,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible)
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
if (fld->vis == 2) {
OPM_SymWInt(((LONGINT)(26)));
OPM_SymWInt(26);
} else {
OPM_SymWInt(((LONGINT)(25)));
OPM_SymWInt(25);
}
OPT_OutStr(fld->typ);
OPT_OutName((void*)fld->name, ((LONGINT)(256)));
OPT_OutName((void*)fld->name, 256);
OPM_SymWInt(fld->adr);
} else {
OPT_OutHdFld(fld->typ, fld, fld->adr + adr);
@ -1398,16 +1398,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par)
OPT_OutStr(result);
while (par != NIL) {
if (par->mode == 1) {
OPM_SymWInt(((LONGINT)(23)));
OPM_SymWInt(23);
} else {
OPM_SymWInt(((LONGINT)(24)));
OPM_SymWInt(24);
}
OPT_OutStr(par->typ);
OPM_SymWInt(par->adr);
OPT_OutName((void*)par->name, ((LONGINT)(256)));
OPT_OutName((void*)par->name, 256);
par = par->link;
}
OPM_SymWInt(((LONGINT)(18)));
OPM_SymWInt(18);
}
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj)
@ -1420,12 +1420,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj)
}
if (obj->vis != 0) {
if (obj->vis != 0) {
OPM_SymWInt(((LONGINT)(29)));
OPM_SymWInt(29);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
OPM_SymWInt(__ASHR(obj->adr, 16));
} else {
OPM_SymWInt(((LONGINT)(30)));
OPM_SymWInt(30);
OPM_SymWInt(__ASHR(obj->adr, 16));
}
}
@ -1443,7 +1443,7 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWInt(typ->size);
}
} else {
OPM_SymWInt(((LONGINT)(34)));
OPM_SymWInt(34);
typ->ref = OPT_expCtxt.ref;
OPT_expCtxt.ref += 1;
if (OPT_expCtxt.ref >= 255) {
@ -1452,7 +1452,7 @@ static void OPT_OutStr (OPT_Struct typ)
OPT_OutMod(typ->mno);
strobj = typ->strobj;
if ((strobj != NIL && strobj->name[0] != 0x00)) {
OPT_OutName((void*)strobj->name, ((LONGINT)(256)));
OPT_OutName((void*)strobj->name, 256);
switch (strobj->history) {
case 2:
OPT_FPrintErr(strobj, 252);
@ -1470,31 +1470,31 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWCh(0x00);
}
if (typ->sysflag != 0) {
OPM_SymWInt(((LONGINT)(35)));
OPM_SymWInt(35);
OPM_SymWInt(typ->sysflag);
}
switch (typ->form) {
case 13:
OPM_SymWInt(((LONGINT)(36)));
OPM_SymWInt(36);
OPT_OutStr(typ->BaseTyp);
break;
case 14:
OPM_SymWInt(((LONGINT)(40)));
OPM_SymWInt(40);
OPT_OutSign(typ->BaseTyp, typ->link);
break;
case 15:
switch (typ->comp) {
case 2:
OPM_SymWInt(((LONGINT)(37)));
OPM_SymWInt(37);
OPT_OutStr(typ->BaseTyp);
OPM_SymWInt(typ->n);
break;
case 3:
OPM_SymWInt(((LONGINT)(38)));
OPM_SymWInt(38);
OPT_OutStr(typ->BaseTyp);
break;
case 4:
OPM_SymWInt(((LONGINT)(39)));
OPM_SymWInt(39);
if (typ->BaseTyp == NIL) {
OPT_OutStr(OPT_notyp);
} else {
@ -1504,23 +1504,23 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWInt(typ->align);
OPM_SymWInt(typ->n);
OPT_nofhdfld = 0;
OPT_OutFlds(typ->link, ((LONGINT)(0)), 1);
OPT_OutFlds(typ->link, 0, 1);
if (OPT_nofhdfld > 2048) {
OPM_Mark(223, typ->txtpos);
}
OPT_OutTProcs(typ, typ->link);
OPM_SymWInt(((LONGINT)(18)));
OPM_SymWInt(18);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39);
OPM_LogWNum(typ->comp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39);
OPM_LogWNum(typ->comp, 0);
OPM_LogWLn();
break;
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39);
OPM_LogWNum(typ->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39);
OPM_LogWNum(typ->form, 0);
OPM_LogWLn();
break;
}
@ -1552,7 +1552,7 @@ static void OPT_OutConstant (OPT_Object obj)
OPM_SymWLReal(obj->conval->realval);
break;
case 10:
OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256)));
OPT_OutName((void*)*obj->conval->ext, 256);
break;
case 11:
break;
@ -1585,64 +1585,64 @@ static void OPT_OutObj (OPT_Object obj)
OPT_FPrintErr(obj, 251);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42);
OPM_LogWNum(obj->history, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42);
OPM_LogWNum(obj->history, 0);
OPM_LogWLn();
break;
}
switch (obj->mode) {
case 3:
OPT_OutConstant(obj);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 5:
if (obj->typ->strobj == obj) {
OPM_SymWInt(((LONGINT)(19)));
OPM_SymWInt(19);
OPT_OutStr(obj->typ);
} else {
OPM_SymWInt(((LONGINT)(20)));
OPM_SymWInt(20);
OPT_OutStr(obj->typ);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
}
break;
case 1:
if (obj->vis == 2) {
OPM_SymWInt(((LONGINT)(22)));
OPM_SymWInt(22);
} else {
OPM_SymWInt(((LONGINT)(21)));
OPM_SymWInt(21);
}
OPT_OutStr(obj->typ);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) {
OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref);
}
break;
case 7:
OPM_SymWInt(((LONGINT)(31)));
OPM_SymWInt(31);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 10:
OPM_SymWInt(((LONGINT)(32)));
OPM_SymWInt(32);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 9:
OPM_SymWInt(((LONGINT)(33)));
OPM_SymWInt(33);
OPT_OutSign(obj->typ, obj->link);
ext = obj->conval->ext;
j = (int)(*ext)[0];
j = (*ext)[0];
i = 1;
OPM_SymWInt(j);
while (i <= j) {
OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]);
OPM_SymWCh((*ext)[__X(i, 256)]);
i += 1;
}
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38);
OPM_LogWNum(obj->mode, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38);
OPM_LogWNum(obj->mode, 0);
OPM_LogWLn();
break;
}
@ -1663,17 +1663,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
OPT_Import((CHAR*)"@self", OPT_SelfName, &done);
OPT_nofGmod = nofmod;
if (OPM_noerr) {
OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256)));
OPM_NewSym((void*)OPT_SelfName, 256);
if (OPM_noerr) {
OPM_SymWInt(((LONGINT)(16)));
OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256)));
OPM_SymWInt(16);
OPT_OutName((void*)OPT_SelfName, 256);
OPT_expCtxt.reffp = 0;
OPT_expCtxt.ref = 16;
OPT_expCtxt.nofm = 1;
OPT_expCtxt.locmno[0] = 0;
i = 1;
while (i < 64) {
OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1;
OPT_expCtxt.locmno[__X(i, 64)] = -1;
i += 1;
}
OPT_OutObj(OPT_topScope->right);
@ -1874,11 +1874,11 @@ export void *OPT__init(void)
OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp);
OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp);
OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0)));
OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1)));
OPT_EnterBoolConst((CHAR*)"FALSE", 0);
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
OPT_EnterProc((CHAR*)"HALT", 0);
OPT_EnterProc((CHAR*)"NEW", 1);
OPT_EnterProc((CHAR*)"ABS", 2);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h
#define OPT__h

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPV__h
#define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
typedef
@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
Platform_ArgVecPtr av = NIL;
Platform_MainStackFrame = argvadr;
Platform_ArgCount = argc;
av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr;
av = __VAL(Platform_ArgVecPtr, argvadr);
Platform_ArgVector = (*av)[0];
Platform_HaltCode = -128;
Platform_HeapInitHeap();
@ -262,8 +262,8 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
{
Platform_ArgVec av = NIL;
if (n < Platform_ArgCount) {
av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector;
__COPY(*(*av)[__X(n, ((LONGINT)(1024)))], val, val__len);
av = __VAL(Platform_ArgVec, Platform_ArgVector);
__COPY(*(*av)[__X(n, 1024)], val, val__len);
}
}
@ -272,17 +272,17 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val)
CHAR s[64];
LONGINT k, d, i;
s[0] = 0x00;
Platform_GetArg(n, (void*)s, ((LONGINT)(64)));
Platform_GetArg(n, (void*)s, 64);
i = 0;
if (s[0] == '-') {
i = 1;
}
k = 0;
d = (int)s[__X(i, ((LONGINT)(64)))] - 48;
d = s[__X(i, 64)] - 48;
while ((d >= 0 && d <= 9)) {
k = k * 10 + d;
i += 1;
d = (int)s[__X(i, ((LONGINT)(64)))] - 48;
d = s[__X(i, 64)] - 48;
}
if (s[0] == '-') {
k = -k;
@ -300,10 +300,10 @@ INTEGER Platform_ArgPos (CHAR *s, LONGINT s__len)
CHAR arg[256];
__DUP(s, s__len, CHAR);
i = 0;
Platform_GetArg(i, (void*)arg, ((LONGINT)(256)));
Platform_GetArg(i, (void*)arg, 256);
while ((i < Platform_ArgCount && __STRCMP(s, arg) != 0)) {
i += 1;
Platform_GetArg(i, (void*)arg, ((LONGINT)(256)));
Platform_GetArg(i, (void*)arg, 256);
}
_o_result = i;
__DEL(s);
@ -327,7 +327,7 @@ void Platform_SetBadInstructionHandler (Platform_SignalHandler handler)
static void Platform_YMDHMStoClock (LONGINT ye, LONGINT mo, LONGINT da, LONGINT ho, LONGINT mi, LONGINT se, LONGINT *t, LONGINT *d)
{
*d = (__ASHL(__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da;
*d = (__ASHL((int)__MOD(ye, 100), 9) + __ASHL(mo + 1, 5)) + da;
*t = (__ASHL(ho, 12) + __ASHL(mi, 6)) + se;
}
@ -350,8 +350,8 @@ LONGINT Platform_Time (void)
LONGINT _o_result;
LONGINT ms;
Platform_gettimeval();
ms = __DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
_o_result = __MOD(ms - Platform_TimeStart, 2147483647);
ms = (int)__DIVF(Platform_tvusec(), 1000) + Platform_tvsec() * 1000;
_o_result = (int)__MOD(ms - Platform_TimeStart, 2147483647);
return _o_result;
}
@ -359,7 +359,7 @@ void Platform_Delay (LONGINT ms)
{
LONGINT s, ns;
s = __DIV(ms, 1000);
ns = __MOD(ms, 1000) * 1000000;
ns = (int)__MOD(ms, 1000) * 1000000;
Platform_nanosleep(s, ns);
}
@ -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 _o_result;
*n = Platform_readfile(h, (LONGINT)(SYSTEM_ADRINT)b, b__len);
*n = Platform_readfile(h, (SYSTEM_ADRINT)b, b__len);
if (*n < 0) {
*n = 0;
_o_result = Platform_err();
@ -613,7 +613,7 @@ INTEGER Platform_Chdir (CHAR *n, LONGINT n__len)
INTEGER _o_result;
INTEGER r;
r = Platform_chdir(n, n__len);
Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256)));
Platform_getcwd((void*)Platform_CWD, 256);
if (r < 0) {
_o_result = Platform_err();
return _o_result;
@ -658,7 +658,7 @@ static void Platform_errposint (LONGINT l)
if (l > 10) {
Platform_errposint(__DIV(l, 10));
}
Platform_errch((CHAR)(48 + __MOD(l, 10)));
Platform_errch((CHAR)(48 + (int)__MOD(l, 10)));
}
static void Platform_errint (LONGINT l)
@ -674,52 +674,52 @@ static void Platform_DisplayHaltCode (LONGINT code)
{
switch (code) {
case -1:
Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19);
Platform_errstring((CHAR*)"Assertion failure.", 19);
break;
case -2:
Platform_errstring((CHAR*)"Index out of range.", (LONGINT)20);
Platform_errstring((CHAR*)"Index out of range.", 20);
break;
case -3:
Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", (LONGINT)49);
Platform_errstring((CHAR*)"Reached end of function without reaching RETURN.", 49);
break;
case -4:
Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", (LONGINT)47);
Platform_errstring((CHAR*)"CASE statement: no matching label and no ELSE.", 47);
break;
case -5:
Platform_errstring((CHAR*)"Type guard failed.", (LONGINT)19);
Platform_errstring((CHAR*)"Type guard failed.", 19);
break;
case -6:
Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", (LONGINT)49);
Platform_errstring((CHAR*)"Implicit type guard in record assignment failed.", 49);
break;
case -7:
Platform_errstring((CHAR*)"Invalid case in WITH statement.", (LONGINT)32);
Platform_errstring((CHAR*)"Invalid case in WITH statement.", 32);
break;
case -8:
Platform_errstring((CHAR*)"Value out of range.", (LONGINT)20);
Platform_errstring((CHAR*)"Value out of range.", 20);
break;
case -9:
Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", (LONGINT)60);
Platform_errstring((CHAR*)"Heap interrupted while locked, but lockdepth = 0 at unlock.", 60);
break;
case -10:
Platform_errstring((CHAR*)"NIL access.", (LONGINT)12);
Platform_errstring((CHAR*)"NIL access.", 12);
break;
case -11:
Platform_errstring((CHAR*)"Alignment error.", (LONGINT)17);
Platform_errstring((CHAR*)"Alignment error.", 17);
break;
case -12:
Platform_errstring((CHAR*)"Divide by zero.", (LONGINT)16);
Platform_errstring((CHAR*)"Divide by zero.", 16);
break;
case -13:
Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", (LONGINT)31);
Platform_errstring((CHAR*)"Arithmetic overflow/underflow.", 31);
break;
case -14:
Platform_errstring((CHAR*)"Invalid function argument.", (LONGINT)27);
Platform_errstring((CHAR*)"Invalid function argument.", 27);
break;
case -15:
Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", (LONGINT)52);
Platform_errstring((CHAR*)"Internal error, e.g. Type descriptor size mismatch.", 52);
break;
case -20:
Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", (LONGINT)60);
Platform_errstring((CHAR*)"Too many, or negative number of, elements in dynamic array.", 60);
break;
default:
break;
@ -733,9 +733,9 @@ void Platform_Halt (LONGINT code)
if (Platform_HaltHandler != NIL) {
(*Platform_HaltHandler)(code);
}
Platform_errstring((CHAR*)"Terminated by Halt(", (LONGINT)20);
Platform_errstring((CHAR*)"Terminated by Halt(", 20);
Platform_errint(code);
Platform_errstring((CHAR*)"). ", (LONGINT)4);
Platform_errstring((CHAR*)"). ", 4);
if (code < 0) {
Platform_DisplayHaltCode(code);
}
@ -746,11 +746,11 @@ void Platform_Halt (LONGINT code)
void Platform_AssertFail (LONGINT code)
{
INTEGER e;
Platform_errstring((CHAR*)"Assertion failure.", (LONGINT)19);
Platform_errstring((CHAR*)"Assertion failure.", 19);
if (code != 0) {
Platform_errstring((CHAR*)" ASSERT code ", (LONGINT)14);
Platform_errstring((CHAR*)" ASSERT code ", 14);
Platform_errint(code);
Platform_errstring((CHAR*)".", (LONGINT)2);
Platform_errstring((CHAR*)".", 2);
}
Platform_errln();
Platform_exit(__VAL(INTEGER, code));
@ -765,7 +765,7 @@ static void Platform_TestLittleEndian (void)
{
INTEGER i;
i = 1;
__GET((LONGINT)(SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN);
__GET((SYSTEM_ADRINT)&i, Platform_LittleEndian, BOOLEAN);
}
__TDESC(Platform_FileIdentity, 1, 0) = {__TDFLDS("FileIdentity", 12), {-4}};
@ -782,7 +782,7 @@ export void *Platform__init(void)
Platform_TimeStart = 0;
Platform_TimeStart = Platform_Time();
Platform_CWD[0] = 0x00;
Platform_getcwd((void*)Platform_CWD, ((LONGINT)(256)));
Platform_getcwd((void*)Platform_CWD, 256);
Platform_PID = Platform_getpid();
Platform_SeekSet = Platform_seekset();
Platform_SeekCur = Platform_seekcur();

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Platform__h
#define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
@ -58,7 +58,7 @@ INTEGER Reals_Expo (REAL x)
{
INTEGER _o_result;
INTEGER i;
__GET((LONGINT)(SYSTEM_ADRINT)&x + 2, i, INTEGER);
__GET((SYSTEM_ADRINT)&x + 2, i, INTEGER);
_o_result = __MASK(__ASHR(i, 7), -256);
return _o_result;
}
@ -66,17 +66,17 @@ INTEGER Reals_Expo (REAL x)
void Reals_SetExpo (REAL *x, INTEGER ex)
{
CHAR c;
__GET((LONGINT)(SYSTEM_ADRINT)x + 3, c, CHAR);
__PUT((LONGINT)(SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__GET((LONGINT)(SYSTEM_ADRINT)x + 2, c, CHAR);
__PUT((LONGINT)(SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
__GET((SYSTEM_ADRINT)x + 3, c, CHAR);
__PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR);
__GET((SYSTEM_ADRINT)x + 2, c, CHAR);
__PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR);
}
INTEGER Reals_ExpoL (LONGREAL x)
{
INTEGER _o_result;
INTEGER i;
__GET((LONGINT)(SYSTEM_ADRINT)&x + 6, i, INTEGER);
__GET((SYSTEM_ADRINT)&x + 6, i, INTEGER);
_o_result = __MASK(__ASHR(i, 4), -2048);
return _o_result;
}
@ -89,21 +89,21 @@ void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len)
}
k = 0;
if (n > 9) {
i = (int)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
j = (int)__ENTIER(x - i * (LONGREAL)1000000000);
i = (SYSTEM_INT32)__ENTIER(x / (LONGREAL)(LONGREAL)1000000000);
j = (SYSTEM_INT32)__ENTIER(x - i * (LONGREAL)1000000000);
if (j < 0) {
j = 0;
}
while (k < 9) {
d[__X(k, d__len)] = (CHAR)(__MOD(j, 10) + 48);
d[__X(k, d__len)] = (CHAR)((int)__MOD(j, 10) + 48);
j = __DIV(j, 10);
k += 1;
}
} else {
i = (int)__ENTIER(x);
i = (SYSTEM_INT32)__ENTIER(x);
}
while (k < (int)n) {
d[__X(k, d__len)] = (CHAR)(__MOD(i, 10) + 48);
while (k < n) {
d[__X(k, d__len)] = (CHAR)((int)__MOD(i, 10) + 48);
i = __DIV(i, 10);
k += 1;
}
@ -134,22 +134,22 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO
CHAR by;
i = 0;
l = b__len;
while ((int)i < l) {
while (i < l) {
by = __VAL(CHAR, b[__X(i, b__len)]);
d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4));
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16));
d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4));
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16));
i += 1;
}
}
void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len)
{
Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1)));
Reals_BytesToHex((void*)&y, 4, (void*)d, d__len * 1);
}
void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len)
{
Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1)));
Reals_BytesToHex((void*)&x, 8, (void*)d, d__len * 1);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Reals__h
#define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
@ -21,7 +21,7 @@ INTEGER Strings_Length (CHAR *s, LONGINT s__len)
INTEGER i;
__DUP(s, s__len, CHAR);
i = 0;
while (((int)i < s__len && s[__X(i, s__len)] != 0x00)) {
while ((i < s__len && s[__X(i, s__len)] != 0x00)) {
i += 1;
}
_o_result = i;
@ -36,11 +36,11 @@ void Strings_Append (CHAR *extra, LONGINT extra__len, CHAR *dest, LONGINT dest__
n1 = Strings_Length(dest, dest__len);
n2 = Strings_Length(extra, extra__len);
i = 0;
while ((i < n2 && (int)(i + n1) < dest__len)) {
while ((i < n2 && (i + n1) < dest__len)) {
dest[__X(i + n1, dest__len)] = extra[__X(i, extra__len)];
i += 1;
}
if ((int)(i + n1) < dest__len) {
if ((i + n1) < dest__len) {
dest[__X(i + n1, dest__len)] = 0x00;
}
__DEL(extra);
@ -59,10 +59,10 @@ void Strings_Insert (CHAR *source, LONGINT source__len, INTEGER pos, CHAR *dest,
Strings_Append(dest, dest__len, (void*)source, source__len);
return;
}
if ((int)(pos + n2) < dest__len) {
if ((pos + n2) < dest__len) {
i = n1;
while (i >= pos) {
if ((int)(i + n2) < dest__len) {
if ((i + n2) < dest__len) {
dest[__X(i + n2, dest__len)] = dest[__X(i, dest__len)];
}
i -= 1;
@ -91,7 +91,7 @@ void Strings_Delete (CHAR *s, LONGINT s__len, INTEGER pos, INTEGER n)
s[__X(i - n, s__len)] = s[__X(i, s__len)];
i += 1;
}
if ((int)(i - n) < s__len) {
if ((i - n) < s__len) {
s[__X(i - n, s__len)] = 0x00;
}
} else {
@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n,
INTEGER len, destLen, i;
__DUP(source, source__len, CHAR);
len = Strings_Length(source, source__len);
destLen = (int)dest__len - 1;
destLen = dest__len - 1;
if (pos < 0) {
pos = 0;
}
@ -121,7 +121,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n,
return;
}
i = 0;
while (((((int)(pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) {
while (((((pos + i) <= source__len && source[__X(pos + i, source__len)] != 0x00)) && i < n)) {
if (i < destLen) {
dest[__X(i, dest__len)] = source[__X(pos + i, source__len)];
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Strings__h
#define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Files.h"
#include "Modules.h"
@ -231,7 +231,7 @@ static Texts_FontsFont Texts_FontsThis (CHAR *name, LONGINT name__len)
Texts_FontsFont _o_result;
Texts_FontsFont F = NIL;
__NEW(F, Texts_FontDesc);
__COPY(name, F->name, ((LONGINT)(32)));
__COPY(name, F->name, 32);
_o_result = F;
return _o_result;
}
@ -398,15 +398,15 @@ static void Texts_HandleAlien (Texts_Elem E, Texts_ElemMsg *msg, LONGINT *msg__t
e->file = ((Texts_Alien)E)->file;
e->org = ((Texts_Alien)E)->org;
e->span = ((Texts_Alien)E)->span;
__COPY(((Texts_Alien)E)->mod, e->mod, ((LONGINT)(32)));
__COPY(((Texts_Alien)E)->proc, e->proc, ((LONGINT)(32)));
__COPY(((Texts_Alien)E)->mod, e->mod, 32);
__COPY(((Texts_Alien)E)->proc, e->proc, 32);
(*msg__).e = (Texts_Elem)e;
} else __WITHCHK;
} else if (__IS(msg__typ, Texts_IdentifyMsg, 1)) {
if (__IS(msg__typ, Texts_IdentifyMsg, 1)) {
Texts_IdentifyMsg *msg__ = (void*)msg;
__COPY(((Texts_Alien)E)->mod, (*msg__).mod, ((LONGINT)(32)));
__COPY(((Texts_Alien)E)->proc, (*msg__).proc, ((LONGINT)(32)));
__COPY(((Texts_Alien)E)->mod, (*msg__).mod, 32);
__COPY(((Texts_Alien)E)->proc, (*msg__).proc, 32);
(*msg__).mod[31] = 0x01;
} else __WITHCHK;
} else if (__IS(msg__typ, Texts_FileMsg, 1)) {
@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void)
}
}
while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) {
*Scan__31_s->e = (*Scan__31_s->e * 10 + (int)*Scan__31_s->ch) - 48;
*Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48;
Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch);
}
}
@ -780,21 +780,21 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
}
if ((('A' <= __CAP(ch) && __CAP(ch) <= 'Z') || ch == '/') || ch == '.') {
do {
(*S).s[__X(i, ((LONGINT)(64)))] = ch;
(*S).s[__X(i, 64)] = ch;
i += 1;
Texts_Read((void*)&*S, S__typ, &ch);
} while (!((((__CAP(ch) > 'Z' && ch != '_') || ('A' > __CAP(ch) && ch > '9')) || ((('0' > ch && ch != '.')) && ch != '/')) || i == 63));
(*S).s[__X(i, ((LONGINT)(64)))] = 0x00;
(*S).s[__X(i, 64)] = 0x00;
(*S).len = i;
(*S).class = 1;
} else if (ch == '"') {
Texts_Read((void*)&*S, S__typ, &ch);
while ((((ch != '"' && ch >= ' ')) && i != 63)) {
(*S).s[__X(i, ((LONGINT)(64)))] = ch;
(*S).s[__X(i, 64)] = ch;
i += 1;
Texts_Read((void*)&*S, S__typ, &ch);
}
(*S).s[__X(i, ((LONGINT)(64)))] = 0x00;
(*S).s[__X(i, 64)] = 0x00;
(*S).len = i + 1;
Texts_Read((void*)&*S, S__typ, &ch);
(*S).class = 2;
@ -809,7 +809,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
hex = 0;
j = 0;
for (;;) {
d[__X(i, ((LONGINT)(32)))] = ch;
d[__X(i, 32)] = ch;
i += 1;
Texts_Read((void*)&*S, S__typ, &ch);
if (ch < '0') {
@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
if ('9' < ch) {
if (('A' <= ch && ch <= 'F')) {
hex = 1;
ch = (CHAR)((int)ch - 7);
ch = (CHAR)(ch - 7);
} else if (('a' <= ch && ch <= 'f')) {
hex = 1;
ch = (CHAR)((int)ch - 39);
ch = (CHAR)(ch - 39);
} else {
break;
}
@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
if (i - j > 8) {
j = i - 8;
}
k = (int)d[__X(j, ((LONGINT)(32)))] - 48;
k = d[__X(j, 32)] - 48;
j += 1;
if ((i - j == 7 && k >= 8)) {
k -= 16;
}
while (j < i) {
k = __ASHL(k, 4) + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48);
k = __ASHL(k, 4) + (d[__X(j, 32)] - 48);
j += 1;
}
if (neg) {
@ -851,7 +851,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
Texts_Read((void*)&*S, S__typ, &ch);
h = i;
while (('0' <= ch && ch <= '9')) {
d[__X(i, ((LONGINT)(32)))] = ch;
d[__X(i, 32)] = ch;
i += 1;
Texts_Read((void*)&*S, S__typ, &ch);
}
@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
y = (LONGREAL)0;
g = (LONGREAL)1;
do {
y = y * (LONGREAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48);
y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48);
j += 1;
} while (!(j == h));
while (j < i) {
g = g / (LONGREAL)(LONGREAL)10;
y = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * g + y;
y = (d[__X(j, 32)] - 48) * g + y;
j += 1;
}
ReadScaleFactor__32();
@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
x = (REAL)0;
f = (REAL)1;
do {
x = x * (REAL)10 + ((int)d[__X(j, ((LONGINT)(32)))] - 48);
x = x * (REAL)10 + (d[__X(j, 32)] - 48);
j += 1;
} while (!(j == h));
while (j < i) {
f = f / (REAL)(REAL)10;
x = ((int)d[__X(j, ((LONGINT)(32)))] - 48) * f + x;
x = (d[__X(j, 32)] - 48) * f + x;
j += 1;
}
if (ch == 'E') {
@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
(*S).class = 3;
k = 0;
do {
k = k * 10 + (int)((int)d[__X(j, ((LONGINT)(32)))] - 48);
k = k * 10 + (d[__X(j, 32)] - 48);
j += 1;
} while (!(j == i));
if (neg) {
@ -964,8 +964,8 @@ void Texts_OpenWriter (Texts_Writer *W, LONGINT *W__typ)
(*W).fnt = Texts_FontsDefault;
(*W).col = 15;
(*W).voff = 0;
(*W).file = Files_New((CHAR*)"", (LONGINT)1);
Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, ((LONGINT)(0)));
(*W).file = Files_New((CHAR*)"", 1);
Files_Set(&(*W).rider, Files_Rider__typ, (*W).file, 0);
}
void Texts_SetFont (Texts_Writer *W, LONGINT *W__typ, Texts_FontsFont fnt)
@ -1053,7 +1053,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n)
i = 0;
if (x < 0) {
if (x == (-2147483647-1)) {
Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", (LONGINT)13);
Texts_WriteString(&*W, W__typ, (CHAR*)" -2147483648", 13);
return;
} else {
n -= 1;
@ -1063,11 +1063,11 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n)
x0 = x;
}
do {
a[__X(i, ((LONGINT)(22)))] = (CHAR)(__MOD(x0, 10) + 48);
a[__X(i, 22)] = (CHAR)((int)__MOD(x0, 10) + 48);
x0 = __DIV(x0, 10);
i += 1;
} while (!(x0 == 0));
while (n > (int)i) {
while (n > i) {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
}
@ -1076,7 +1076,7 @@ void Texts_WriteInt (Texts_Writer *W, LONGINT *W__typ, LONGINT x, LONGINT n)
}
do {
i -= 1;
Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(22)))]);
Texts_Write(&*W, W__typ, a[__X(i, 22)]);
} while (!(i == 0));
}
@ -1090,16 +1090,16 @@ void Texts_WriteHex (Texts_Writer *W, LONGINT *W__typ, LONGINT x)
do {
y = __MASK(x, -16);
if (y < 10) {
a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 48);
a[__X(i, 20)] = (CHAR)(y + 48);
} else {
a[__X(i, ((LONGINT)(20)))] = (CHAR)(y + 55);
a[__X(i, 20)] = (CHAR)(y + 55);
}
x = __ASHR(x, 4);
i += 1;
} while (!(i == 8));
do {
i -= 1;
Texts_Write(&*W, W__typ, a[__X(i, ((LONGINT)(20)))]);
Texts_Write(&*W, W__typ, a[__X(i, 20)]);
} while (!(i == 0));
}
@ -1110,13 +1110,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n)
CHAR d[9];
e = Reals_Expo(x);
if (e == 0) {
Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4);
Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4);
do {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
} while (!(n <= 3));
} else if (e == 255) {
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5);
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5);
while (n > 4) {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
@ -1153,13 +1153,13 @@ void Texts_WriteReal (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n)
x = x * 1.0000000e-001;
e += 1;
}
Reals_Convert(x, n, (void*)d, ((LONGINT)(9)));
Reals_Convert(x, n, (void*)d, 9);
n -= 1;
Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]);
Texts_Write(&*W, W__typ, d[__X(n, 9)]);
Texts_Write(&*W, W__typ, '.');
do {
n -= 1;
Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(9)))]);
Texts_Write(&*W, W__typ, d[__X(n, 9)]);
} while (!(n == 0));
Texts_Write(&*W, W__typ, 'E');
if (e < 0) {
@ -1196,7 +1196,7 @@ static void dig__54 (INTEGER n)
{
while (n > 0) {
*WriteRealFix__53_s->i -= 1;
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, ((LONGINT)(9)))]);
Texts_Write(&*WriteRealFix__53_s->W, WriteRealFix__53_s->W__typ, (*WriteRealFix__53_s->d)[__X(*WriteRealFix__53_s->i, 9)]);
n -= 1;
}
}
@ -1222,7 +1222,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN
Texts_Write(&*W, W__typ, '0');
seq__56(' ', k + 1);
} else if (e == 255) {
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5);
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5);
seq__56(' ', n - 4);
} else {
e = __ASHR((e - 127) * 77, 8);
@ -1254,7 +1254,7 @@ void Texts_WriteRealFix (Texts_Writer *W, LONGINT *W__typ, REAL x, INTEGER n, IN
}
e += 1;
i = k + e;
Reals_Convert(x, i, (void*)d, ((LONGINT)(9)));
Reals_Convert(x, i, (void*)d, 9);
if (e > 0) {
seq__56(' ', ((n - e) - k) - 2);
Texts_Write(&*W, W__typ, sign);
@ -1277,10 +1277,10 @@ void Texts_WriteRealHex (Texts_Writer *W, LONGINT *W__typ, REAL x)
{
INTEGER i;
CHAR d[8];
Reals_ConvertH(x, (void*)d, ((LONGINT)(8)));
Reals_ConvertH(x, (void*)d, 8);
i = 0;
do {
Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(8)))]);
Texts_Write(&*W, W__typ, d[__X(i, 8)]);
i += 1;
} while (!(i == 8));
}
@ -1292,13 +1292,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
CHAR d[16];
e = Reals_ExpoL(x);
if (e == 0) {
Texts_WriteString(&*W, W__typ, (CHAR*)" 0", (LONGINT)4);
Texts_WriteString(&*W, W__typ, (CHAR*)" 0", 4);
do {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
} while (!(n <= 3));
} else if (e == 2047) {
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", (LONGINT)5);
Texts_WriteString(&*W, W__typ, (CHAR*)" NaN", 5);
while (n > 4) {
Texts_Write(&*W, W__typ, ' ');
n -= 1;
@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
} else {
Texts_Write(&*W, W__typ, ' ');
}
e = (int)__ASHR((int)(e - 1023) * 77, 8);
e = __ASHR((e - 1023) * 77, 8);
if (e >= 0) {
x = x / (LONGREAL)Reals_TenL(e);
} else {
@ -1335,13 +1335,13 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
x = 1.00000000000000e-001 * x;
e += 1;
}
Reals_ConvertL(x, n, (void*)d, ((LONGINT)(16)));
Reals_ConvertL(x, n, (void*)d, 16);
n -= 1;
Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]);
Texts_Write(&*W, W__typ, d[__X(n, 16)]);
Texts_Write(&*W, W__typ, '.');
do {
n -= 1;
Texts_Write(&*W, W__typ, d[__X(n, ((LONGINT)(16)))]);
Texts_Write(&*W, W__typ, d[__X(n, 16)]);
} while (!(n == 0));
Texts_Write(&*W, W__typ, 'D');
if (e < 0) {
@ -1361,10 +1361,10 @@ void Texts_WriteLongRealHex (Texts_Writer *W, LONGINT *W__typ, LONGREAL x)
{
INTEGER i;
CHAR d[16];
Reals_ConvertHL(x, (void*)d, ((LONGINT)(16)));
Reals_ConvertHL(x, (void*)d, 16);
i = 0;
do {
Texts_Write(&*W, W__typ, d[__X(i, ((LONGINT)(16)))]);
Texts_Write(&*W, W__typ, d[__X(i, 16)]);
i += 1;
} while (!(i == 16));
}
@ -1381,7 +1381,7 @@ static void WritePair__44 (CHAR ch, LONGINT x)
{
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, ch);
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__DIV(x, 10) + 48));
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)(__MOD(x, 10) + 48));
Texts_Write(&*WriteDate__43_s->W, WriteDate__43_s->W__typ, (CHAR)((int)__MOD(x, 10) + 48));
}
void Texts_WriteDate (Texts_Writer *W, LONGINT *W__typ, LONGINT t, LONGINT d)
@ -1423,13 +1423,13 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT
Files_Read(&*r, r__typ, (void*)&eno);
if (eno > *Load0__16_s->ecnt) {
*Load0__16_s->ecnt = eno;
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32)));
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32)));
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->mods)[__X(eno, 64)], 32);
Files_ReadString(&*r, r__typ, (void*)(*Load0__16_s->procs)[__X(eno, 64)], 32);
}
org = Files_Pos(&*r, r__typ);
M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32)));
M = Modules_ThisMod((*Load0__16_s->mods)[__X(eno, 64)], 32);
if (M != NIL) {
Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], ((LONGINT)(32)));
Cmd = Modules_ThisCommand(M, (*Load0__16_s->procs)[__X(eno, 64)], 32);
if (Cmd != NIL) {
(*Cmd)();
}
@ -1455,8 +1455,8 @@ static void LoadElem__17 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, LONGINT
a->file = *Load0__16_s->f;
a->org = org;
a->span = span;
__COPY((*Load0__16_s->mods)[__X(eno, ((LONGINT)(64)))], a->mod, ((LONGINT)(32)));
__COPY((*Load0__16_s->procs)[__X(eno, ((LONGINT)(64)))], a->proc, ((LONGINT)(32)));
__COPY((*Load0__16_s->mods)[__X(eno, 64)], a->mod, 32);
__COPY((*Load0__16_s->procs)[__X(eno, 64)], a->proc, 32);
*e = (Texts_Elem)a;
}
}
@ -1500,8 +1500,8 @@ static void Texts_Load0 (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
while (fno != 0) {
if (fno > fcnt) {
fcnt = fno;
Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, ((LONGINT)(32)));
fnts[__X(fno, ((LONGINT)(32)))] = Texts_FontsThis((void*)name, ((LONGINT)(32)));
Files_ReadString(&msg.r, Files_Rider__typ, (void*)name, 32);
fnts[__X(fno, 32)] = Texts_FontsThis((void*)name, 32);
}
Files_Read(&msg.r, Files_Rider__typ, (void*)&col);
Files_Read(&msg.r, Files_Rider__typ, (void*)&voff);
@ -1556,9 +1556,9 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len)
__DUP(name, name__len, CHAR);
f = Files_Old(name, name__len);
if (f == NIL) {
f = Files_New((CHAR*)"", (LONGINT)1);
f = Files_New((CHAR*)"", 1);
}
Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0)));
Files_Set(&r, Files_Rider__typ, f, 0);
Files_Read(&r, Files_Rider__typ, (void*)&tag);
Files_Read(&r, Files_Rider__typ, (void*)&version);
if (tag == 0xf0 || (tag == 0x01 && version == 0xf0)) {
@ -1570,7 +1570,7 @@ void Texts_Open (Texts_Text T, CHAR *name, LONGINT name__len)
u->col = 15;
__NEW(p, Texts_PieceDesc);
if ((tag == 0xf7 && version == 0x07)) {
Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(28)));
Files_Set(&r, Files_Rider__typ, f, 28);
Files_ReadLInt(&r, Files_Rider__typ, &hlen);
Files_Set(&r, Files_Rider__typ, f, 22 + hlen);
Files_ReadLInt(&r, Files_Rider__typ, &T->len);
@ -1616,21 +1616,21 @@ static void StoreElem__40 (Files_Rider *r, LONGINT *r__typ, LONGINT pos, Texts_E
Files_Rider r1;
LONGINT org, span;
SHORTINT eno;
__COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32)));
__COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, ((LONGINT)(64)))], ((LONGINT)(32)));
__COPY((*Store__39_s->iden).mod, (*Store__39_s->mods)[__X(*Store__39_s->ecnt, 64)], 32);
__COPY((*Store__39_s->iden).proc, (*Store__39_s->procs)[__X(*Store__39_s->ecnt, 64)], 32);
eno = 1;
while (__STRCMP((*Store__39_s->mods)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, ((LONGINT)(64)))], (*Store__39_s->iden).proc) != 0) {
while (__STRCMP((*Store__39_s->mods)[__X(eno, 64)], (*Store__39_s->iden).mod) != 0 || __STRCMP((*Store__39_s->procs)[__X(eno, 64)], (*Store__39_s->iden).proc) != 0) {
eno += 1;
}
Files_Set(&r1, Files_Rider__typ, Files_Base(&*r, r__typ), Files_Pos(&*r, r__typ));
Files_WriteLInt(&*r, r__typ, ((LONGINT)(0)));
Files_WriteLInt(&*r, r__typ, ((LONGINT)(0)));
Files_WriteLInt(&*r, r__typ, ((LONGINT)(0)));
Files_WriteLInt(&*r, r__typ, 0);
Files_WriteLInt(&*r, r__typ, 0);
Files_WriteLInt(&*r, r__typ, 0);
Files_Write(&*r, r__typ, eno);
if (eno == *Store__39_s->ecnt) {
*Store__39_s->ecnt += 1;
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, ((LONGINT)(32)));
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, ((LONGINT)(32)));
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).mod, 32);
Files_WriteString(&*r, r__typ, (*Store__39_s->iden).proc, 32);
}
(*Store__39_s->msg).pos = pos;
org = Files_Pos(&*r, r__typ);
@ -1665,7 +1665,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
org = Files_Pos(&*r, r__typ);
msg.id = 1;
msg.r = *r;
Files_WriteLInt(&msg.r, Files_Rider__typ, ((LONGINT)(0)));
Files_WriteLInt(&msg.r, Files_Rider__typ, 0);
u = T->head->next;
pos = 0;
delta = 0;
@ -1679,15 +1679,15 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
iden.mod[0] = 0x01;
}
if (iden.mod[0] != 0x00) {
fnts[__X(fcnt, ((LONGINT)(32)))] = u->fnt;
fnts[__X(fcnt, 32)] = u->fnt;
fno = 1;
while (__STRCMP(fnts[__X(fno, ((LONGINT)(32)))]->name, u->fnt->name) != 0) {
while (__STRCMP(fnts[__X(fno, 32)]->name, u->fnt->name) != 0) {
fno += 1;
}
Files_Write(&msg.r, Files_Rider__typ, fno);
if (fno == fcnt) {
fcnt += 1;
Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, ((LONGINT)(32)));
Files_WriteString(&msg.r, Files_Rider__typ, u->fnt->name, 32);
}
Files_Write(&msg.r, Files_Rider__typ, u->col);
Files_Write(&msg.r, Files_Rider__typ, u->voff);
@ -1736,12 +1736,12 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
Files_Set(&r1, Files_Rider__typ, ((Texts_Piece)u)->file, ((Texts_Piece)u)->org);
delta = ((Texts_Piece)u)->len;
while (delta > 1024) {
Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024)));
Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), ((LONGINT)(1024)));
Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, 1024);
Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, 1024);
delta -= 1024;
}
Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta);
Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, ((LONGINT)(1024)), delta);
Files_ReadBytes(&r1, Files_Rider__typ, (void*)block, 1024, delta);
Files_WriteBytes(&msg.r, Files_Rider__typ, (void*)block, 1024, delta);
}
} else __WITHCHK;
} else {
@ -1755,7 +1755,7 @@ void Texts_Store (Files_Rider *r, LONGINT *r__typ, Texts_Text T)
}
__GUARDEQR(r, r__typ, Files_Rider) = msg.r;
if (T->notify != NIL) {
(*T->notify)(T, 3, ((LONGINT)(0)), ((LONGINT)(0)));
(*T->notify)(T, 3, 0, 0);
}
Store__39_s = _s.lnk;
}
@ -1768,7 +1768,7 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len)
CHAR bak[64];
__DUP(name, name__len, CHAR);
f = Files_New(name, name__len);
Files_Set(&r, Files_Rider__typ, f, ((LONGINT)(0)));
Files_Set(&r, Files_Rider__typ, f, 0);
Files_Write(&r, Files_Rider__typ, 0xf0);
Files_Write(&r, Files_Rider__typ, 0x01);
Texts_Store(&r, Files_Rider__typ, T);
@ -1776,13 +1776,13 @@ void Texts_Close (Texts_Text T, CHAR *name, LONGINT name__len)
while (name[__X(i, name__len)] != 0x00) {
i += 1;
}
__COPY(name, bak, ((LONGINT)(64)));
bak[__X(i, ((LONGINT)(64)))] = '.';
bak[__X(i + 1, ((LONGINT)(64)))] = 'B';
bak[__X(i + 2, ((LONGINT)(64)))] = 'a';
bak[__X(i + 3, ((LONGINT)(64)))] = 'k';
bak[__X(i + 4, ((LONGINT)(64)))] = 0x00;
Files_Rename(name, name__len, bak, ((LONGINT)(64)), &res);
__COPY(name, bak, 64);
bak[__X(i, 64)] = '.';
bak[__X(i + 1, 64)] = 'B';
bak[__X(i + 2, 64)] = 'a';
bak[__X(i + 3, 64)] = 'k';
bak[__X(i + 4, 64)] = 0x00;
Files_Rename(name, name__len, bak, 64, &res);
Files_Register(f);
__DEL(name);
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Texts__h
#define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkamSf */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkamSf */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Heap.h"
@ -33,31 +33,31 @@ void Vishap_Module (BOOLEAN *done)
OPV_AdrAndSize(OPT_topScope);
OPT_Export(&ext, &new);
if (OPM_noerr) {
OPM_OpenFiles((void*)OPT_SelfName, ((LONGINT)(256)));
OPM_OpenFiles((void*)OPT_SelfName, 256);
OPC_Init();
OPV_Module(p);
if (OPM_noerr) {
if (((OPM_mainProg || OPM_mainLinkStat) && __STRCMP(OPM_modName, "SYSTEM") != 0)) {
OPM_DeleteNewSym();
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"32m", (LONGINT)4);
vt100_SetAttr((CHAR*)"32m", 4);
}
OPM_LogWStr((CHAR*)" Main program.", (LONGINT)16);
OPM_LogWStr((CHAR*)" Main program.", 16);
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
} else {
if (new) {
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"32m", (LONGINT)4);
vt100_SetAttr((CHAR*)"32m", 4);
}
OPM_LogWStr((CHAR*)" New symbol file.", (LONGINT)19);
OPM_LogWStr((CHAR*)" New symbol file.", 19);
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
OPM_RegisterNewSym();
} else if (ext) {
OPM_LogWStr((CHAR*)" Extended symbol file.", (LONGINT)24);
OPM_LogWStr((CHAR*)" Extended symbol file.", 24);
OPM_RegisterNewSym();
}
}
@ -94,7 +94,7 @@ void Vishap_Translate (void)
modulesobj[0] = 0x00;
if (OPM_OpenPar()) {
for (;;) {
OPM_Init(&done, (void*)Vishap_mname, ((LONGINT)(256)));
OPM_Init(&done, (void*)Vishap_mname, 256);
if (!done) {
return;
}
@ -104,21 +104,21 @@ void Vishap_Translate (void)
Vishap_Module(&done);
if (!done) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Module compilation failed.", (LONGINT)27);
OPM_LogWStr((CHAR*)"Module compilation failed.", 27);
OPM_LogWLn();
Platform_Exit(1);
}
if (!OPM_dontAsm) {
if (OPM_dontLink) {
extTools_Assemble(OPM_modName, ((LONGINT)(32)));
extTools_Assemble(OPM_modName, 32);
} else {
if (!(OPM_mainProg || OPM_mainLinkStat)) {
extTools_Assemble(OPM_modName, ((LONGINT)(32)));
Strings_Append((CHAR*)" ", (LONGINT)2, (void*)modulesobj, ((LONGINT)(2048)));
Strings_Append(OPM_modName, ((LONGINT)(32)), (void*)modulesobj, ((LONGINT)(2048)));
Strings_Append((CHAR*)".o", (LONGINT)3, (void*)modulesobj, ((LONGINT)(2048)));
extTools_Assemble(OPM_modName, 32);
Strings_Append((CHAR*)" ", 2, (void*)modulesobj, 2048);
Strings_Append(OPM_modName, 32, (void*)modulesobj, 2048);
Strings_Append((CHAR*)".o", 3, (void*)modulesobj, 2048);
} else {
extTools_LinkMain((void*)OPM_modName, ((LONGINT)(32)), OPM_mainLinkStat, modulesobj, ((LONGINT)(2048)));
extTools_LinkMain((void*)OPM_modName, 32, OPM_mainLinkStat, modulesobj, 2048);
}
}
}
@ -133,7 +133,7 @@ static void Vishap_Trap (INTEGER sig)
Platform_Exit(0);
} else {
if ((sig == 4 && Platform_HaltCode == -15)) {
OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", (LONGINT)35);
OPM_LogWStr((CHAR*)" --- Vishap Oberon: internal error", 35);
OPM_LogWLn();
}
Platform_Exit(2);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
typedef

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef errors__h
#define errors__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Configuration.h"
#include "Console.h"
@ -35,14 +35,14 @@ static void extTools_execute (CHAR *title, LONGINT title__len, CHAR *cmd, LONGIN
Console_String(title, title__len);
Console_String(cmd, cmd__len);
Console_Ln();
Console_String((CHAR*)"-- failed: status ", (LONGINT)19);
Console_Int(status, ((LONGINT)(1)));
Console_String((CHAR*)", exitcode ", (LONGINT)12);
Console_Int(exitcode, ((LONGINT)(1)));
Console_String((CHAR*)".", (LONGINT)2);
Console_String((CHAR*)"-- failed: status ", 19);
Console_Int(status, 1);
Console_String((CHAR*)", exitcode ", 12);
Console_Int(exitcode, 1);
Console_String((CHAR*)".", 2);
Console_Ln();
if ((status == 0 && exitcode == 127)) {
Console_String((CHAR*)"Is the C compiler in the current command path\?", (LONGINT)47);
Console_String((CHAR*)"Is the C compiler in the current command path\?", 47);
Console_Ln();
}
if (status != 0) {
@ -60,11 +60,11 @@ void extTools_Assemble (CHAR *moduleName, LONGINT moduleName__len)
CHAR cmd[1023];
__DUP(moduleName, moduleName__len, CHAR);
__MOVE("gcc -g", cmd, 7);
Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)"-c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023)));
Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)".c", (LONGINT)3, (void*)cmd, ((LONGINT)(1023)));
extTools_execute((CHAR*)"Assemble: ", (LONGINT)11, cmd, ((LONGINT)(1023)));
Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023);
Strings_Append((CHAR*)"-c ", 4, (void*)cmd, 1023);
Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023);
Strings_Append((CHAR*)".c", 3, (void*)cmd, 1023);
extTools_execute((CHAR*)"Assemble: ", 11, cmd, 1023);
__DEL(moduleName);
}
@ -73,21 +73,21 @@ void extTools_LinkMain (CHAR *moduleName, LONGINT moduleName__len, BOOLEAN stati
CHAR cmd[1023];
__DUP(additionalopts, additionalopts__len, CHAR);
__MOVE("gcc -g", cmd, 7);
Strings_Append((CHAR*)" ", (LONGINT)2, (void*)cmd, ((LONGINT)(1023)));
Strings_Append(extTools_compilationOptions, ((LONGINT)(1023)), (void*)cmd, ((LONGINT)(1023)));
Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)".c ", (LONGINT)4, (void*)cmd, ((LONGINT)(1023)));
Strings_Append(additionalopts, additionalopts__len, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)" ", 2, (void*)cmd, 1023);
Strings_Append(extTools_compilationOptions, 1023, (void*)cmd, 1023);
Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023);
Strings_Append((CHAR*)".c ", 4, (void*)cmd, 1023);
Strings_Append(additionalopts, additionalopts__len, (void*)cmd, 1023);
if (statically) {
Strings_Append((CHAR*)"-static", (LONGINT)8, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)"-static", 8, (void*)cmd, 1023);
}
Strings_Append((CHAR*)" -o ", (LONGINT)5, (void*)cmd, ((LONGINT)(1023)));
Strings_Append(moduleName, moduleName__len, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)" -L\"", (LONGINT)5, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)"/lib\"", (LONGINT)6, (void*)cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)" -l voc", (LONGINT)8, (void*)cmd, ((LONGINT)(1023)));
extTools_execute((CHAR*)"Assemble and link: ", (LONGINT)20, cmd, ((LONGINT)(1023)));
Strings_Append((CHAR*)" -o ", 5, (void*)cmd, 1023);
Strings_Append(moduleName, moduleName__len, (void*)cmd, 1023);
Strings_Append((CHAR*)" -L\"", 5, (void*)cmd, 1023);
Strings_Append((CHAR*)"/opt/voc", 9, (void*)cmd, 1023);
Strings_Append((CHAR*)"/lib\"", 6, (void*)cmd, 1023);
Strings_Append((CHAR*)" -l voc", 8, (void*)cmd, 1023);
extTools_execute((CHAR*)"Assemble and link: ", 20, cmd, 1023);
__DEL(additionalopts);
}
@ -102,11 +102,11 @@ export void *extTools__init(void)
__MODULE_IMPORT(Strings);
__REGMOD("extTools", 0);
/* BEGIN */
Strings_Append((CHAR*)" -I \"", (LONGINT)6, (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Strings_Append((CHAR*)"/include\" ", (LONGINT)11, (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Platform_GetEnv((CHAR*)"CFLAGS", (LONGINT)7, (void*)extTools_CFLAGS, ((LONGINT)(1023)));
Strings_Append(extTools_CFLAGS, ((LONGINT)(1023)), (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Strings_Append((CHAR*)" ", (LONGINT)2, (void*)extTools_compilationOptions, ((LONGINT)(1023)));
Strings_Append((CHAR*)" -I \"", 6, (void*)extTools_compilationOptions, 1023);
Strings_Append((CHAR*)"/opt/voc", 9, (void*)extTools_compilationOptions, 1023);
Strings_Append((CHAR*)"/include\" ", 11, (void*)extTools_compilationOptions, 1023);
Platform_GetEnv((CHAR*)"CFLAGS", 7, (void*)extTools_CFLAGS, 1023);
Strings_Append(extTools_CFLAGS, 1023, (void*)extTools_compilationOptions, 1023);
Strings_Append((CHAR*)" ", 2, (void*)extTools_compilationOptions, 1023);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef extTools__h
#define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#include "SYSTEM.h"
#include "Console.h"
#include "Strings.h"
@ -68,12 +68,12 @@ void vt100_IntToStr (LONGINT int_, CHAR *str, LONGINT str__len)
}
e = s;
do {
b[__X(e, ((LONGINT)(21)))] = (CHAR)(__MOD(int_, 10) + 48);
b[__X(e, 21)] = (CHAR)((int)__MOD(int_, 10) + 48);
int_ = __DIV(int_, 10);
e += 1;
} while (!(int_ == 0));
b[__X(e, ((LONGINT)(21)))] = 0x00;
vt100_Reverse0((void*)b, ((LONGINT)(21)), s, e - 1);
b[__X(e, 21)] = 0x00;
vt100_Reverse0((void*)b, 21, s, e - 1);
}
__COPY(b, str, str__len);
}
@ -82,9 +82,9 @@ static void vt100_EscSeq0 (CHAR *letter, LONGINT letter__len)
{
CHAR cmd[9];
__DUP(letter, letter__len, CHAR);
__COPY(vt100_CSI, cmd, ((LONGINT)(9)));
Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(9)));
Console_String(cmd, ((LONGINT)(9)));
__COPY(vt100_CSI, cmd, 9);
Strings_Append(letter, letter__len, (void*)cmd, 9);
Console_String(cmd, 9);
__DEL(letter);
}
@ -93,11 +93,11 @@ static void vt100_EscSeq (INTEGER n, CHAR *letter, LONGINT letter__len)
CHAR nstr[2];
CHAR cmd[7];
__DUP(letter, letter__len, CHAR);
vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2)));
__COPY(vt100_CSI, cmd, ((LONGINT)(7)));
Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7)));
Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7)));
Console_String(cmd, ((LONGINT)(7)));
vt100_IntToStr(n, (void*)nstr, 2);
__COPY(vt100_CSI, cmd, 7);
Strings_Append(nstr, 2, (void*)cmd, 7);
Strings_Append(letter, letter__len, (void*)cmd, 7);
Console_String(cmd, 7);
__DEL(letter);
}
@ -106,11 +106,11 @@ static void vt100_EscSeqSwapped (INTEGER n, CHAR *letter, LONGINT letter__len)
CHAR nstr[2];
CHAR cmd[7];
__DUP(letter, letter__len, CHAR);
vt100_IntToStr(n, (void*)nstr, ((LONGINT)(2)));
__COPY(vt100_CSI, cmd, ((LONGINT)(7)));
Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(7)));
Strings_Append(nstr, ((LONGINT)(2)), (void*)cmd, ((LONGINT)(7)));
Console_String(cmd, ((LONGINT)(7)));
vt100_IntToStr(n, (void*)nstr, 2);
__COPY(vt100_CSI, cmd, 7);
Strings_Append(letter, letter__len, (void*)cmd, 7);
Strings_Append(nstr, 2, (void*)cmd, 7);
Console_String(cmd, 7);
__DEL(letter);
}
@ -119,124 +119,124 @@ static void vt100_EscSeq2 (INTEGER n, INTEGER m, CHAR *letter, LONGINT letter__l
CHAR nstr[5], mstr[5];
CHAR cmd[12];
__DUP(letter, letter__len, CHAR);
vt100_IntToStr(n, (void*)nstr, ((LONGINT)(5)));
vt100_IntToStr(m, (void*)mstr, ((LONGINT)(5)));
__COPY(vt100_CSI, cmd, ((LONGINT)(12)));
Strings_Append(nstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12)));
Strings_Append((CHAR*)";", (LONGINT)2, (void*)cmd, ((LONGINT)(12)));
Strings_Append(mstr, ((LONGINT)(5)), (void*)cmd, ((LONGINT)(12)));
Strings_Append(letter, letter__len, (void*)cmd, ((LONGINT)(12)));
Console_String(cmd, ((LONGINT)(12)));
vt100_IntToStr(n, (void*)nstr, 5);
vt100_IntToStr(m, (void*)mstr, 5);
__COPY(vt100_CSI, cmd, 12);
Strings_Append(nstr, 5, (void*)cmd, 12);
Strings_Append((CHAR*)";", 2, (void*)cmd, 12);
Strings_Append(mstr, 5, (void*)cmd, 12);
Strings_Append(letter, letter__len, (void*)cmd, 12);
Console_String(cmd, 12);
__DEL(letter);
}
void vt100_CUU (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"A", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"A", 2);
}
void vt100_CUD (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"B", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"B", 2);
}
void vt100_CUF (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"C", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"C", 2);
}
void vt100_CUB (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"D", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"D", 2);
}
void vt100_CNL (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"E", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"E", 2);
}
void vt100_CPL (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"F", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"F", 2);
}
void vt100_CHA (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"G", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"G", 2);
}
void vt100_CUP (INTEGER n, INTEGER m)
{
vt100_EscSeq2(n, m, (CHAR*)"H", (LONGINT)2);
vt100_EscSeq2(n, m, (CHAR*)"H", 2);
}
void vt100_ED (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"J", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"J", 2);
}
void vt100_EL (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"K", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"K", 2);
}
void vt100_SU (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"S", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"S", 2);
}
void vt100_SD (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"T", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"T", 2);
}
void vt100_HVP (INTEGER n, INTEGER m)
{
vt100_EscSeq2(n, m, (CHAR*)"f", (LONGINT)2);
vt100_EscSeq2(n, m, (CHAR*)"f", 2);
}
void vt100_SGR (INTEGER n)
{
vt100_EscSeq(n, (CHAR*)"m", (LONGINT)2);
vt100_EscSeq(n, (CHAR*)"m", 2);
}
void vt100_SGR2 (INTEGER n, INTEGER m)
{
vt100_EscSeq2(n, m, (CHAR*)"m", (LONGINT)2);
vt100_EscSeq2(n, m, (CHAR*)"m", 2);
}
void vt100_DSR (INTEGER n)
{
vt100_EscSeq(6, (CHAR*)"n", (LONGINT)2);
vt100_EscSeq(6, (CHAR*)"n", 2);
}
void vt100_SCP (void)
{
vt100_EscSeq0((CHAR*)"s", (LONGINT)2);
vt100_EscSeq0((CHAR*)"s", 2);
}
void vt100_RCP (void)
{
vt100_EscSeq0((CHAR*)"u", (LONGINT)2);
vt100_EscSeq0((CHAR*)"u", 2);
}
void vt100_DECTCEMl (void)
{
vt100_EscSeq0((CHAR*)"\?25l", (LONGINT)5);
vt100_EscSeq0((CHAR*)"\?25l", 5);
}
void vt100_DECTCEMh (void)
{
vt100_EscSeq0((CHAR*)"\?25h", (LONGINT)5);
vt100_EscSeq0((CHAR*)"\?25h", 5);
}
void vt100_SetAttr (CHAR *attr, LONGINT attr__len)
{
CHAR tmpstr[16];
__DUP(attr, attr__len, CHAR);
__COPY(vt100_CSI, tmpstr, ((LONGINT)(16)));
Strings_Append(attr, attr__len, (void*)tmpstr, ((LONGINT)(16)));
Console_String(tmpstr, ((LONGINT)(16)));
__COPY(vt100_CSI, tmpstr, 16);
Strings_Append(attr, attr__len, (void*)tmpstr, 16);
Console_String(tmpstr, 16);
__DEL(attr);
}
@ -252,7 +252,7 @@ export void *vt100__init(void)
__REGCMD("RCP", vt100_RCP);
__REGCMD("SCP", vt100_SCP);
/* BEGIN */
__COPY("\033", vt100_CSI, ((LONGINT)(5)));
Strings_Append((CHAR*)"[", (LONGINT)2, (void*)vt100_CSI, ((LONGINT)(5)));
__COPY("\033", vt100_CSI, 5);
Strings_Append((CHAR*)"[", 2, (void*)vt100_CSI, 5);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef vt100__h
#define vt100__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE
#include "SYSTEM.h"
@ -14,6 +14,6 @@ export void *Configuration__init(void)
__DEFMOD;
__REGMOD("Configuration", 0);
/* BEGIN */
__MOVE("1.95 [2016/08/30] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__MOVE("1.95 [2016/08/31] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h
#define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE
#include "SYSTEM.h"
#include "Platform.h"
@ -22,7 +22,7 @@ export void Console_String (CHAR *s, LONGINT s__len);
void Console_Flush (void)
{
INTEGER error;
error = Platform_Write(((LONGINT)(1)), (LONGINT)(SYSTEM_ADRINT)Console_line, Console_pos);
error = Platform_Write(1, (SYSTEM_ADRINT)Console_line, Console_pos);
Console_pos = 0;
}
@ -31,7 +31,7 @@ void Console_Char (CHAR ch)
if (Console_pos == 128) {
Console_Flush();
}
Console_line[__X(Console_pos, ((LONGINT)(128)))] = ch;
Console_line[__X(Console_pos, 128)] = ch;
Console_pos += 1;
if (ch == 0x0a) {
Console_Flush();
@ -63,13 +63,13 @@ void Console_Int (LONGINT i, LONGINT n)
i1 = __DIV(i1, 10);
k = 1;
while (i1 > 0) {
s[__X(k, ((LONGINT)(32)))] = (CHAR)(__MOD(i1, 10) + 48);
s[__X(k, 32)] = (CHAR)(__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k += 1;
}
}
if (i < 0) {
s[__X(k, ((LONGINT)(32)))] = '-';
s[__X(k, 32)] = '-';
k += 1;
}
while (n > k) {
@ -78,7 +78,7 @@ void Console_Int (LONGINT i, LONGINT n)
}
while (k > 0) {
k -= 1;
Console_Char(s[__X(k, ((LONGINT)(32)))]);
Console_Char(s[__X(k, 32)]);
}
}
@ -90,9 +90,9 @@ void Console_Ln (void)
void Console_Bool (BOOLEAN b)
{
if (b) {
Console_String((CHAR*)"TRUE", (LONGINT)5);
Console_String((CHAR*)"TRUE", 5);
} else {
Console_String((CHAR*)"FALSE", (LONGINT)6);
Console_String((CHAR*)"FALSE", 6);
}
}
@ -116,7 +116,7 @@ void Console_Read (CHAR *ch)
LONGINT n;
INTEGER error;
Console_Flush();
error = Platform_ReadBuf(((LONGINT)(0)), (void*)&*ch, ((LONGINT)(1)), &n);
error = Platform_ReadBuf(0, (void*)&*ch, 1, &n);
if (n != 1) {
*ch = 0x00;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h
#define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#define LARGE
#include "SYSTEM.h"
#include "Configuration.h"
@ -111,23 +111,23 @@ static void Files_Err (CHAR *s, LONGINT s__len, Files_File f, INTEGER errcode)
{
__DUP(s, s__len, CHAR);
Console_Ln();
Console_String((CHAR*)"-- ", (LONGINT)4);
Console_String((CHAR*)"-- ", 4);
Console_String(s, s__len);
Console_String((CHAR*)": ", (LONGINT)3);
Console_String((CHAR*)": ", 3);
if (f != NIL) {
if (f->registerName[0] != 0x00) {
Console_String(f->registerName, ((LONGINT)(101)));
Console_String(f->registerName, 101);
} else {
Console_String(f->workName, ((LONGINT)(101)));
Console_String(f->workName, 101);
}
if (f->fd != 0) {
Console_String((CHAR*)"f.fd = ", (LONGINT)8);
Console_Int(f->fd, ((LONGINT)(1)));
Console_String((CHAR*)"f.fd = ", 8);
Console_Int(f->fd, 1);
}
}
if (errcode != 0) {
Console_String((CHAR*)" errcode = ", (LONGINT)12);
Console_Int(errcode, ((LONGINT)(1)));
Console_String((CHAR*)" errcode = ", 12);
Console_Int(errcode, 1);
}
Console_Ln();
__HALT(99);
@ -217,15 +217,15 @@ static void Files_Create (Files_File f)
CHAR err[32];
if (f->fd == -1) {
if (f->state == 1) {
Files_GetTempName(f->registerName, ((LONGINT)(101)), (void*)f->workName, ((LONGINT)(101)));
Files_GetTempName(f->registerName, 101, (void*)f->workName, 101);
f->tempFile = 1;
} else if (f->state == 2) {
__COPY(f->registerName, f->workName, ((LONGINT)(101)));
__COPY(f->registerName, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
}
error = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
error = Platform_New((void*)f->workName, ((LONGINT)(101)), &f->fd);
error = Platform_Unlink((void*)f->workName, 101);
error = Platform_New((void*)f->workName, 101, &f->fd);
done = error == 0;
if (done) {
f->next = Files_files;
@ -243,7 +243,7 @@ static void Files_Create (Files_File f)
} else {
__MOVE("file not created", err, 17);
}
Files_Err(err, ((LONGINT)(32)), f, error);
Files_Err(err, 32, f, error);
}
}
}
@ -258,15 +258,15 @@ static void Files_Flush (Files_Buffer buf)
if (buf->org != f->pos) {
error = Platform_Seek(f->fd, buf->org, Platform_SeekSet);
}
error = Platform_Write(f->fd, (LONGINT)(SYSTEM_ADRINT)buf->data, buf->size);
error = Platform_Write(f->fd, (SYSTEM_ADRINT)buf->data, buf->size);
if (error != 0) {
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
Files_Err((CHAR*)"error writing file", 19, f, error);
}
f->pos = buf->org + buf->size;
buf->chg = 0;
error = Platform_Identify(f->fd, &f->identity, Platform_FileIdentity__typ);
if (error != 0) {
Files_Err((CHAR*)"error identifying file", (LONGINT)23, f, error);
Files_Err((CHAR*)"error identifying file", 23, f, error);
}
}
}
@ -305,7 +305,7 @@ void Files_Close (Files_File f)
}
error = Platform_Sync(f->fd);
if (error != 0) {
Files_Err((CHAR*)"error writing file", (LONGINT)19, f, error);
Files_Err((CHAR*)"error writing file", 19, f, error);
}
Files_CloseOSFile(f);
}
@ -325,7 +325,7 @@ Files_File Files_New (CHAR *name, LONGINT name__len)
__DUP(name, name__len, CHAR);
__NEW(f, Files_FileDesc);
f->workName[0] = 0x00;
__COPY(name, f->registerName, ((LONGINT)(101)));
__COPY(name, f->registerName, 101);
f->fd = -1;
f->state = 1;
f->len = 0;
@ -438,28 +438,28 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
if (name[0] != 0x00) {
if (Files_HasDir((void*)name, name__len)) {
dir[0] = 0x00;
__COPY(name, path, ((LONGINT)(256)));
__COPY(name, path, 256);
} else {
pos = 0;
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, 256);
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256);
}
for (;;) {
error = Platform_OldRW((void*)path, ((LONGINT)(256)), &fd);
error = Platform_OldRW((void*)path, 256, &fd);
done = error == 0;
if ((!done && Platform_TooManyFiles(error))) {
Files_Err((CHAR*)"too many files open", (LONGINT)20, f, error);
Files_Err((CHAR*)"too many files open", 20, f, error);
}
if ((!done && Platform_Inaccessible(error))) {
error = Platform_OldRO((void*)path, ((LONGINT)(256)), &fd);
error = Platform_OldRO((void*)path, 256, &fd);
done = error == 0;
}
if ((!done && !Platform_Absent(error))) {
Console_String((CHAR*)"Warning: Files.Old ", (LONGINT)20);
Console_String((CHAR*)"Warning: Files.Old ", 20);
Console_String(name, name__len);
Console_String((CHAR*)" error = ", (LONGINT)10);
Console_Int(error, ((LONGINT)(0)));
Console_String((CHAR*)" error = ", 10);
Console_Int(error, 0);
Console_Ln();
}
if (done) {
@ -477,7 +477,7 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
f->pos = 0;
f->swapper = -1;
error = Platform_Size(fd, &f->len);
__COPY(name, f->workName, ((LONGINT)(101)));
__COPY(name, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
f->identity = identity;
@ -493,8 +493,8 @@ Files_File Files_Old (CHAR *name, LONGINT name__len)
__DEL(name);
return _o_result;
} else {
Files_MakeFileName(dir, ((LONGINT)(256)), name, name__len, (void*)path, ((LONGINT)(256)));
Files_ScanPath(&pos, (void*)dir, ((LONGINT)(256)));
Files_MakeFileName(dir, 256, name, name__len, (void*)path, 256);
Files_ScanPath(&pos, (void*)dir, 256);
}
}
} else {
@ -519,8 +519,8 @@ void Files_Purge (Files_File f)
i += 1;
}
if (f->fd != -1) {
error = Platform_Truncate(f->fd, ((LONGINT)(0)));
error = Platform_Seek(f->fd, ((LONGINT)(0)), Platform_SeekSet);
error = Platform_Truncate(f->fd, 0);
error = Platform_Seek(f->fd, 0, Platform_SeekSet);
}
f->pos = 0;
f->len = 0;
@ -585,9 +585,9 @@ void Files_Set (Files_Rider *r, LONGINT *r__typ, Files_File f, LONGINT pos)
if (f->pos != org) {
error = Platform_Seek(f->fd, org, Platform_SeekSet);
}
error = Platform_ReadBuf(f->fd, (void*)buf->data, ((LONGINT)(4096)), &n);
error = Platform_ReadBuf(f->fd, (void*)buf->data, 4096, &n);
if (error != 0) {
Files_Err((CHAR*)"read from file not done", (LONGINT)24, f, error);
Files_Err((CHAR*)"read from file not done", 24, f, error);
}
f->pos = org + n;
buf->size = n;
@ -657,7 +657,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
} else {
min = n;
}
__MOVE((LONGINT)(SYSTEM_ADRINT)buf->data + offset, (LONGINT)(SYSTEM_ADRINT)x + xpos, min);
__MOVE((SYSTEM_ADRINT)buf->data + offset, (SYSTEM_ADRINT)x + xpos, min);
offset += min;
(*r).offset = offset;
xpos += min;
@ -669,7 +669,7 @@ void Files_ReadBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x
void Files_ReadByte (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT x__len)
{
Files_ReadBytes(&*r, r__typ, (void*)x, x__len * ((LONGINT)(1)), ((LONGINT)(1)));
Files_ReadBytes(&*r, r__typ, (void*)x, x__len * 1, 1);
}
Files_File Files_Base (Files_Rider *r, LONGINT *r__typ)
@ -722,7 +722,7 @@ void Files_WriteBytes (Files_Rider *r, LONGINT *r__typ, SYSTEM_BYTE *x, LONGINT
} else {
min = n;
}
__MOVE((LONGINT)(SYSTEM_ADRINT)x + xpos, (LONGINT)(SYSTEM_ADRINT)buf->data + offset, min);
__MOVE((SYSTEM_ADRINT)x + xpos, (SYSTEM_ADRINT)buf->data + offset, min);
offset += min;
(*r).offset = offset;
if (offset > buf->size) {
@ -773,15 +773,15 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
*res = 3;
return;
}
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n);
error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n);
while (n > 0) {
error = Platform_Write(fdnew, (LONGINT)(SYSTEM_ADRINT)buf, n);
error = Platform_Write(fdnew, (SYSTEM_ADRINT)buf, n);
if (error != 0) {
ignore = Platform_Close(fdold);
ignore = Platform_Close(fdnew);
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
Files_Err((CHAR*)"cannot move file", 17, NIL, error);
}
error = Platform_Read(fdold, (LONGINT)(SYSTEM_ADRINT)buf, ((LONGINT)(4096)), &n);
error = Platform_Read(fdold, (SYSTEM_ADRINT)buf, 4096, &n);
}
ignore = Platform_Close(fdold);
ignore = Platform_Close(fdnew);
@ -789,7 +789,7 @@ void Files_Rename (CHAR *old, LONGINT old__len, CHAR *new, LONGINT new__len, INT
error = Platform_Unlink((void*)old, old__len);
*res = 0;
} else {
Files_Err((CHAR*)"cannot move file", (LONGINT)17, NIL, error);
Files_Err((CHAR*)"cannot move file", 17, NIL, error);
}
}
} else {
@ -809,12 +809,12 @@ void Files_Register (Files_File f)
}
Files_Close(f);
if (f->registerName[0] != 0x00) {
Files_Rename(f->workName, ((LONGINT)(101)), f->registerName, ((LONGINT)(101)), &errcode);
Files_Rename(f->workName, 101, f->registerName, 101, &errcode);
if (errcode != 0) {
__COPY(f->registerName, file, ((LONGINT)(104)));
__COPY(f->registerName, file, 104);
__HALT(99);
}
__COPY(f->registerName, f->workName, ((LONGINT)(101)));
__COPY(f->registerName, f->workName, 101);
f->registerName[0] = 0x00;
f->tempFile = 0;
}
@ -839,7 +839,7 @@ static void Files_FlipBytes (SYSTEM_BYTE *src, LONGINT src__len, SYSTEM_BYTE *de
j += 1;
}
} else {
__MOVE((LONGINT)(SYSTEM_ADRINT)src, (LONGINT)(SYSTEM_ADRINT)dest, src__len);
__MOVE((SYSTEM_ADRINT)src, (SYSTEM_ADRINT)dest, src__len);
}
}
@ -851,38 +851,38 @@ void Files_ReadBool (Files_Rider *R, LONGINT *R__typ, BOOLEAN *x)
void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x)
{
CHAR b[2];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2)));
*x = (int)b[0] + __ASHL((int)b[1], 8);
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2);
*x = b[0] + __ASHL(b[1], 8);
}
void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
*x = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24);
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
*x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
}
void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x)
{
CHAR b[4];
LONGINT l;
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
l = (((int)b[0] + __ASHL((int)b[1], 8)) + __ASHL((int)b[2], 16)) + __ASHL((int)b[3], 24);
*x = (SET)l;
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
*x = __VAL(SET, l);
}
void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x)
{
CHAR b[4];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_FlipBytes((void*)b, ((LONGINT)(4)), (void*)&*x, ((LONGINT)(4)));
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
Files_FlipBytes((void*)b, 4, (void*)&*x, 4);
}
void Files_ReadLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL *x)
{
CHAR b[8];
Files_ReadBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8)));
Files_FlipBytes((void*)b, ((LONGINT)(8)), (void*)&*x, ((LONGINT)(8)));
Files_ReadBytes(&*R, R__typ, (void*)b, 8, 8);
Files_FlipBytes((void*)b, 8, (void*)&*x, 8);
}
void Files_ReadString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len)
@ -923,12 +923,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
s = 0;
n = 0;
Files_Read(&*R, R__typ, (void*)&ch);
while ((int)ch >= 128) {
n += __ASH((SYSTEM_INT64)((int)ch - 128), s);
while (ch >= 128) {
n += __ASH((SYSTEM_INT64)(ch - 128), s);
s += 7;
Files_Read(&*R, R__typ, (void*)&ch);
}
n += __ASH((SYSTEM_INT64)(__MASK((int)ch, -64) - __ASHL(__ASHR((int)ch, 6), 6)), s);
n += __ASH((SYSTEM_INT64)(__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s);
*x = n;
}
@ -942,7 +942,7 @@ void Files_WriteInt (Files_Rider *R, LONGINT *R__typ, INTEGER x)
CHAR b[2];
b[0] = (CHAR)x;
b[1] = (CHAR)__ASHR(x, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(2)), ((LONGINT)(2)));
Files_WriteBytes(&*R, R__typ, (void*)b, 2, 2);
}
void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x)
@ -952,33 +952,33 @@ void Files_WriteLInt (Files_Rider *R, LONGINT *R__typ, LONGINT x)
b[1] = (CHAR)__ASHR(x, 8);
b[2] = (CHAR)__ASHR(x, 16);
b[3] = (CHAR)__ASHR(x, 24);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x)
{
CHAR b[4];
LONGINT i;
i = (LONGINT)x;
i = __VAL(LONGINT, x);
b[0] = (CHAR)i;
b[1] = (CHAR)__ASHR(i, 8);
b[2] = (CHAR)__ASHR(i, 16);
b[3] = (CHAR)__ASHR(i, 24);
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteReal (Files_Rider *R, LONGINT *R__typ, REAL x)
{
CHAR b[4];
Files_FlipBytes((void*)&x, ((LONGINT)(4)), (void*)b, ((LONGINT)(4)));
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(4)), ((LONGINT)(4)));
Files_FlipBytes((void*)&x, 4, (void*)b, 4);
Files_WriteBytes(&*R, R__typ, (void*)b, 4, 4);
}
void Files_WriteLReal (Files_Rider *R, LONGINT *R__typ, LONGREAL x)
{
CHAR b[8];
Files_FlipBytes((void*)&x, ((LONGINT)(8)), (void*)b, ((LONGINT)(8)));
Files_WriteBytes(&*R, R__typ, (void*)b, ((LONGINT)(8)), ((LONGINT)(8)));
Files_FlipBytes((void*)&x, 8, (void*)b, 8);
Files_WriteBytes(&*R, R__typ, (void*)b, 8, 8);
}
void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len)
@ -988,7 +988,7 @@ void Files_WriteString (Files_Rider *R, LONGINT *R__typ, CHAR *x, LONGINT x__len
while (x[i] != 0x00) {
i += 1;
}
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * ((LONGINT)(1)), i + 1);
Files_WriteBytes(&*R, R__typ, (void*)x, x__len * 1, i + 1);
}
void Files_WriteNum (Files_Rider *R, LONGINT *R__typ, LONGINT x)
@ -1013,7 +1013,7 @@ static void Files_Finalize (SYSTEM_PTR o)
if (f->fd >= 0) {
Files_CloseOSFile(f);
if (f->tempFile) {
res = Platform_Unlink((void*)f->workName, ((LONGINT)(101)));
res = Platform_Unlink((void*)f->workName, 101);
}
}
}
@ -1022,7 +1022,7 @@ void Files_SetSearchPath (CHAR *path, LONGINT path__len)
{
__DUP(path, path__len, CHAR);
if (Strings_Length(path, path__len) != 0) {
Files_SearchPath = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 1, (LONGINT)(Strings_Length(path, path__len) + 1));
Files_SearchPath = __NEWARR(NIL, 1, 1, 1, 1, ((SYSTEM_ADRINT)((Strings_Length(path, path__len) + 1))));
__COPY(path, Files_SearchPath->data, Files_SearchPath->len[0]);
} else {
Files_SearchPath = NIL;
@ -1056,6 +1056,6 @@ export void *Files__init(void)
Files_tempno = -1;
Heap_FileCount = 0;
Files_HOME[0] = 0x00;
Platform_GetEnv((CHAR*)"HOME", (LONGINT)5, (void*)Files_HOME, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"HOME", 5, (void*)Files_HOME, 1024);
__ENDMOD;
}

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h
#define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */
#define LARGE
#include "SYSTEM.h"
@ -117,7 +117,7 @@ void Heap_Unlock (void)
{
Heap_lockdepth -= 1;
if ((Heap_interrupted && Heap_lockdepth == 0)) {
Heap_PlatformHalt(((LONGINT)(-9)));
Heap_PlatformHalt(-9);
}
}
@ -132,7 +132,7 @@ SYSTEM_PTR Heap_REGMOD (Heap_ModuleName name, Heap_EnumProc enumPtrs)
}
m->types = 0;
m->cmds = NIL;
__COPY(name, m->name, ((LONGINT)(20)));
__COPY(name, m->name, 20);
m->refcnt = 0;
m->enumPtrs = enumPtrs;
m->next = (Heap_Module)(SYSTEM_ADRINT)Heap_modules;
@ -149,7 +149,7 @@ void Heap_REGCMD (Heap_Module m, Heap_CmdName name, Heap_Command cmd)
} else {
__NEW(c, Heap_CmdDesc);
}
__COPY(name, c->name, ((LONGINT)(24)));
__COPY(name, c->name, 24);
c->cmd = cmd;
c->next = m->cmds;
m->cmds = c;
@ -327,12 +327,12 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
SYSTEM_PTR new;
Heap_Lock();
blksz = __ASHL(__ASHR(size + 63, 5), 5);
new = Heap_NEWREC((LONGINT)(SYSTEM_ADRINT)&blksz);
tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24;
new = Heap_NEWREC((SYSTEM_ADRINT)&blksz);
tag = (__VAL(LONGINT, new) + blksz) - 24;
__PUT(tag - 8, 0, LONGINT);
__PUT(tag, blksz, LONGINT);
__PUT(tag + 8, -8, LONGINT);
__PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT);
__PUT(__VAL(LONGINT, new) - 8, tag, LONGINT);
Heap_Unlock();
_o_result = new;
return _o_result;
@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q)
__GET(tag, offset, LONGINT);
fld = q + offset;
p = Heap_FetchAddress(fld);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
__PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR);
} else {
fld = q + offset;
n = Heap_FetchAddress(fld);
@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q)
if (!__ODD(tagbits)) {
__PUT(n - 8, tagbits + 1, LONGINT);
__PUT(q - 8, tag + 1, LONGINT);
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR);
__PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR);
p = q;
q = n;
tag = tagbits;
@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q)
static void Heap_MarkP (SYSTEM_PTR p)
{
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
Heap_Mark(__VAL(LONGINT, p));
}
static void Heap_Scan (void)
@ -554,7 +554,7 @@ static void Heap_Finalize (void)
} else {
prev->next = n->next;
}
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
if (prev == NIL) {
n = Heap_fin;
} else {
@ -573,7 +573,7 @@ void Heap_FINALL (void)
while (Heap_fin != NIL) {
n = Heap_fin;
Heap_fin = Heap_fin->next;
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
}
}
@ -590,9 +590,9 @@ static void Heap_MarkStack (LONGINT n, LONGINT *cand, LONGINT cand__len)
}
if (n == 0) {
nofcand = 0;
sp = (LONGINT)(SYSTEM_ADRINT)&frame;
sp = (SYSTEM_ADRINT)&frame;
stack0 = Heap_PlatformMainStackFrame();
inc = (LONGINT)(SYSTEM_ADRINT)&align.p - (LONGINT)(SYSTEM_ADRINT)&align;
inc = (SYSTEM_ADRINT)&align.p - (SYSTEM_ADRINT)&align;
if (sp > stack0) {
inc = -inc;
}
@ -681,7 +681,7 @@ void Heap_GC (BOOLEAN markStack)
i22 += 23;
i23 += 24;
if ((i0 == -99 && i15 == 24)) {
Heap_MarkStack(((LONGINT)(32)), (void*)cand, ((LONGINT)(10000)));
Heap_MarkStack(32, (void*)cand, 10000);
break;
}
}
@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
{
Heap_FinNode f;
__NEW(f, Heap_FinDesc);
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
f->obj = __VAL(LONGINT, obj);
f->finalize = finalize;
f->marked = 1;
f->next = Heap_fin;
@ -709,7 +709,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize)
void Heap_InitHeap (void)
{
Heap_heap = Heap_NewChunk(((LONGINT)(256000)));
Heap_heap = Heap_NewChunk(256000);
Heap_heapend = Heap_FetchAddress(Heap_heap + 8);
__PUT(Heap_heap, 0, LONGINT);
Heap_allocated = 0;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tskSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h
#define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE
#include "SYSTEM.h"
#include "Console.h"
@ -84,10 +84,10 @@ Modules_Module Modules_ThisMod (CHAR *name, LONGINT name__len)
Modules_resMsg[0] = 0x00;
} else {
Modules_res = 1;
__COPY(name, Modules_importing, ((LONGINT)(20)));
__COPY(name, Modules_importing, 20);
__MOVE(" module \"", Modules_resMsg, 10);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12);
Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
}
_o_result = m;
__DEL(name);
@ -112,11 +112,11 @@ Modules_Command Modules_ThisCommand (Modules_Module mod, CHAR *name, LONGINT nam
} else {
Modules_res = 2;
__MOVE(" command \"", Modules_resMsg, 11);
__COPY(name, Modules_importing, ((LONGINT)(20)));
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), mod->name, ((LONGINT)(20)));
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)".", (LONGINT)2);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), name, name__len);
Modules_Append((void*)Modules_resMsg, ((LONGINT)(256)), (CHAR*)"\" not found", (LONGINT)12);
__COPY(name, Modules_importing, 20);
Modules_Append((void*)Modules_resMsg, 256, mod->name, 20);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)".", 2);
Modules_Append((void*)Modules_resMsg, 256, name, name__len);
Modules_Append((void*)Modules_resMsg, 256, (CHAR*)"\" not found", 12);
_o_result = NIL;
__DEL(name);
return _o_result;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h
#define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE
#include "SYSTEM.h"
#include "OPM.h"
@ -272,7 +272,7 @@ OPT_Node OPB_NewString (OPS_String str, LONGINT len)
x->conval->intval = -1;
x->conval->intval2 = len;
x->conval->ext = OPT_NewExt();
__COPY(str, *x->conval->ext, ((LONGINT)(256)));
__COPY(str, *x->conval->ext, 256);
_o_result = x;
return _o_result;
}
@ -619,7 +619,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
case 22:
if (f == 3) {
if (z->class == 7) {
z->conval->intval = (int)__CAP((CHAR)z->conval->intval);
z->conval->intval = __CAP((CHAR)z->conval->intval);
z->obj = NIL;
} else {
z = NewOp__29(op, typ, z);
@ -667,8 +667,8 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
z->typ = OPT_booltyp;
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", (LONGINT)33);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.MOp, op = ", 33);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -827,8 +827,8 @@ static INTEGER ConstCmp__14 (void)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", (LONGINT)37);
OPM_LogWNum(*ConstOp__13_s->f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstCmp, f = ", 37);
OPM_LogWNum(*ConstOp__13_s->f, 0);
OPM_LogWLn();
break;
}
@ -1106,8 +1106,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", (LONGINT)37);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.ConstOp, op = ", 37);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -1155,7 +1155,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
}
}
(*x)->obj = NIL;
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((int)(*x)->left->typ->form < f || f > g))) {
} else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) {
if ((*x)->left->typ == typ) {
*x = (*x)->left;
}
@ -1208,11 +1208,11 @@ static BOOLEAN strings__41 (OPT_Node *x, OPT_Node *y)
if ((*Op__38_s->f == 10 && (*x)->conval->intval2 == 1)) {
(*x)->typ = OPT_chartyp;
(*x)->conval->intval = 0;
OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*y, OPB_NewIntConst(0));
} else if ((*Op__38_s->g == 10 && (*y)->conval->intval2 == 1)) {
(*y)->typ = OPT_chartyp;
(*y)->conval->intval = 0;
OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*x, OPB_NewIntConst(0));
}
}
_o_result = ok;
@ -1476,7 +1476,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
typ = OPT_booltyp;
} else {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ELSE in Op()", (LONGINT)13);
OPM_LogWStr((CHAR*)"ELSE in Op()", 13);
OPM_LogWLn();
OPB_err(108);
typ = OPT_undftyp;
@ -1484,8 +1484,8 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
NewOp__39(op, typ, &z, y);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32);
OPM_LogWNum(op, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", 32);
OPM_LogWNum(op, 0);
OPM_LogWLn();
break;
}
@ -1557,24 +1557,24 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
OPT_Struct p = NIL, q = NIL;
if (OPM_Verbose) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", (LONGINT)22);
OPM_LogWStr((CHAR*)"PROCEDURE CheckAssign", 22);
OPM_LogWLn();
}
y = ynode->typ;
f = x->form;
g = y->form;
if (OPM_Verbose) {
OPM_LogWStr((CHAR*)"y.form = ", (LONGINT)10);
OPM_LogWNum(y->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"y.form = ", 10);
OPM_LogWNum(y->form, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"f = ", (LONGINT)5);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"f = ", 5);
OPM_LogWNum(f, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"g = ", (LONGINT)5);
OPM_LogWNum(g, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"g = ", 5);
OPM_LogWNum(g, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"ynode.typ.syze = ", (LONGINT)18);
OPM_LogWNum(ynode->typ->size, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"ynode.typ.syze = ", 18);
OPM_LogWNum(ynode->typ->size, 0);
OPM_LogWLn();
}
if (ynode->class == 8 || (ynode->class == 9 && f != 14)) {
@ -1682,8 +1682,8 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", (LONGINT)40);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.CheckAssign, f = ", 40);
OPM_LogWNum(f, 0);
OPM_LogWLn();
break;
}
@ -1775,14 +1775,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
x = OPB_NewBoolConst(0);
break;
case 3:
x = OPB_NewIntConst(((LONGINT)(0)));
x = OPB_NewIntConst(0);
x->typ = OPT_chartyp;
break;
case 4: case 5: case 6:
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
break;
case 9:
x = OPB_NewIntConst(((LONGINT)(0)));
x = OPB_NewIntConst(0);
x->typ = OPT_inttyp;
break;
case 7:
@ -1806,7 +1806,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
x = OPB_NewBoolConst(1);
break;
case 3:
x = OPB_NewIntConst(((LONGINT)(255)));
x = OPB_NewIntConst(255);
x->typ = OPT_chartyp;
break;
case 4: case 5: case 6:
@ -1928,14 +1928,14 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
case 12:
if (x->class != 8) {
OPB_err(110);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
} else if (__IN(f, 0x63fe) || __IN(x->typ->comp, 0x14)) {
(*OPB_typSize)(x->typ);
x->typ->pvused = 1;
x = OPB_NewIntConst(x->typ->size);
} else {
OPB_err(111);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
}
break;
case 21:
@ -1994,8 +1994,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", (LONGINT)39);
OPM_LogWNum(fctno, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPB.StPar0, fctno = ", 39);
OPM_LogWNum(fctno, 0);
OPM_LogWLn();
break;
}
@ -2064,7 +2064,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
if (!__IN(f, 0x70) || x->class != 7) {
OPB_err(69);
} else if (x->typ->size == 1) {
L = (int)x->conval->intval;
L = (SYSTEM_INT32)x->conval->intval;
typ = p->typ;
while ((L > 0 && __IN(typ->comp, 0x0c))) {
typ = typ->BaseTyp;
@ -2322,7 +2322,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno)
}
} else {
if (((fctno == 13 || fctno == 14) && parno == 1)) {
OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(((LONGINT)(1))));
OPB_BindNodes(19, OPT_notyp, &p, OPB_NewIntConst(1));
p->subcl = fctno;
p->right->typ = p->left->typ;
} else if ((fctno == 17 && parno == 1)) {
@ -2344,7 +2344,7 @@ void OPB_StFct (OPT_Node *par0, SHORTINT fctno, INTEGER parno)
} else if (fctno == 32) {
if (parno == 1) {
x = NIL;
OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(((LONGINT)(0))));
OPB_BindNodes(28, OPT_notyp, &x, OPB_NewIntConst(0));
x->conval = OPT_NewConst();
x->conval->intval = OPM_errpos;
OPB_Construct(15, &p, x);
@ -2579,7 +2579,7 @@ void OPB_Assign (OPT_Node *x, OPT_Node y)
} else if (((((((*x)->typ->comp == 2 && (*x)->typ->BaseTyp == OPT_chartyp)) && y->typ->form == 10)) && y->conval->intval2 == 1)) {
y->typ = OPT_chartyp;
y->conval->intval = 0;
OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0))));
OPB_Index(&*x, OPB_NewIntConst(0));
}
if ((((((__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp == OPT_chartyp)) && __IN(y->typ->comp, 0x0c))) && y->typ->BaseTyp == OPT_chartyp)) {
subcl = 18;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h
#define OPB__h

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h
#define OPC__h
@ -38,6 +38,7 @@ import void OPC_Increment (BOOLEAN decrement);
import void OPC_Indent (INTEGER count);
import void OPC_Init (void);
import void OPC_InitTDesc (OPT_Struct typ);
import void OPC_IntLiteral (LONGINT n, LONGINT size);
import void OPC_Len (OPT_Object obj, OPT_Struct array, LONGINT dim);
import LONGINT OPC_NofPtrs (OPT_Struct typ);
import void OPC_SetInclude (BOOLEAN exclude);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE
#include "SYSTEM.h"
#include "Configuration.h"
@ -155,20 +155,20 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
case 'B':
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_IntSize = (int)s[__X(i, s__len)] - 48;
OPM_IntSize = s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_PointerSize = (int)s[__X(i, s__len)] - 48;
OPM_PointerSize = s[__X(i, s__len)] - 48;
}
if (s[__X(i + 1, s__len)] != 0x00) {
i += 1;
OPM_Alignment = (int)s[__X(i, s__len)] - 48;
OPM_Alignment = s[__X(i, s__len)] - 48;
}
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
Files_SetSearchPath((CHAR*)"", (LONGINT)1);
Files_SetSearchPath((CHAR*)"", 1);
break;
case 'F':
*opt = *opt ^ 0x020000;
@ -183,10 +183,10 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
*opt = *opt ^ 0x040000;
break;
default:
OPM_LogWStr((CHAR*)" warning: option ", (LONGINT)19);
OPM_LogWStr((CHAR*)" warning: option ", 19);
OPM_LogW('-');
OPM_LogW(s[__X(i, s__len)]);
OPM_LogWStr((CHAR*)" ignored", (LONGINT)9);
OPM_LogWStr((CHAR*)" ignored", 9);
OPM_LogWLn();
break;
}
@ -200,71 +200,71 @@ BOOLEAN OPM_OpenPar (void)
CHAR s[256];
if (Platform_ArgCount == 1) {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", (LONGINT)27);
OPM_LogWStr(Configuration_versionLong, ((LONGINT)(41)));
OPM_LogWStr((CHAR*)"Vishap Oberon-2 compiler v", 27);
OPM_LogWStr(Configuration_versionLong, 41);
OPM_LogW('.');
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", (LONGINT)84);
OPM_LogWStr((CHAR*)"Based on Ofront by Software Templ OEG, continued by Norayr Chilingarian and others.", 84);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Usage:", (LONGINT)7);
OPM_LogWStr((CHAR*)"Usage:", 7);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr((CHAR*)"voc", (LONGINT)4);
OPM_LogWStr((CHAR*)" options {files {options}}.", (LONGINT)28);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr((CHAR*)"voc", 4);
OPM_LogWStr((CHAR*)" options {files {options}}.", 28);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", (LONGINT)33);
OPM_LogWStr((CHAR*)"Where options = [\"-\" {option} ].", 33);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)" m - generate code for main module", (LONGINT)36);
OPM_LogWStr((CHAR*)" m - generate code for main module", 36);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", (LONGINT)63);
OPM_LogWStr((CHAR*)" M - generate code for main module and link object statically", 63);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" s - generate new symbol file", (LONGINT)31);
OPM_LogWStr((CHAR*)" s - generate new symbol file", 31);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" e - allow extending the module interface", (LONGINT)43);
OPM_LogWStr((CHAR*)" e - allow extending the module interface", 43);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" r - check value ranges", (LONGINT)25);
OPM_LogWStr((CHAR*)" r - check value ranges", 25);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" x - turn off array indices check", (LONGINT)35);
OPM_LogWStr((CHAR*)" x - turn off array indices check", 35);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", (LONGINT)80);
OPM_LogWStr((CHAR*)" a - don't check ASSERTs at runtime, use this option in tested production code", 80);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", (LONGINT)48);
OPM_LogWStr((CHAR*)" p - turn off automatic pointer initialization", 48);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", (LONGINT)101);
OPM_LogWStr((CHAR*)" t - don't check type guards (use in rare cases such as low-level modules where every cycle counts)", 101);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", (LONGINT)67);
OPM_LogWStr((CHAR*)" S - don't call external assembler/compiler, only generate C code", 67);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" c - don't call linker", (LONGINT)24);
OPM_LogWStr((CHAR*)" c - don't call linker", 24);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" f - don't use color output", (LONGINT)29);
OPM_LogWStr((CHAR*)" f - don't use color output", 29);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", (LONGINT)57);
OPM_LogWStr((CHAR*)" F - force writing new symbol file in current directory", 57);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" V - verbose output", (LONGINT)21);
OPM_LogWStr((CHAR*)" V - verbose output", 21);
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", (LONGINT)48);
OPM_LogWStr((CHAR*)"Initial options specify defaults for all files.", 48);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", (LONGINT)56);
OPM_LogWStr((CHAR*)"Options following a filename are specific to that file.", 56);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", (LONGINT)39);
OPM_LogWStr((CHAR*)"Repeating an option toggles its value.", 39);
OPM_LogWLn();
_o_result = 0;
return _o_result;
} else {
OPM_S = 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
OPM_glbopt = 0xe9;
while (s[0] == '-') {
OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_glbopt);
OPM_ScanOptions((void*)s, 256, &OPM_glbopt);
OPM_S += 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
}
_o_result = 1;
return _o_result;
@ -277,12 +277,12 @@ void OPM_InitOptions (void)
CHAR s[256];
OPM_opt = OPM_glbopt;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
while (s[0] == '-') {
OPM_ScanOptions((void*)s, ((LONGINT)(256)), &OPM_opt);
OPM_ScanOptions((void*)s, 256, &OPM_opt);
OPM_S += 1;
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
}
OPM_dontAsm = __IN(13, OPM_opt);
OPM_dontLink = __IN(14, OPM_opt);
@ -308,19 +308,19 @@ void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len)
return;
}
s[0] = 0x00;
Platform_GetArg(OPM_S, (void*)s, ((LONGINT)(256)));
Platform_GetArg(OPM_S, (void*)s, 256);
__NEW(T, Texts_TextDesc);
Texts_Open(T, s, ((LONGINT)(256)));
OPM_LogWStr(s, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
Texts_Open(T, s, 256);
OPM_LogWStr(s, 256);
OPM_LogWStr((CHAR*)" ", 3);
__COPY(s, mname, mname__len);
__COPY(s, OPM_SourceFileName, ((LONGINT)(256)));
__COPY(s, OPM_SourceFileName, 256);
if (T->len == 0) {
OPM_LogWStr(s, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" not found.", (LONGINT)12);
OPM_LogWStr(s, 256);
OPM_LogWStr((CHAR*)" not found.", 12);
OPM_LogWLn();
} else {
Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, ((LONGINT)(0)));
Texts_OpenReader(&OPM_inR, Texts_Reader__typ, T, 0);
*done = 1;
}
OPM_S += 1;
@ -379,25 +379,25 @@ static void OPM_LogErrMsg (INTEGER n)
CHAR buf[1024];
if (n >= 0) {
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"31m", (LONGINT)4);
vt100_SetAttr((CHAR*)"31m", 4);
}
OPM_LogWStr((CHAR*)" err ", (LONGINT)7);
OPM_LogWStr((CHAR*)" err ", 7);
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
} else {
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"35m", (LONGINT)4);
vt100_SetAttr((CHAR*)"35m", 4);
}
OPM_LogWStr((CHAR*)" warning ", (LONGINT)11);
OPM_LogWStr((CHAR*)" warning ", 11);
n = -n;
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
}
OPM_LogWNum(n, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr(errors_errors[__X(n, ((LONGINT)(350)))], ((LONGINT)(128)));
OPM_LogWNum(n, 1);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWStr(errors_errors[__X(n, 350)], 128);
}
static void OPM_FindLine (Files_File f, Files_Rider *r, LONGINT *r__typ, LONGINT pos)
@ -439,37 +439,37 @@ static void OPM_ShowLine (LONGINT pos)
CHAR line[1023];
INTEGER i;
CHAR ch;
f = Files_Old(OPM_SourceFileName, ((LONGINT)(256)));
f = Files_Old(OPM_SourceFileName, 256);
OPM_FindLine(f, &r, Files_Rider__typ, pos);
i = 0;
Files_Read(&r, Files_Rider__typ, (void*)&ch);
while ((((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) && i < 1022)) {
line[__X(i, ((LONGINT)(1023)))] = ch;
line[__X(i, 1023)] = ch;
i += 1;
Files_Read(&r, Files_Rider__typ, (void*)&ch);
}
line[__X(i, ((LONGINT)(1023)))] = 0x00;
line[__X(i, 1023)] = 0x00;
OPM_LogWLn();
OPM_LogWLn();
OPM_LogWNum(OPM_ErrorLineNumber, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)": ", (LONGINT)3);
OPM_LogWStr(line, ((LONGINT)(1023)));
OPM_LogWNum(OPM_ErrorLineNumber, 4);
OPM_LogWStr((CHAR*)": ", 3);
OPM_LogWStr(line, 1023);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)7);
OPM_LogWStr((CHAR*)" ", 7);
if (pos >= OPM_ErrorLineLimitPos) {
pos = OPM_ErrorLineLimitPos - 1;
}
i = (int)(pos - OPM_ErrorLineStartPos);
i = (SYSTEM_INT32)(pos - OPM_ErrorLineStartPos);
while (i > 0) {
OPM_LogW(' ');
i -= 1;
}
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"32m", (LONGINT)4);
vt100_SetAttr((CHAR*)"32m", 4);
}
OPM_LogW('^');
if (!OPM_notColorOutput) {
vt100_SetAttr((CHAR*)"0m", (LONGINT)3);
vt100_SetAttr((CHAR*)"0m", 3);
}
Files_Close(f);
}
@ -485,30 +485,30 @@ void OPM_Mark (INTEGER n, LONGINT pos)
OPM_lasterrpos = pos;
OPM_ShowLine(pos);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWStr((CHAR*)" ", 3);
if (n < 249) {
OPM_LogWStr((CHAR*)" pos", (LONGINT)6);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pos", 6);
OPM_LogWNum(pos, 6);
OPM_LogErrMsg(n);
} else if (n == 255) {
OPM_LogWStr((CHAR*)"pos", (LONGINT)4);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pc ", (LONGINT)6);
OPM_LogWNum(OPM_breakpc, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)"pos", 4);
OPM_LogWNum(pos, 6);
OPM_LogWStr((CHAR*)" pc ", 6);
OPM_LogWNum(OPM_breakpc, 1);
} else if (n == 254) {
OPM_LogWStr((CHAR*)"pc not found", (LONGINT)13);
OPM_LogWStr((CHAR*)"pc not found", 13);
} else {
OPM_LogWStr(OPM_objname, ((LONGINT)(64)));
OPM_LogWStr(OPM_objname, 64);
if (n == 253) {
OPM_LogWStr((CHAR*)" is new, compile with option e", (LONGINT)31);
OPM_LogWStr((CHAR*)" is new, compile with option e", 31);
} else if (n == 252) {
OPM_LogWStr((CHAR*)" is redefined, compile with option s", (LONGINT)37);
OPM_LogWStr((CHAR*)" is redefined, compile with option s", 37);
} else if (n == 251) {
OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", (LONGINT)57);
OPM_LogWStr((CHAR*)" is redefined (private part only), compile with option s", 57);
} else if (n == 250) {
OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", (LONGINT)45);
OPM_LogWStr((CHAR*)" is no longer visible, compile with option s", 45);
} else if (n == 249) {
OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", (LONGINT)49);
OPM_LogWStr((CHAR*)" is not consistently imported, recompile imports", 49);
}
}
}
@ -516,8 +516,8 @@ void OPM_Mark (INTEGER n, LONGINT pos)
if (pos >= 0) {
OPM_ShowLine(pos);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" pos", (LONGINT)6);
OPM_LogWNum(pos, ((LONGINT)(6)));
OPM_LogWStr((CHAR*)" pos", 6);
OPM_LogWNum(pos, 6);
}
OPM_LogErrMsg(n);
if (pos < 0) {
@ -533,19 +533,19 @@ void OPM_err (INTEGER n)
void OPM_FPrint (LONGINT *fp, LONGINT val)
{
*fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT);
*fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT);
}
void OPM_FPrintSet (LONGINT *fp, SET set)
{
OPM_FPrint(&*fp, (LONGINT)set);
OPM_FPrint(&*fp, __VAL(LONGINT, set));
}
void OPM_FPrintReal (LONGINT *fp, REAL real)
{
INTEGER i;
LONGINT l;
__GET((LONGINT)(SYSTEM_ADRINT)&real, i, INTEGER);
__GET((SYSTEM_ADRINT)&real, i, INTEGER);
l = i;
OPM_FPrint(&*fp, l);
}
@ -562,19 +562,19 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG
if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) {
Texts_Scan(&*S, S__typ);
if ((*S).class == 3) {
*size = (int)(*S).i;
*size = (SYSTEM_INT32)(*S).i;
Texts_Scan(&*S, S__typ);
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
if ((*S).class == 3) {
*align = (int)(*S).i;
*align = (SYSTEM_INT32)(*S).i;
Texts_Scan(&*S, S__typ);
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
} else {
OPM_Mark(-157, ((LONGINT)(-1)));
OPM_Mark(-157, -1);
}
__DEL(name);
}
@ -603,40 +603,40 @@ static LONGINT OPM_power0 (LONGINT i, LONGINT j)
static void OPM_VerboseListSizes (void)
{
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size Alignement", (LONGINT)29);
OPM_LogWStr((CHAR*)"Type Size Alignement", 29);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"CHAR ", (LONGINT)14);
OPM_LogWNum(OPM_CharSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"CHAR ", 14);
OPM_LogWNum(OPM_CharSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"BOOLEAN ", (LONGINT)14);
OPM_LogWNum(OPM_BoolSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"BOOLEAN ", 14);
OPM_LogWNum(OPM_BoolSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", (LONGINT)14);
OPM_LogWNum(OPM_SIntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"SHORTINT ", 14);
OPM_LogWNum(OPM_SIntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", (LONGINT)14);
OPM_LogWNum(OPM_IntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"INTEGER ", 14);
OPM_LogWNum(OPM_IntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", (LONGINT)14);
OPM_LogWNum(OPM_LIntSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"LONGINT ", 14);
OPM_LogWNum(OPM_LIntSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", (LONGINT)14);
OPM_LogWNum(OPM_SetSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"SET ", 14);
OPM_LogWNum(OPM_SetSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"REAL ", (LONGINT)14);
OPM_LogWNum(OPM_RealSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"REAL ", 14);
OPM_LogWNum(OPM_RealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGREAL ", (LONGINT)14);
OPM_LogWNum(OPM_LRealSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"LONGREAL ", 14);
OPM_LogWNum(OPM_LRealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PTR ", (LONGINT)14);
OPM_LogWNum(OPM_PointerSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"PTR ", 14);
OPM_LogWNum(OPM_PointerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROC ", (LONGINT)14);
OPM_LogWNum(OPM_ProcSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"PROC ", 14);
OPM_LogWNum(OPM_ProcSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"RECORD ", (LONGINT)14);
OPM_LogWNum(OPM_RecSize, ((LONGINT)(4)));
OPM_LogWStr((CHAR*)"RECORD ", 14);
OPM_LogWNum(OPM_RecSize, 4);
OPM_LogWLn();
OPM_LogWLn();
}
@ -719,11 +719,11 @@ void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done)
{
CHAR ch;
OPM_FileName fileName;
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
OPM_oldSFile = Files_Old(fileName, ((LONGINT)(32)));
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5);
OPM_oldSFile = Files_Old(fileName, 32);
*done = OPM_oldSFile != NIL;
if (*done) {
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, ((LONGINT)(0)));
Files_Set(&OPM_oldSF, Files_Rider__typ, OPM_oldSFile, 0);
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&ch);
if (ch != 0xf7) {
OPM_err(-306);
@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i)
void OPM_SymWSet (SET s)
{
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s);
Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s));
}
void OPM_SymWReal (REAL r)
@ -779,10 +779,10 @@ void OPM_DeleteNewSym (void)
void OPM_NewSym (CHAR *modName, LONGINT modName__len)
{
OPM_FileName fileName;
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
OPM_newSFile = Files_New(fileName, ((LONGINT)(32)));
OPM_MakeFileName((void*)modName, modName__len, (void*)fileName, 32, (CHAR*)".sym", 5);
OPM_newSFile = Files_New(fileName, 32);
if (OPM_newSFile != NIL) {
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, ((LONGINT)(0)));
Files_Set(&OPM_newSF, Files_Rider__typ, OPM_newSFile, 0);
Files_Write(&OPM_newSF, Files_Rider__typ, 0xf7);
} else {
OPM_err(153);
@ -791,7 +791,7 @@ void OPM_NewSym (CHAR *modName, LONGINT modName__len)
void OPM_Write (CHAR ch)
{
Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, ch);
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, ch);
}
void OPM_WriteString (CHAR *s, LONGINT s__len)
@ -801,7 +801,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len)
while (s[__X(i, s__len)] != 0x00) {
i += 1;
}
Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i);
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
@ -811,27 +811,27 @@ void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
while (s[__X(i, s__len)] != 0x00) {
i += 1;
}
Files_WriteBytes(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, (void*)s, s__len * ((LONGINT)(1)), i);
Files_WriteBytes(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, (void*)s, s__len * 1, i);
}
void OPM_WriteHex (LONGINT i)
{
CHAR s[3];
INTEGER digit;
digit = __ASHR((int)i, 4);
digit = __ASHR((SYSTEM_INT32)i, 4);
if (digit < 10) {
s[0] = (CHAR)(48 + digit);
} else {
s[0] = (CHAR)(87 + digit);
}
digit = __MASK((int)i, -16);
digit = __MASK((SYSTEM_INT32)i, -16);
if (digit < 10) {
s[1] = (CHAR)(48 + digit);
} else {
s[1] = (CHAR)(87 + digit);
}
s[2] = 0x00;
OPM_WriteString(s, ((LONGINT)(3)));
OPM_WriteString(s, 3);
}
void OPM_WriteInt (LONGINT i)
@ -841,24 +841,24 @@ void OPM_WriteInt (LONGINT i)
if (i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) {
OPM_Write('(');
OPM_WriteInt(i + 1);
OPM_WriteString((CHAR*)"-1)", (LONGINT)4);
OPM_WriteString((CHAR*)"-1)", 4);
} else {
i1 = __ABS(i);
s[0] = (CHAR)(__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k = 1;
while (i1 > 0) {
s[__X(k, ((LONGINT)(20)))] = (CHAR)(__MOD(i1, 10) + 48);
s[__X(k, 20)] = (CHAR)(__MOD(i1, 10) + 48);
i1 = __DIV(i1, 10);
k += 1;
}
if (i < 0) {
s[__X(k, ((LONGINT)(20)))] = '-';
s[__X(k, 20)] = '-';
k += 1;
}
while (k > 0) {
k -= 1;
OPM_Write(s[__X(k, ((LONGINT)(20)))]);
OPM_Write(s[__X(k, 20)]);
}
}
}
@ -873,9 +873,9 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
INTEGER i;
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) {
if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", (LONGINT)7);
OPM_WriteString((CHAR*)"(REAL)", 7);
} else {
OPM_WriteString((CHAR*)"(LONGREAL)", (LONGINT)11);
OPM_WriteString((CHAR*)"(LONGREAL)", 11);
}
OPM_WriteInt(__ENTIER(r));
} else {
@ -886,33 +886,33 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
Texts_WriteLongReal(&W, Texts_Writer__typ, r, 23);
}
__NEW(T, Texts_TextDesc);
Texts_Open(T, (CHAR*)"", (LONGINT)1);
Texts_Open(T, (CHAR*)"", 1);
Texts_Append(T, W.buf);
Texts_OpenReader(&R, Texts_Reader__typ, T, ((LONGINT)(0)));
Texts_OpenReader(&R, Texts_Reader__typ, T, 0);
i = 0;
Texts_Read(&R, Texts_Reader__typ, &ch);
while (ch != 0x00) {
s[__X(i, ((LONGINT)(32)))] = ch;
s[__X(i, 32)] = ch;
i += 1;
Texts_Read(&R, Texts_Reader__typ, &ch);
}
s[__X(i, ((LONGINT)(32)))] = 0x00;
s[__X(i, 32)] = 0x00;
i = 0;
ch = s[0];
while ((ch != 'D' && ch != 0x00)) {
i += 1;
ch = s[__X(i, ((LONGINT)(32)))];
ch = s[__X(i, 32)];
}
if (ch == 'D') {
s[__X(i, ((LONGINT)(32)))] = 'e';
s[__X(i, 32)] = 'e';
}
OPM_WriteString(s, ((LONGINT)(32)));
OPM_WriteString(s, 32);
}
}
void OPM_WriteLn (void)
{
Files_Write(&OPM_R[__X(OPM_currFile, ((LONGINT)(3)))], Files_Rider__typ, 0x0a);
Files_Write(&OPM_R[__X(OPM_currFile, 3)], Files_Rider__typ, 0x0a);
}
static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
@ -920,11 +920,11 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
Files_Rider R1;
CHAR buffer[4096];
if (F != NIL) {
Files_Set(&R1, Files_Rider__typ, F, ((LONGINT)(0)));
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096)));
Files_Set(&R1, Files_Rider__typ, F, 0);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096);
while (4096 - R1.res > 0) {
Files_WriteBytes(&*R, R__typ, (void*)buffer, ((LONGINT)(4096)), 4096 - R1.res);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, ((LONGINT)(4096)), ((LONGINT)(4096)));
Files_WriteBytes(&*R, R__typ, (void*)buffer, 4096, 4096 - R1.res);
Files_ReadBytes(&R1, Files_Rider__typ, (void*)buffer, 4096, 4096);
}
}
}
@ -932,24 +932,24 @@ static void OPM_Append (Files_Rider *R, LONGINT *R__typ, Files_File F)
void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len)
{
CHAR FName[32];
__COPY(moduleName, OPM_modName, ((LONGINT)(32)));
OPM_HFile = Files_New((CHAR*)"", (LONGINT)1);
__COPY(moduleName, OPM_modName, 32);
OPM_HFile = Files_New((CHAR*)"", 1);
if (OPM_HFile != NIL) {
Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, ((LONGINT)(0)));
Files_Set(&OPM_R[0], Files_Rider__typ, OPM_HFile, 0);
} else {
OPM_err(153);
}
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".c", (LONGINT)3);
OPM_BFile = Files_New(FName, ((LONGINT)(32)));
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".c", 3);
OPM_BFile = Files_New(FName, 32);
if (OPM_BFile != NIL) {
Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, ((LONGINT)(0)));
Files_Set(&OPM_R[1], Files_Rider__typ, OPM_BFile, 0);
} else {
OPM_err(153);
}
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3);
OPM_HIFile = Files_New(FName, ((LONGINT)(32)));
OPM_MakeFileName((void*)moduleName, moduleName__len, (void*)FName, 32, (CHAR*)".h", 3);
OPM_HIFile = Files_New(FName, 32);
if (OPM_HIFile != NIL) {
Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, ((LONGINT)(0)));
Files_Set(&OPM_R[2], Files_Rider__typ, OPM_HIFile, 0);
} else {
OPM_err(153);
}
@ -960,9 +960,9 @@ void OPM_CloseFiles (void)
CHAR FName[32];
INTEGER res;
if (OPM_noerr) {
OPM_LogWStr((CHAR*)" ", (LONGINT)3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), ((LONGINT)(0)));
OPM_LogWStr((CHAR*)" chars.", (LONGINT)8);
OPM_LogWStr((CHAR*)" ", 3);
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0);
OPM_LogWStr((CHAR*)" chars.", 8);
}
if (OPM_noerr) {
if (__STRCMP(OPM_modName, "SYSTEM") == 0) {
@ -974,10 +974,10 @@ void OPM_CloseFiles (void)
Files_Register(OPM_HIFile);
Files_Register(OPM_BFile);
} else {
OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".h", (LONGINT)3);
Files_Delete(FName, ((LONGINT)(32)), &res);
OPM_MakeFileName((void*)OPM_modName, ((LONGINT)(32)), (void*)FName, ((LONGINT)(32)), (CHAR*)".sym", (LONGINT)5);
Files_Delete(FName, ((LONGINT)(32)), &res);
OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".h", 3);
Files_Delete(FName, 32, &res);
OPM_MakeFileName((void*)OPM_modName, 32, (void*)FName, 32, (CHAR*)".sym", 5);
Files_Delete(FName, 32, &res);
Files_Register(OPM_BFile);
}
}
@ -986,11 +986,11 @@ void OPM_CloseFiles (void)
OPM_HIFile = NIL;
OPM_newSFile = NIL;
OPM_oldSFile = NIL;
Files_Set(&OPM_R[0], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[1], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[2], Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_newSF, Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, ((LONGINT)(0)));
Files_Set(&OPM_R[0], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_R[1], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_R[2], Files_Rider__typ, NIL, 0);
Files_Set(&OPM_newSF, Files_Rider__typ, NIL, 0);
Files_Set(&OPM_oldSF, Files_Rider__typ, NIL, 0);
}
static void EnumPtrs(void (*P)(void*))
@ -1031,15 +1031,15 @@ export void *OPM__init(void)
/* BEGIN */
Texts_OpenWriter(&OPM_W, Texts_Writer__typ);
OPM_MODULES[0] = 0x00;
Platform_GetEnv((CHAR*)"MODULES", (LONGINT)8, (void*)OPM_MODULES, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"MODULES", 8, (void*)OPM_MODULES, 1024);
__MOVE(".", OPM_OBERON, 2);
Platform_GetEnv((CHAR*)"OBERON", (LONGINT)7, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)";.;", (LONGINT)4, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append(OPM_MODULES, ((LONGINT)(1024)), (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)";", (LONGINT)2, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)"/opt/voc", (LONGINT)9, (void*)OPM_OBERON, ((LONGINT)(1024)));
Strings_Append((CHAR*)"/sym;", (LONGINT)6, (void*)OPM_OBERON, ((LONGINT)(1024)));
Files_SetSearchPath(OPM_OBERON, ((LONGINT)(1024)));
Platform_GetEnv((CHAR*)"OBERON", 7, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)";.;", 4, (void*)OPM_OBERON, 1024);
Strings_Append(OPM_MODULES, 1024, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)";", 2, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024);
OPM_CharSize = 1;
OPM_BoolSize = 1;
OPM_SIntSize = 1;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h
#define OPM__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE
#include "SYSTEM.h"
#include "OPB.h"
@ -59,7 +59,7 @@ static void OPP_err (INTEGER n)
static void OPP_CheckSym (INTEGER s)
{
if ((int)OPP_sym == s) {
if (OPP_sym == s) {
OPS_Get(&OPP_sym);
} else {
OPM_err(s);
@ -105,7 +105,7 @@ static void OPP_ConstExpression (OPT_Node *x)
OPP_Expression(&*x);
if ((*x)->class != 7) {
OPP_err(50);
*x = OPB_NewIntConst(((LONGINT)(1)));
*x = OPB_NewIntConst(1);
}
}
@ -147,7 +147,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
OPP_err(51);
sf = 0;
}
*sysflag = (int)sf;
*sysflag = (SYSTEM_INT32)sf;
OPP_CheckSym(23);
} else {
*sysflag = default_;
@ -309,13 +309,13 @@ static void OPP_PointerType (OPT_Struct *typ)
OPT_Find(&id);
if (id == NIL) {
if (OPP_nofFwdPtr < 64) {
OPP_FwdPtr[__X(OPP_nofFwdPtr, ((LONGINT)(64)))] = *typ;
OPP_FwdPtr[__X(OPP_nofFwdPtr, 64)] = *typ;
OPP_nofFwdPtr += 1;
} else {
OPP_err(224);
}
(*typ)->link = OPT_NewObj();
__COPY(OPS_name, (*typ)->link->name, ((LONGINT)(256)));
__COPY(OPS_name, (*typ)->link->name, 256);
(*typ)->BaseTyp = OPT_undftyp;
OPS_Get(&OPP_sym);
} else {
@ -519,7 +519,7 @@ static void OPP_selector (OPT_Node *x)
} else if (OPP_sym == 18) {
OPS_Get(&OPP_sym);
if (OPP_sym == 38) {
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPS_Get(&OPP_sym);
if ((*x)->typ != NIL) {
if ((*x)->typ->form == 13) {
@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x)
OPT_Node y = NIL;
SHORTINT m;
INTEGER n;
m = (int)(*x)->obj->adr;
m = (SYSTEM_INT8)(*x)->obj->adr;
n = 0;
if (OPP_sym == 30) {
OPS_Get(&OPP_sym);
@ -743,8 +743,8 @@ static void OPP_Factor (OPT_Node *x)
*x = OPB_NewRealConst(OPS_lrlval, OPT_lrltyp);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", (LONGINT)44);
OPM_LogWNum(OPS_numtyp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in OPP.Factor, OPS.numtyp = ", 44);
OPM_LogWNum(OPS_numtyp, 0);
OPM_LogWLn();
break;
}
@ -777,7 +777,7 @@ static void OPP_Factor (OPT_Node *x)
*x = NIL;
}
if (*x == NIL) {
*x = OPB_NewIntConst(((LONGINT)(1)));
*x = OPB_NewIntConst(1);
(*x)->typ = OPT_undftyp;
}
}
@ -859,7 +859,7 @@ static void OPP_Receiver (SHORTINT *mode, OPS_Name name, OPT_Struct *typ, OPT_St
} else {
*mode = 1;
}
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPP_CheckSym(38);
OPP_CheckSym(20);
if (OPP_sym == 38) {
@ -933,8 +933,8 @@ static void GetCode__19 (void)
(*ProcedureDeclaration__16_s->proc)->conval->ext = ext;
n = 0;
if (OPP_sym == 37) {
while (OPS_str[__X(n, ((LONGINT)(256)))] != 0x00) {
(*ext)[__X(n + 1, ((LONGINT)(256)))] = OPS_str[__X(n, ((LONGINT)(256)))];
while (OPS_str[__X(n, 256)] != 0x00) {
(*ext)[__X(n + 1, 256)] = OPS_str[__X(n, 256)];
n += 1;
}
(*ext)[0] = (CHAR)n;
@ -950,7 +950,7 @@ static void GetCode__19 (void)
n = 1;
}
OPS_Get(&OPP_sym);
(*ext)[__X(n, ((LONGINT)(256)))] = (CHAR)c;
(*ext)[__X(n, 256)] = (CHAR)c;
}
if (OPP_sym == 19) {
OPS_Get(&OPP_sym);
@ -1024,7 +1024,7 @@ static void TProcDecl__23 (void)
}
OPP_Receiver(&objMode, objName, &objTyp, &recTyp);
if (OPP_sym == 38) {
__COPY(OPS_name, *ProcedureDeclaration__16_s->name, ((LONGINT)(256)));
__COPY(OPS_name, *ProcedureDeclaration__16_s->name, 256);
OPP_CheckMark(&*ProcedureDeclaration__16_s->vis);
OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp, &*ProcedureDeclaration__16_s->fwd);
OPT_FindField(*ProcedureDeclaration__16_s->name, recTyp->BaseTyp, &baseProc);
@ -1123,7 +1123,7 @@ static void OPP_ProcedureDeclaration (OPT_Node *x)
TProcDecl__23();
} else if (OPP_sym == 38) {
OPT_Find(&fwd);
__COPY(OPS_name, name, ((LONGINT)(256)));
__COPY(OPS_name, name, 256);
OPP_CheckMark(&vis);
if ((vis != 0 && mode == 6)) {
mode = 7;
@ -1184,14 +1184,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) {
OPP_err(60);
}
} else if ((int)LabelTyp->form != f) {
} else if (LabelTyp->form != f) {
OPP_err(60);
}
if (OPP_sym == 21) {
OPS_Get(&OPP_sym);
OPP_ConstExpression(&y);
yval = y->conval->intval;
if (((int)y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) {
if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) {
OPP_err(60);
}
if (yval < xval) {
@ -1208,17 +1208,17 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
if (i == 0) {
break;
}
if (tab[__X(i - 1, ((LONGINT)(128)))].low <= yval) {
if (tab[__X(i - 1, ((LONGINT)(128)))].high >= xval) {
if (tab[__X(i - 1, 128)].low <= yval) {
if (tab[__X(i - 1, 128)].high >= xval) {
OPP_err(62);
}
break;
}
tab[__X(i, ((LONGINT)(128)))] = tab[__X(i - 1, ((LONGINT)(128)))];
tab[__X(i, 128)] = tab[__X(i - 1, 128)];
i -= 1;
}
tab[__X(i, ((LONGINT)(128)))].low = xval;
tab[__X(i, ((LONGINT)(128)))].high = yval;
tab[__X(i, 128)].low = xval;
tab[__X(i, 128)].high = yval;
*n += 1;
} else {
OPP_err(213);
@ -1277,7 +1277,7 @@ static void CasePart__31 (OPT_Node *x)
}
if (n > 0) {
low = tab[0].low;
high = tab[__X(n - 1, ((LONGINT)(128)))].high;
high = tab[__X(n - 1, 128)].high;
if (high - low > 512) {
OPP_err(209);
}
@ -1480,7 +1480,7 @@ static void OPP_StatSeq (OPT_Node *stat)
OPS_Get(&OPP_sym);
OPP_ConstExpression(&z);
} else {
z = OPB_NewIntConst(((LONGINT)(1)));
z = OPB_NewIntConst(1);
}
pos = OPM_errpos;
x = OPB_NewLeaf(id);
@ -1643,7 +1643,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
OPP_ConstExpression(&x);
} else {
OPP_err(9);
x = OPB_NewIntConst(((LONGINT)(1)));
x = OPB_NewIntConst(1);
}
obj->mode = 3;
obj->typ = x->typ;
@ -1674,7 +1674,7 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
if (__IN(obj->typ->comp, 0x1c)) {
i = 0;
while (i < OPP_nofFwdPtr) {
typ = OPP_FwdPtr[__X(i, ((LONGINT)(64)))];
typ = OPP_FwdPtr[__X(i, 64)];
i += 1;
if (__STRCMP(typ->link->name, obj->name) == 0) {
typ->BaseTyp = obj->typ;
@ -1736,10 +1736,10 @@ static void OPP_Block (OPT_Node *procdec, OPT_Node *statseq)
}
i = 0;
while (i < OPP_nofFwdPtr) {
if (OPP_FwdPtr[__X(i, ((LONGINT)(64)))]->link->name[0] != 0x00) {
if (OPP_FwdPtr[__X(i, 64)]->link->name[0] != 0x00) {
OPP_err(128);
}
OPP_FwdPtr[__X(i, ((LONGINT)(64)))] = NIL;
OPP_FwdPtr[__X(i, 64)] = NIL;
i += 1;
}
OPT_topScope->adr = OPM_errpos;
@ -1785,28 +1785,28 @@ void OPP_Module (OPT_Node *prog, SET opt)
OPS_Get(&OPP_sym);
} else {
OPM_LogWLn();
OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", (LONGINT)46);
OPM_LogWStr((CHAR*)"Unexpected symbol found when MODULE expected:", 46);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" sym: ", (LONGINT)15);
OPM_LogWNum(OPP_sym, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" sym: ", 15);
OPM_LogWNum(OPP_sym, 1);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.name: ", (LONGINT)15);
OPM_LogWStr(OPS_name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" OPS.name: ", 15);
OPM_LogWStr(OPS_name, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.str: ", (LONGINT)15);
OPM_LogWStr(OPS_str, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)" OPS.str: ", 15);
OPM_LogWStr(OPS_str, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.numtyp: ", (LONGINT)15);
OPM_LogWNum(OPS_numtyp, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" OPS.numtyp: ", 15);
OPM_LogWNum(OPS_numtyp, 1);
OPM_LogWLn();
OPM_LogWStr((CHAR*)" OPS.intval: ", (LONGINT)15);
OPM_LogWNum(OPS_intval, ((LONGINT)(1)));
OPM_LogWStr((CHAR*)" OPS.intval: ", 15);
OPM_LogWNum(OPS_intval, 1);
OPM_LogWLn();
OPP_err(16);
}
if (OPP_sym == 38) {
OPM_LogWStr((CHAR*)"compiling ", (LONGINT)11);
OPM_LogWStr(OPS_name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)"compiling ", 11);
OPM_LogWStr(OPS_name, 256);
OPM_LogW('.');
OPT_Init(OPS_name, opt);
OPS_Get(&OPP_sym);
@ -1815,13 +1815,13 @@ void OPP_Module (OPT_Node *prog, SET opt)
OPS_Get(&OPP_sym);
for (;;) {
if (OPP_sym == 38) {
__COPY(OPS_name, aliasName, ((LONGINT)(256)));
__COPY(aliasName, impName, ((LONGINT)(256)));
__COPY(OPS_name, aliasName, 256);
__COPY(aliasName, impName, 256);
OPS_Get(&OPP_sym);
if (OPP_sym == 34) {
OPS_Get(&OPP_sym);
if (OPP_sym == 38) {
__COPY(OPS_name, impName, ((LONGINT)(256)));
__COPY(OPS_name, impName, 256);
OPS_Get(&OPP_sym);
} else {
OPP_err(38);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h
#define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#define LARGE
#include "SYSTEM.h"
#include "OPM.h"
@ -60,7 +60,7 @@ static void OPS_Str (SHORTINT *sym)
if (OPS_intval == 2) {
*sym = 35;
OPS_numtyp = 1;
OPS_intval = (int)OPS_str[0];
OPS_intval = OPS_str[0];
} else {
*sym = 37;
}
@ -113,10 +113,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex)
{
INTEGER _o_result;
if (ch <= '9') {
_o_result = (int)ch - 48;
_o_result = ch - 48;
return _o_result;
} else if (hex) {
_o_result = ((int)ch - 65) + 10;
_o_result = (ch - 65) + 10;
return _o_result;
} else {
OPS_err(2);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin tspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h
#define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#define LARGE
#include "SYSTEM.h"
#include "OPM.h"
@ -163,10 +163,10 @@ OPT_Struct OPT_IntType (LONGINT size)
OPT_Struct _o_result;
INTEGER i;
i = 1;
while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))]->size < size && OPT_IntTypes[__X(i + 1, ((LONGINT)(20)))] != NIL)) {
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
i += 1;
}
_o_result = OPT_IntTypes[__X(i, ((LONGINT)(20)))];
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
}
@ -178,11 +178,11 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
__ASSERT(dir == 1 || dir == -1, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
i = 0;
while ((OPT_IntTypes[__X(i, ((LONGINT)(20)))] != x && i < 20)) {
while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) {
i += 1;
}
__ASSERT(i < 19, 0);
_o_result = OPT_IntTypes[__X(i + dir, ((LONGINT)(20)))];
_o_result = OPT_IntTypes[__X(i + dir, 20)];
return _o_result;
}
@ -235,7 +235,7 @@ OPT_ConstExt OPT_NewExt (void)
{
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, ((LONGINT)(1)), 1, 1, 0, (LONGINT)256);
ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256)));
_o_result = ext;
return _o_result;
}
@ -266,8 +266,8 @@ void OPT_Init (OPS_Name name, SET opt)
OPT_topScope = OPT_universe;
OPT_OpenScope(0, NIL);
OPT_SYSimported = 0;
__COPY(name, OPT_SelfName, ((LONGINT)(256)));
__COPY(name, OPT_topScope->name, ((LONGINT)(256)));
__COPY(name, OPT_SelfName, 256);
__COPY(name, OPT_topScope->name, 256);
OPT_GlbMod[0] = OPT_topScope;
OPT_nofGmod = 1;
OPT_newsf = __IN(4, opt);
@ -282,13 +282,13 @@ void OPT_Close (void)
OPT_CloseScope();
i = 0;
while (i < 64) {
OPT_GlbMod[__X(i, ((LONGINT)(64)))] = NIL;
OPT_GlbMod[__X(i, 64)] = NIL;
i += 1;
}
i = 16;
while (i < 255) {
OPT_impCtxt.ref[__X(i, ((LONGINT)(255)))] = NIL;
OPT_impCtxt.old[__X(i, ((LONGINT)(255)))] = NIL;
OPT_impCtxt.ref[__X(i, 255)] = NIL;
OPT_impCtxt.old[__X(i, 255)] = NIL;
i += 1;
}
}
@ -399,7 +399,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
}
ob1->left = NIL;
ob1->right = NIL;
__COPY(name, ob1->name, ((LONGINT)(256)));
__COPY(name, ob1->name, 256);
mnolev = OPT_topScope->mnolev;
ob1->mnolev = mnolev;
break;
@ -415,7 +415,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len)
i = 0;
do {
ch = name[__X(i, name__len)];
OPM_FPrint(&*fp, (int)ch);
OPM_FPrint(&*fp, ch);
i += 1;
} while (!(ch == 0x00));
}
@ -424,32 +424,32 @@ static void OPT_DebugStruct (OPT_Struct btyp)
{
OPM_LogWLn();
if (btyp == NIL) {
OPM_LogWStr((CHAR*)"btyp is nil", (LONGINT)12);
OPM_LogWStr((CHAR*)"btyp is nil", 12);
OPM_LogWLn();
}
OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", (LONGINT)23);
OPM_LogWStr(btyp->strobj->name, ((LONGINT)(256)));
OPM_LogWStr((CHAR*)"btyp^.strobji^.name = ", 23);
OPM_LogWStr(btyp->strobj->name, 256);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.form = ", (LONGINT)14);
OPM_LogWNum(btyp->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.form = ", 14);
OPM_LogWNum(btyp->form, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.comp = ", (LONGINT)14);
OPM_LogWNum(btyp->comp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.comp = ", 14);
OPM_LogWNum(btyp->comp, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.mno = ", (LONGINT)13);
OPM_LogWNum(btyp->mno, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.mno = ", 13);
OPM_LogWNum(btyp->mno, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.extlev = ", (LONGINT)16);
OPM_LogWNum(btyp->extlev, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.extlev = ", 16);
OPM_LogWNum(btyp->extlev, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.size = ", (LONGINT)14);
OPM_LogWNum(btyp->size, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.size = ", 14);
OPM_LogWNum(btyp->size, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.align = ", (LONGINT)15);
OPM_LogWNum(btyp->align, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.align = ", 15);
OPM_LogWNum(btyp->align, 0);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"btyp^.txtpos = ", (LONGINT)16);
OPM_LogWNum(btyp->txtpos, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"btyp^.txtpos = ", 16);
OPM_LogWNum(btyp->txtpos, 0);
OPM_LogWLn();
}
@ -481,8 +481,8 @@ void OPT_IdFPrint (OPT_Struct typ)
btyp = typ->BaseTyp;
strobj = typ->strobj;
if ((strobj != NIL && strobj->name[0] != 0x00)) {
OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, ((LONGINT)(64)))]->name, ((LONGINT)(256)));
OPT_FPrintName(&idfp, (void*)strobj->name, ((LONGINT)(256)));
OPT_FPrintName(&idfp, (void*)OPT_GlbMod[__X(typ->mno, 64)]->name, 256);
OPT_FPrintName(&idfp, (void*)strobj->name, 256);
}
if ((f == 13 || (c == 4 && btyp != NIL)) || c == 3) {
OPT_IdFPrint(btyp);
@ -533,7 +533,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr)
}
}
} else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) {
OPM_FPrint(&*FPrintStr__12_s->pvfp, ((LONGINT)(13)));
OPM_FPrint(&*FPrintStr__12_s->pvfp, 13);
OPM_FPrint(&*FPrintStr__12_s->pvfp, adr);
OPT_nofhdfld += 1;
}
@ -544,7 +544,7 @@ static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible)
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis);
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, ((LONGINT)(256)));
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256);
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr);
OPT_FPrintStr(fld->typ);
OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp);
@ -562,10 +562,10 @@ static void FPrintTProcs__17 (OPT_Object obj)
FPrintTProcs__17(obj->left);
if (obj->mode == 13) {
if (obj->vis != 0) {
OPM_FPrint(&*FPrintStr__12_s->pbfp, ((LONGINT)(13)));
OPM_FPrint(&*FPrintStr__12_s->pbfp, 13);
OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16));
OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link);
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, ((LONGINT)(256)));
OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256);
}
}
FPrintTProcs__17(obj->right);
@ -619,7 +619,7 @@ void OPT_FPrintStr (OPT_Struct typ)
OPM_FPrint(&pvfp, typ->align);
OPM_FPrint(&pvfp, typ->n);
OPT_nofhdfld = 0;
FPrintFlds__13(typ->link, ((LONGINT)(0)), 1);
FPrintFlds__13(typ->link, 0, 1);
if (OPT_nofhdfld > 2048) {
OPM_Mark(225, typ->txtpos);
}
@ -664,7 +664,7 @@ void OPT_FPrintObj (OPT_Object obj)
OPM_FPrintLReal(&fprint, obj->conval->realval);
break;
case 10:
OPT_FPrintName(&fprint, (void*)*obj->conval->ext, ((LONGINT)(256)));
OPT_FPrintName(&fprint, (void*)*obj->conval->ext, 256);
break;
case 11:
break;
@ -681,11 +681,11 @@ void OPT_FPrintObj (OPT_Object obj)
} else if (obj->mode == 9) {
OPT_FPrintSign(&fprint, obj->typ, obj->link);
ext = obj->conval->ext;
m = (int)(*ext)[0];
m = (*ext)[0];
f = 1;
OPM_FPrint(&fprint, m);
while (f <= m) {
OPM_FPrint(&fprint, (int)(*ext)[__X(f, ((LONGINT)(256)))]);
OPM_FPrint(&fprint, (*ext)[__X(f, 256)]);
f += 1;
}
} else if (obj->mode == 5) {
@ -701,22 +701,22 @@ void OPT_FPrintErr (OPT_Object obj, INTEGER errcode)
INTEGER i, j;
CHAR ch;
if (obj->mnolev != 0) {
__COPY(OPT_GlbMod[__X(-obj->mnolev, ((LONGINT)(64)))]->name, OPM_objname, ((LONGINT)(64)));
__COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64);
i = 0;
while (OPM_objname[__X(i, ((LONGINT)(64)))] != 0x00) {
while (OPM_objname[__X(i, 64)] != 0x00) {
i += 1;
}
OPM_objname[__X(i, ((LONGINT)(64)))] = '.';
OPM_objname[__X(i, 64)] = '.';
j = 0;
i += 1;
do {
ch = obj->name[__X(j, ((LONGINT)(256)))];
OPM_objname[__X(i, ((LONGINT)(64)))] = ch;
ch = obj->name[__X(j, 256)];
OPM_objname[__X(i, 64)] = ch;
j += 1;
i += 1;
} while (!(ch == 0x00));
} else {
__COPY(obj->name, OPM_objname, ((LONGINT)(64)));
__COPY(obj->name, OPM_objname, 64);
}
if (errcode == 249) {
if (OPM_noerr) {
@ -809,12 +809,12 @@ static void OPT_InMod (SHORTINT *mno)
*mno = OPT_impCtxt.glbmno[0];
} else {
if (mn == 16) {
OPT_InName((void*)name, ((LONGINT)(256)));
OPT_InName((void*)name, 256);
if ((__STRCMP(name, OPT_SelfName) == 0 && !OPT_impCtxt.self)) {
OPT_err(154);
}
i = 0;
while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, ((LONGINT)(64)))]->name) != 0)) {
while ((i < OPT_nofGmod && __STRCMP(name, OPT_GlbMod[__X(i, 64)]->name) != 0)) {
i += 1;
}
if (i < OPT_nofGmod) {
@ -822,20 +822,20 @@ static void OPT_InMod (SHORTINT *mno)
} else {
head = OPT_NewObj();
head->mode = 12;
__COPY(name, head->name, ((LONGINT)(256)));
__COPY(name, head->name, 256);
*mno = OPT_nofGmod;
head->mnolev = -*mno;
if (OPT_nofGmod < 64) {
OPT_GlbMod[__X(*mno, ((LONGINT)(64)))] = head;
OPT_GlbMod[__X(*mno, 64)] = head;
OPT_nofGmod += 1;
} else {
OPT_err(227);
}
}
OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, ((LONGINT)(64)))] = *mno;
OPT_impCtxt.glbmno[__X(OPT_impCtxt.nofm, 64)] = *mno;
OPT_impCtxt.nofm += 1;
} else {
*mno = OPT_impCtxt.glbmno[__X(-mn, ((LONGINT)(64)))];
*mno = OPT_impCtxt.glbmno[__X(-mn, 64)];
}
}
}
@ -849,7 +849,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
switch (f) {
case 1: case 3: case 2:
OPM_SymRCh(&ch);
conval->intval = (int)ch;
conval->intval = ch;
break;
case 4: case 5: case 6:
conval->intval = OPM_SymRInt();
@ -872,7 +872,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
i = 0;
do {
OPM_SymRCh(&ch);
(*ext)[__X(i, ((LONGINT)(256)))] = ch;
(*ext)[__X(i, 256)] = ch;
i += 1;
} while (!(ch == 0x00));
conval->intval2 = i;
@ -882,8 +882,8 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
conval->intval = 0;
break;
default:
OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", (LONGINT)37);
OPM_LogWNum(f, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case in InConstant(), f = ", 37);
OPM_LogWNum(f, 0);
OPM_LogWLn();
break;
}
@ -911,7 +911,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par)
}
OPT_InStruct(&new->typ);
new->adr = OPM_SymRInt();
OPT_InName((void*)new->name, ((LONGINT)(256)));
OPT_InName((void*)new->name, 256);
last = new;
tag = OPM_SymRInt();
}
@ -932,7 +932,7 @@ static OPT_Object OPT_InFld (void)
obj->vis = 1;
}
OPT_InStruct(&obj->typ);
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
obj->adr = OPM_SymRInt();
} else {
obj->mode = 4;
@ -963,7 +963,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
obj->conval->intval = -1;
OPT_InSign(mno, &obj->typ, &obj->link);
obj->vis = 1;
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
obj->adr = __ASHL(OPM_SymRInt(), 16);
} else {
obj->mode = 13;
@ -984,7 +984,7 @@ static OPT_Struct OPT_InTyp (LONGINT tag)
_o_result = OPT_IntType(OPM_SymRInt());
return _o_result;
} else {
_o_result = OPT_impCtxt.ref[__X(tag, ((LONGINT)(255)))];
_o_result = OPT_impCtxt.ref[__X(tag, 255)];
return _o_result;
}
__RETCHK;
@ -1008,23 +1008,23 @@ static void OPT_InStruct (OPT_Struct *typ)
OPT_impCtxt.minr = ref;
}
OPT_InMod(&mno);
OPT_InName((void*)name, ((LONGINT)(256)));
OPT_InName((void*)name, 256);
obj = OPT_NewObj();
if (name[0] == 0x00) {
if (OPT_impCtxt.self) {
old = NIL;
} else {
__MOVE("@", obj->name, 2);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
obj->name[0] = 0x00;
}
*typ = OPT_NewStr(0, 1);
} else {
__COPY(name, obj->name, ((LONGINT)(256)));
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
__COPY(name, obj->name, 256);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
if (old != NIL) {
OPT_FPrintObj(old);
OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] = old->typ->pvfp;
OPT_impCtxt.pvfp[__X(ref, 255)] = old->typ->pvfp;
if (OPT_impCtxt.self) {
*typ = OPT_NewStr(0, 1);
} else {
@ -1038,8 +1038,8 @@ static void OPT_InStruct (OPT_Struct *typ)
*typ = OPT_NewStr(0, 1);
}
}
OPT_impCtxt.ref[__X(ref, ((LONGINT)(255)))] = *typ;
OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))] = old;
OPT_impCtxt.ref[__X(ref, 255)] = *typ;
OPT_impCtxt.old[__X(ref, 255)] = old;
(*typ)->ref = ref + 255;
(*typ)->mno = mno;
(*typ)->allocated = 1;
@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ)
obj->vis = 0;
tag = OPM_SymRInt();
if (tag == 35) {
(*typ)->sysflag = (int)OPM_SymRInt();
(*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt();
tag = OPM_SymRInt();
}
switch (tag) {
@ -1118,8 +1118,8 @@ static void OPT_InStruct (OPT_Struct *typ)
OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", (LONGINT)35);
OPM_LogWNum(tag, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at InStruct, tag = ", 35);
OPM_LogWNum(tag, 0);
OPM_LogWLn();
break;
}
@ -1131,7 +1131,7 @@ static void OPT_InStruct (OPT_Struct *typ)
if (obj->name[0] != 0x00) {
OPT_FPrintObj(obj);
}
old = OPT_impCtxt.old[__X(ref, ((LONGINT)(255)))];
old = OPT_impCtxt.old[__X(ref, 255)];
if (old != NIL) {
t->strobj = old;
if (OPT_impCtxt.self) {
@ -1139,13 +1139,13 @@ static void OPT_InStruct (OPT_Struct *typ)
if (old->history != 5) {
if (old->fprint != obj->fprint) {
old->history = 2;
} else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
} else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 3;
}
}
} else if (old->fprint != obj->fprint) {
old->history = 2;
} else if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
} else if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 3;
} else if (old->vis == 0) {
old->history = 1;
@ -1153,7 +1153,7 @@ static void OPT_InStruct (OPT_Struct *typ)
old->history = 0;
}
} else {
if (OPT_impCtxt.pvfp[__X(ref, ((LONGINT)(255)))] != t->pvfp) {
if (OPT_impCtxt.pvfp[__X(ref, 255)] != t->pvfp) {
old->history = 5;
}
if (old->fprint != obj->fprint) {
@ -1212,17 +1212,17 @@ static OPT_Object OPT_InObj (SHORTINT mno)
obj->mode = 9;
ext = OPT_NewExt();
obj->conval->ext = ext;
s = (int)OPM_SymRInt();
s = (SYSTEM_INT32)OPM_SymRInt();
(*ext)[0] = (CHAR)s;
i = 1;
while (i <= s) {
OPM_SymRCh(&(*ext)[__X(i, ((LONGINT)(256)))]);
OPM_SymRCh(&(*ext)[__X(i, 256)]);
i += 1;
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", (LONGINT)32);
OPM_LogWNum(tag, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at InObj, tag = ", 32);
OPM_LogWNum(tag, 0);
OPM_LogWLn();
break;
}
@ -1236,14 +1236,14 @@ static OPT_Object OPT_InObj (SHORTINT mno)
}
OPT_InStruct(&obj->typ);
}
OPT_InName((void*)obj->name, ((LONGINT)(256)));
OPT_InName((void*)obj->name, 256);
}
OPT_FPrintObj(obj);
if ((obj->mode == 1 && (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00))) {
OPM_FPrint(&OPT_impCtxt.reffp, obj->typ->ref - 255);
}
if (tag != 19) {
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right, &old);
OPT_InsertImport(obj, &OPT_GlbMod[__X(mno, 64)]->right, &old);
if (OPT_impCtxt.self) {
if (old != NIL) {
if (old->vis == 0) {
@ -1294,7 +1294,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
OPT_impCtxt.nofm = 0;
OPT_impCtxt.self = __STRCMP(aliasName, "@self") == 0;
OPT_impCtxt.reffp = 0;
OPM_OldSym((void*)name, ((LONGINT)(256)), &*done);
OPM_OldSym((void*)name, 256, &*done);
if (*done) {
OPT_InMod(&mno);
OPT_impCtxt.nextTag = OPM_SymRInt();
@ -1304,8 +1304,8 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
}
OPT_Insert(aliasName, &obj);
obj->mode = 11;
obj->scope = OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->right;
OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->link = obj;
obj->scope = OPT_GlbMod[__X(mno, 64)]->right;
OPT_GlbMod[__X(mno, 64)]->link = obj;
obj->mnolev = -mno;
obj->typ = OPT_notyp;
OPM_CloseOldSym();
@ -1333,13 +1333,13 @@ static void OPT_OutName (CHAR *name, LONGINT name__len)
static void OPT_OutMod (INTEGER mno)
{
if (OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] < 0) {
OPM_SymWInt(((LONGINT)(16)));
OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))] = OPT_expCtxt.nofm;
if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) {
OPM_SymWInt(16);
OPT_expCtxt.locmno[__X(mno, 64)] = OPT_expCtxt.nofm;
OPT_expCtxt.nofm += 1;
OPT_OutName((void*)OPT_GlbMod[__X(mno, ((LONGINT)(64)))]->name, ((LONGINT)(256)));
OPT_OutName((void*)OPT_GlbMod[__X(mno, 64)]->name, 256);
} else {
OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, ((LONGINT)(64)))]);
OPM_SymWInt(-OPT_expCtxt.locmno[__X(mno, 64)]);
}
}
@ -1369,7 +1369,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr)
}
}
} else if (typ->form == 13 || __STRCMP(fld->name, "@ptr") == 0) {
OPM_SymWInt(((LONGINT)(27)));
OPM_SymWInt(27);
OPM_SymWInt(adr);
OPT_nofhdfld += 1;
}
@ -1380,12 +1380,12 @@ static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible)
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
if (fld->vis == 2) {
OPM_SymWInt(((LONGINT)(26)));
OPM_SymWInt(26);
} else {
OPM_SymWInt(((LONGINT)(25)));
OPM_SymWInt(25);
}
OPT_OutStr(fld->typ);
OPT_OutName((void*)fld->name, ((LONGINT)(256)));
OPT_OutName((void*)fld->name, 256);
OPM_SymWInt(fld->adr);
} else {
OPT_OutHdFld(fld->typ, fld, fld->adr + adr);
@ -1399,16 +1399,16 @@ static void OPT_OutSign (OPT_Struct result, OPT_Object par)
OPT_OutStr(result);
while (par != NIL) {
if (par->mode == 1) {
OPM_SymWInt(((LONGINT)(23)));
OPM_SymWInt(23);
} else {
OPM_SymWInt(((LONGINT)(24)));
OPM_SymWInt(24);
}
OPT_OutStr(par->typ);
OPM_SymWInt(par->adr);
OPT_OutName((void*)par->name, ((LONGINT)(256)));
OPT_OutName((void*)par->name, 256);
par = par->link;
}
OPM_SymWInt(((LONGINT)(18)));
OPM_SymWInt(18);
}
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj)
@ -1421,12 +1421,12 @@ static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj)
}
if (obj->vis != 0) {
if (obj->vis != 0) {
OPM_SymWInt(((LONGINT)(29)));
OPM_SymWInt(29);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
OPM_SymWInt(__ASHR(obj->adr, 16));
} else {
OPM_SymWInt(((LONGINT)(30)));
OPM_SymWInt(30);
OPM_SymWInt(__ASHR(obj->adr, 16));
}
}
@ -1444,7 +1444,7 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWInt(typ->size);
}
} else {
OPM_SymWInt(((LONGINT)(34)));
OPM_SymWInt(34);
typ->ref = OPT_expCtxt.ref;
OPT_expCtxt.ref += 1;
if (OPT_expCtxt.ref >= 255) {
@ -1453,7 +1453,7 @@ static void OPT_OutStr (OPT_Struct typ)
OPT_OutMod(typ->mno);
strobj = typ->strobj;
if ((strobj != NIL && strobj->name[0] != 0x00)) {
OPT_OutName((void*)strobj->name, ((LONGINT)(256)));
OPT_OutName((void*)strobj->name, 256);
switch (strobj->history) {
case 2:
OPT_FPrintErr(strobj, 252);
@ -1471,31 +1471,31 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWCh(0x00);
}
if (typ->sysflag != 0) {
OPM_SymWInt(((LONGINT)(35)));
OPM_SymWInt(35);
OPM_SymWInt(typ->sysflag);
}
switch (typ->form) {
case 13:
OPM_SymWInt(((LONGINT)(36)));
OPM_SymWInt(36);
OPT_OutStr(typ->BaseTyp);
break;
case 14:
OPM_SymWInt(((LONGINT)(40)));
OPM_SymWInt(40);
OPT_OutSign(typ->BaseTyp, typ->link);
break;
case 15:
switch (typ->comp) {
case 2:
OPM_SymWInt(((LONGINT)(37)));
OPM_SymWInt(37);
OPT_OutStr(typ->BaseTyp);
OPM_SymWInt(typ->n);
break;
case 3:
OPM_SymWInt(((LONGINT)(38)));
OPM_SymWInt(38);
OPT_OutStr(typ->BaseTyp);
break;
case 4:
OPM_SymWInt(((LONGINT)(39)));
OPM_SymWInt(39);
if (typ->BaseTyp == NIL) {
OPT_OutStr(OPT_notyp);
} else {
@ -1505,23 +1505,23 @@ static void OPT_OutStr (OPT_Struct typ)
OPM_SymWInt(typ->align);
OPM_SymWInt(typ->n);
OPT_nofhdfld = 0;
OPT_OutFlds(typ->link, ((LONGINT)(0)), 1);
OPT_OutFlds(typ->link, 0, 1);
if (OPT_nofhdfld > 2048) {
OPM_Mark(223, typ->txtpos);
}
OPT_OutTProcs(typ, typ->link);
OPM_SymWInt(((LONGINT)(18)));
OPM_SymWInt(18);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", (LONGINT)39);
OPM_LogWNum(typ->comp, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.comp = ", 39);
OPM_LogWNum(typ->comp, 0);
OPM_LogWLn();
break;
}
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", (LONGINT)39);
OPM_LogWNum(typ->form, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutStr, typ^.form = ", 39);
OPM_LogWNum(typ->form, 0);
OPM_LogWLn();
break;
}
@ -1553,7 +1553,7 @@ static void OPT_OutConstant (OPT_Object obj)
OPM_SymWLReal(obj->conval->realval);
break;
case 10:
OPT_OutName((void*)*obj->conval->ext, ((LONGINT)(256)));
OPT_OutName((void*)*obj->conval->ext, 256);
break;
case 11:
break;
@ -1586,64 +1586,64 @@ static void OPT_OutObj (OPT_Object obj)
OPT_FPrintErr(obj, 251);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", (LONGINT)42);
OPM_LogWNum(obj->history, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj^.history = ", 42);
OPM_LogWNum(obj->history, 0);
OPM_LogWLn();
break;
}
switch (obj->mode) {
case 3:
OPT_OutConstant(obj);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 5:
if (obj->typ->strobj == obj) {
OPM_SymWInt(((LONGINT)(19)));
OPM_SymWInt(19);
OPT_OutStr(obj->typ);
} else {
OPM_SymWInt(((LONGINT)(20)));
OPM_SymWInt(20);
OPT_OutStr(obj->typ);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
}
break;
case 1:
if (obj->vis == 2) {
OPM_SymWInt(((LONGINT)(22)));
OPM_SymWInt(22);
} else {
OPM_SymWInt(((LONGINT)(21)));
OPM_SymWInt(21);
}
OPT_OutStr(obj->typ);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
if (obj->typ->strobj == NIL || obj->typ->strobj->name[0] == 0x00) {
OPM_FPrint(&OPT_expCtxt.reffp, obj->typ->ref);
}
break;
case 7:
OPM_SymWInt(((LONGINT)(31)));
OPM_SymWInt(31);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 10:
OPM_SymWInt(((LONGINT)(32)));
OPM_SymWInt(32);
OPT_OutSign(obj->typ, obj->link);
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
case 9:
OPM_SymWInt(((LONGINT)(33)));
OPM_SymWInt(33);
OPT_OutSign(obj->typ, obj->link);
ext = obj->conval->ext;
j = (int)(*ext)[0];
j = (*ext)[0];
i = 1;
OPM_SymWInt(j);
while (i <= j) {
OPM_SymWCh((*ext)[__X(i, ((LONGINT)(256)))]);
OPM_SymWCh((*ext)[__X(i, 256)]);
i += 1;
}
OPT_OutName((void*)obj->name, ((LONGINT)(256)));
OPT_OutName((void*)obj->name, 256);
break;
default:
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", (LONGINT)38);
OPM_LogWNum(obj->mode, ((LONGINT)(0)));
OPM_LogWStr((CHAR*)"unhandled case at OutObj, obj.mode = ", 38);
OPM_LogWNum(obj->mode, 0);
OPM_LogWLn();
break;
}
@ -1664,17 +1664,17 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
OPT_Import((CHAR*)"@self", OPT_SelfName, &done);
OPT_nofGmod = nofmod;
if (OPM_noerr) {
OPM_NewSym((void*)OPT_SelfName, ((LONGINT)(256)));
OPM_NewSym((void*)OPT_SelfName, 256);
if (OPM_noerr) {
OPM_SymWInt(((LONGINT)(16)));
OPT_OutName((void*)OPT_SelfName, ((LONGINT)(256)));
OPM_SymWInt(16);
OPT_OutName((void*)OPT_SelfName, 256);
OPT_expCtxt.reffp = 0;
OPT_expCtxt.ref = 16;
OPT_expCtxt.nofm = 1;
OPT_expCtxt.locmno[0] = 0;
i = 1;
while (i < 64) {
OPT_expCtxt.locmno[__X(i, ((LONGINT)(64)))] = -1;
OPT_expCtxt.locmno[__X(i, 64)] = -1;
i += 1;
}
OPT_OutObj(OPT_topScope->right);
@ -1875,11 +1875,11 @@ export void *OPT__init(void)
OPT_EnterTyp((CHAR*)"SET", 9, OPM_SetSize, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 7, OPM_RealSize, &OPT_realtyp);
OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
OPT_EnterTyp((CHAR*)"LONGINT", 6, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp);
OPT_EnterBoolConst((CHAR*)"FALSE", ((LONGINT)(0)));
OPT_EnterBoolConst((CHAR*)"TRUE", ((LONGINT)(1)));
OPT_EnterBoolConst((CHAR*)"FALSE", 0);
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
OPT_EnterProc((CHAR*)"HALT", 0);
OPT_EnterProc((CHAR*)"NEW", 1);
OPT_EnterProc((CHAR*)"ABS", 2);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/08/30] for gcc LP64 on cygwin xtspkaSfF */
/* voc 1.95 [2016/08/31] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h
#define OPT__h

Some files were not shown because too many files have changed in this diff Show more