mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 02:52:24 +00:00
Use SYSTEM.ADDRESS in libraries. Build all with -O2. Support INC(a,b) for any int a,b that support a:=a+b.
This commit is contained in:
parent
f1cbbdba28
commit
22a4f8e263
92 changed files with 2752 additions and 2695 deletions
|
|
@ -1,8 +1,8 @@
|
|||
/* voc 1.95 [2016/09/23] for gcc LP64 on cygwin xtspaSfF */
|
||||
|
||||
#define INTEGER int32
|
||||
#define LONGINT int64
|
||||
#define SET uint64
|
||||
#define INTEGER int16
|
||||
#define LONGINT int32
|
||||
#define SET uint32
|
||||
|
||||
#include "SYSTEM.h"
|
||||
#include "Configuration.h"
|
||||
|
|
@ -19,23 +19,24 @@ typedef
|
|||
|
||||
|
||||
static CHAR OPM_SourceFileName[256];
|
||||
export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
|
||||
export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
|
||||
export int64 OPM_MaxIndex;
|
||||
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
|
||||
export BOOLEAN OPM_noerr;
|
||||
export int64 OPM_curpos, OPM_errpos, OPM_breakpc;
|
||||
export int32 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
|
||||
export int32 OPM_curpos, OPM_errpos, OPM_breakpc;
|
||||
export int16 OPM_currFile, OPM_level, OPM_pc, OPM_entno;
|
||||
export CHAR OPM_modName[32];
|
||||
export CHAR OPM_objname[64];
|
||||
export SET OPM_opt, OPM_glbopt;
|
||||
static int64 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber, OPM_lasterrpos;
|
||||
static int32 OPM_ErrorLineStartPos, OPM_ErrorLineLimitPos, OPM_ErrorLineNumber;
|
||||
static int64 OPM_lasterrpos;
|
||||
static Texts_Reader OPM_inR;
|
||||
static Texts_Text OPM_Log;
|
||||
static Texts_Writer OPM_W;
|
||||
static Files_Rider OPM_oldSF, OPM_newSF;
|
||||
static Files_Rider OPM_R[3];
|
||||
static Files_File OPM_oldSFile, OPM_newSFile, OPM_HFile, OPM_BFile, OPM_HIFile;
|
||||
static int32 OPM_S;
|
||||
static int16 OPM_S;
|
||||
static CHAR OPM_OBERON[1024];
|
||||
static CHAR OPM_MODULES[1024];
|
||||
|
||||
|
|
@ -44,25 +45,25 @@ static void OPM_Append (Files_Rider *R, address *R__typ, Files_File F);
|
|||
export void OPM_CloseFiles (void);
|
||||
export void OPM_CloseOldSym (void);
|
||||
export void OPM_DeleteNewSym (void);
|
||||
export void OPM_FPrint (int64 *fp, int64 val);
|
||||
export void OPM_FPrintLReal (int64 *fp, LONGREAL lr);
|
||||
export void OPM_FPrintReal (int64 *fp, REAL real);
|
||||
export void OPM_FPrintSet (int64 *fp, SET set);
|
||||
export void OPM_FPrint (int32 *fp, int64 val);
|
||||
export void OPM_FPrintLReal (int32 *fp, LONGREAL lr);
|
||||
export void OPM_FPrintReal (int32 *fp, REAL real);
|
||||
export void OPM_FPrintSet (int32 *fp, SET set);
|
||||
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos);
|
||||
export void OPM_Get (CHAR *ch);
|
||||
static void OPM_GetProperties (void);
|
||||
static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align);
|
||||
static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align);
|
||||
export void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len);
|
||||
export void OPM_InitOptions (void);
|
||||
export int32 OPM_Integer (int64 n);
|
||||
static void OPM_LogErrMsg (int32 n);
|
||||
export int16 OPM_Integer (int64 n);
|
||||
static void OPM_LogErrMsg (int16 n);
|
||||
export void OPM_LogW (CHAR ch);
|
||||
export void OPM_LogWLn (void);
|
||||
export void OPM_LogWNum (int64 i, int64 len);
|
||||
export void OPM_LogWStr (CHAR *s, LONGINT s__len);
|
||||
export int64 OPM_Longint (int64 n);
|
||||
export int32 OPM_Longint (int64 n);
|
||||
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len);
|
||||
export void OPM_Mark (int32 n, int64 pos);
|
||||
export void OPM_Mark (int16 n, int64 pos);
|
||||
export void OPM_NewSym (CHAR *modName, LONGINT modName__len);
|
||||
export void OPM_OldSym (CHAR *modName, LONGINT modName__len, BOOLEAN *done);
|
||||
export void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len);
|
||||
|
|
@ -70,10 +71,10 @@ export BOOLEAN OPM_OpenPar (void);
|
|||
export void OPM_RegisterNewSym (void);
|
||||
static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt);
|
||||
static void OPM_ShowLine (int64 pos);
|
||||
export int64 OPM_SignedMaximum (int64 bytecount);
|
||||
export int64 OPM_SignedMinimum (int64 bytecount);
|
||||
export int64 OPM_SignedMaximum (int32 bytecount);
|
||||
export int64 OPM_SignedMinimum (int32 bytecount);
|
||||
export void OPM_SymRCh (CHAR *ch);
|
||||
export int64 OPM_SymRInt (void);
|
||||
export int32 OPM_SymRInt (void);
|
||||
export int64 OPM_SymRInt64 (void);
|
||||
export void OPM_SymRLReal (LONGREAL *lr);
|
||||
export void OPM_SymRReal (REAL *r);
|
||||
|
|
@ -92,9 +93,9 @@ export void OPM_WriteReal (LONGREAL r, CHAR suffx);
|
|||
export void OPM_WriteString (CHAR *s, LONGINT s__len);
|
||||
export void OPM_WriteStringVar (CHAR *s, LONGINT s__len);
|
||||
export BOOLEAN OPM_eofSF (void);
|
||||
export void OPM_err (int32 n);
|
||||
static int64 OPM_minusop (int64 i);
|
||||
static int64 OPM_power0 (int64 i, int64 j);
|
||||
export void OPM_err (int16 n);
|
||||
static int32 OPM_minusop (int32 i);
|
||||
static int32 OPM_power0 (int32 i, int32 j);
|
||||
|
||||
|
||||
void OPM_LogW (CHAR ch)
|
||||
|
|
@ -119,23 +120,23 @@ void OPM_LogWLn (void)
|
|||
Console_Ln();
|
||||
}
|
||||
|
||||
int64 OPM_Longint (int64 n)
|
||||
{
|
||||
int64 _o_result;
|
||||
_o_result = (int64)n;
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
int32 OPM_Integer (int64 n)
|
||||
int32 OPM_Longint (int64 n)
|
||||
{
|
||||
int32 _o_result;
|
||||
_o_result = __VAL(int32, n);
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
int16 OPM_Integer (int64 n)
|
||||
{
|
||||
int16 _o_result;
|
||||
_o_result = __VAL(int16, n);
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||
{
|
||||
int32 i;
|
||||
int16 i;
|
||||
__DUP(s, s__len, CHAR);
|
||||
i = 1;
|
||||
while (s[__X(i, s__len)] != 0x00) {
|
||||
|
|
@ -219,23 +220,23 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
|||
OPM_LogWStr((CHAR*)"-M option requires two following digits.", 41);
|
||||
OPM_LogWLn();
|
||||
} else {
|
||||
OPM_AddressSize = s[__X(i + 1, s__len)] - 48;
|
||||
OPM_Alignment = s[__X(i + 2, s__len)] - 48;
|
||||
OPM_AddressSize = (int16)s[__X(i + 1, s__len)] - 48;
|
||||
OPM_Alignment = (int16)s[__X(i + 2, s__len)] - 48;
|
||||
i += 2;
|
||||
}
|
||||
break;
|
||||
case 'B':
|
||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||
i += 1;
|
||||
OPM_IntegerSize = s[__X(i, s__len)] - 48;
|
||||
OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48;
|
||||
}
|
||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||
i += 1;
|
||||
OPM_AddressSize = s[__X(i, s__len)] - 48;
|
||||
OPM_AddressSize = (int16)s[__X(i, s__len)] - 48;
|
||||
}
|
||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||
i += 1;
|
||||
OPM_Alignment = s[__X(i, s__len)] - 48;
|
||||
OPM_Alignment = (int16)s[__X(i, s__len)] - 48;
|
||||
}
|
||||
__ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0);
|
||||
__ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0);
|
||||
|
|
@ -385,9 +386,9 @@ void OPM_InitOptions (void)
|
|||
s[0] = 0x00;
|
||||
Platform_GetArg(OPM_S, (void*)s, 256);
|
||||
}
|
||||
if (__IN(15, OPM_opt, 64)) {
|
||||
OPM_glbopt |= __SETOF(10,64);
|
||||
OPM_opt |= __SETOF(10,64);
|
||||
if (__IN(15, OPM_opt, 32)) {
|
||||
OPM_glbopt |= __SETOF(10,32);
|
||||
OPM_opt |= __SETOF(10,32);
|
||||
}
|
||||
OPM_GetProperties();
|
||||
}
|
||||
|
|
@ -395,7 +396,7 @@ void OPM_InitOptions (void)
|
|||
void OPM_Init (BOOLEAN *done, CHAR *mname, LONGINT mname__len)
|
||||
{
|
||||
Texts_Text T = NIL;
|
||||
int64 beg, end, time;
|
||||
int32 beg, end, time;
|
||||
CHAR s[256];
|
||||
*done = 0;
|
||||
OPM_curpos = 0;
|
||||
|
|
@ -443,7 +444,7 @@ void OPM_Get (CHAR *ch)
|
|||
|
||||
static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGINT FName__len, CHAR *ext, LONGINT ext__len)
|
||||
{
|
||||
int32 i, j;
|
||||
int16 i, j;
|
||||
CHAR ch;
|
||||
__DUP(ext, ext__len, CHAR);
|
||||
i = 0;
|
||||
|
|
@ -465,28 +466,28 @@ static void OPM_MakeFileName (CHAR *name, LONGINT name__len, CHAR *FName, LONGIN
|
|||
__DEL(ext);
|
||||
}
|
||||
|
||||
static void OPM_LogErrMsg (int32 n)
|
||||
static void OPM_LogErrMsg (int16 n)
|
||||
{
|
||||
Texts_Scanner S;
|
||||
Texts_Text T = NIL;
|
||||
CHAR ch;
|
||||
int32 i;
|
||||
int16 i;
|
||||
CHAR buf[1024];
|
||||
if (n >= 0) {
|
||||
if (!__IN(16, OPM_opt, 64)) {
|
||||
if (!__IN(16, OPM_opt, 32)) {
|
||||
vt100_SetAttr((CHAR*)"31m", 4);
|
||||
}
|
||||
OPM_LogWStr((CHAR*)" err ", 7);
|
||||
if (!__IN(16, OPM_opt, 64)) {
|
||||
if (!__IN(16, OPM_opt, 32)) {
|
||||
vt100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
} else {
|
||||
if (!__IN(16, OPM_opt, 64)) {
|
||||
if (!__IN(16, OPM_opt, 32)) {
|
||||
vt100_SetAttr((CHAR*)"35m", 4);
|
||||
}
|
||||
OPM_LogWStr((CHAR*)" warning ", 11);
|
||||
n = -n;
|
||||
if (!__IN(16, OPM_opt, 64)) {
|
||||
if (!__IN(16, OPM_opt, 32)) {
|
||||
vt100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
}
|
||||
|
|
@ -498,18 +499,18 @@ static void OPM_LogErrMsg (int32 n)
|
|||
static void OPM_FindLine (Files_File f, Files_Rider *r, address *r__typ, int64 pos)
|
||||
{
|
||||
CHAR ch, cheol;
|
||||
if (pos < OPM_ErrorLineStartPos) {
|
||||
if (pos < (int64)OPM_ErrorLineStartPos) {
|
||||
OPM_ErrorLineStartPos = 0;
|
||||
OPM_ErrorLineLimitPos = 0;
|
||||
OPM_ErrorLineNumber = 0;
|
||||
}
|
||||
if (pos < OPM_ErrorLineLimitPos) {
|
||||
if (pos < (int64)OPM_ErrorLineLimitPos) {
|
||||
Files_Set(&*r, r__typ, f, OPM_ErrorLineStartPos);
|
||||
return;
|
||||
}
|
||||
Files_Set(&*r, r__typ, f, OPM_ErrorLineLimitPos);
|
||||
Files_Read(&*r, r__typ, (void*)&ch);
|
||||
while ((OPM_ErrorLineLimitPos < pos && !(*r).eof)) {
|
||||
while (((int64)OPM_ErrorLineLimitPos < pos && !(*r).eof)) {
|
||||
OPM_ErrorLineStartPos = OPM_ErrorLineLimitPos;
|
||||
OPM_ErrorLineNumber += 1;
|
||||
while ((((ch != 0x00 && ch != 0x0d)) && ch != 0x0a)) {
|
||||
|
|
@ -532,7 +533,7 @@ static void OPM_ShowLine (int64 pos)
|
|||
Files_File f = NIL;
|
||||
Files_Rider r;
|
||||
CHAR line[1023];
|
||||
int32 i;
|
||||
int16 i;
|
||||
CHAR ch;
|
||||
f = Files_Old(OPM_SourceFileName, 256);
|
||||
OPM_FindLine(f, &r, Files_Rider__typ, pos);
|
||||
|
|
@ -551,25 +552,25 @@ static void OPM_ShowLine (int64 pos)
|
|||
OPM_LogWStr(line, 1023);
|
||||
OPM_LogWLn();
|
||||
OPM_LogWStr((CHAR*)" ", 7);
|
||||
if (pos >= OPM_ErrorLineLimitPos) {
|
||||
if (pos >= (int64)OPM_ErrorLineLimitPos) {
|
||||
pos = OPM_ErrorLineLimitPos - 1;
|
||||
}
|
||||
i = (int32)OPM_Longint(pos - OPM_ErrorLineStartPos);
|
||||
i = (int16)OPM_Longint(pos - (int64)OPM_ErrorLineStartPos);
|
||||
while (i > 0) {
|
||||
OPM_LogW(' ');
|
||||
i -= 1;
|
||||
}
|
||||
if (!__IN(16, OPM_opt, 64)) {
|
||||
if (!__IN(16, OPM_opt, 32)) {
|
||||
vt100_SetAttr((CHAR*)"32m", 4);
|
||||
}
|
||||
OPM_LogW('^');
|
||||
if (!__IN(16, OPM_opt, 64)) {
|
||||
if (!__IN(16, OPM_opt, 32)) {
|
||||
vt100_SetAttr((CHAR*)"0m", 3);
|
||||
}
|
||||
Files_Close(f);
|
||||
}
|
||||
|
||||
void OPM_Mark (int32 n, int64 pos)
|
||||
void OPM_Mark (int16 n, int64 pos)
|
||||
{
|
||||
if (pos == -1) {
|
||||
pos = 0;
|
||||
|
|
@ -621,49 +622,51 @@ void OPM_Mark (int32 n, int64 pos)
|
|||
}
|
||||
}
|
||||
|
||||
void OPM_err (int32 n)
|
||||
void OPM_err (int16 n)
|
||||
{
|
||||
OPM_Mark(n, OPM_errpos);
|
||||
}
|
||||
|
||||
void OPM_FPrint (int64 *fp, int64 val)
|
||||
void OPM_FPrint (int32 *fp, int64 val)
|
||||
{
|
||||
*fp = __ROTL((int64)((SET)*fp ^ (SET)val), 1, 64);
|
||||
*fp = __ROTL((int32)((SET)*fp ^ __VAL(SET, val)), 1, 32);
|
||||
}
|
||||
|
||||
void OPM_FPrintSet (int64 *fp, SET set)
|
||||
void OPM_FPrintSet (int32 *fp, SET set)
|
||||
{
|
||||
OPM_FPrint(&*fp, (int64)set);
|
||||
OPM_FPrint(&*fp, (int32)set);
|
||||
}
|
||||
|
||||
void OPM_FPrintReal (int64 *fp, REAL real)
|
||||
void OPM_FPrintReal (int32 *fp, REAL real)
|
||||
{
|
||||
int32 i;
|
||||
int64 l;
|
||||
__GET((address)&real, i, int32);
|
||||
l = i;
|
||||
int16 i;
|
||||
int32 l;
|
||||
__GET((address)&real, l, int32);
|
||||
OPM_FPrint(&*fp, l);
|
||||
}
|
||||
|
||||
void OPM_FPrintLReal (int64 *fp, LONGREAL lr)
|
||||
void OPM_FPrintLReal (int32 *fp, LONGREAL lr)
|
||||
{
|
||||
int64 l, h;
|
||||
OPM_FPrint(&*fp, __VAL(int64, lr));
|
||||
int32 l, h;
|
||||
__GET((address)&lr, l, int32);
|
||||
__GET((address)&lr + 4, h, int32);
|
||||
OPM_FPrint(&*fp, l);
|
||||
OPM_FPrint(&*fp, h);
|
||||
}
|
||||
|
||||
static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int32 *size, int32 *align)
|
||||
static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONGINT name__len, int16 *size, int16 *align)
|
||||
{
|
||||
__DUP(name, name__len, CHAR);
|
||||
if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) {
|
||||
Texts_Scan(&*S, S__typ);
|
||||
if ((*S).class == 3) {
|
||||
*size = (int32)(*S).i;
|
||||
*size = (int16)(*S).i;
|
||||
Texts_Scan(&*S, S__typ);
|
||||
} else {
|
||||
OPM_Mark(-157, -1);
|
||||
}
|
||||
if ((*S).class == 3) {
|
||||
*align = (int32)(*S).i;
|
||||
*align = (int16)(*S).i;
|
||||
Texts_Scan(&*S, S__typ);
|
||||
} else {
|
||||
OPM_Mark(-157, -1);
|
||||
|
|
@ -674,17 +677,17 @@ static void OPM_GetProperty (Texts_Scanner *S, address *S__typ, CHAR *name, LONG
|
|||
__DEL(name);
|
||||
}
|
||||
|
||||
static int64 OPM_minusop (int64 i)
|
||||
static int32 OPM_minusop (int32 i)
|
||||
{
|
||||
int64 _o_result;
|
||||
int32 _o_result;
|
||||
_o_result = -i;
|
||||
return _o_result;
|
||||
}
|
||||
|
||||
static int64 OPM_power0 (int64 i, int64 j)
|
||||
static int32 OPM_power0 (int32 i, int32 j)
|
||||
{
|
||||
int64 _o_result;
|
||||
int64 k, p;
|
||||
int32 _o_result;
|
||||
int32 k, p;
|
||||
k = 1;
|
||||
p = i;
|
||||
do {
|
||||
|
|
@ -721,7 +724,7 @@ static void OPM_VerboseListSizes (void)
|
|||
OPM_LogWLn();
|
||||
}
|
||||
|
||||
int64 OPM_SignedMaximum (int64 bytecount)
|
||||
int64 OPM_SignedMaximum (int32 bytecount)
|
||||
{
|
||||
int64 _o_result;
|
||||
int64 result;
|
||||
|
|
@ -731,7 +734,7 @@ int64 OPM_SignedMaximum (int64 bytecount)
|
|||
return _o_result;
|
||||
}
|
||||
|
||||
int64 OPM_SignedMinimum (int64 bytecount)
|
||||
int64 OPM_SignedMinimum (int32 bytecount)
|
||||
{
|
||||
int64 _o_result;
|
||||
_o_result = -OPM_SignedMaximum(bytecount) - 1;
|
||||
|
|
@ -746,7 +749,7 @@ static void OPM_GetProperties (void)
|
|||
OPM_MinLReal = -OPM_MaxLReal;
|
||||
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
|
||||
OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
|
||||
if (__IN(18, OPM_opt, 64)) {
|
||||
if (__IN(18, OPM_opt, 32)) {
|
||||
OPM_VerboseListSizes();
|
||||
}
|
||||
}
|
||||
|
|
@ -756,10 +759,10 @@ void OPM_SymRCh (CHAR *ch)
|
|||
Files_Read(&OPM_oldSF, Files_Rider__typ, (void*)&*ch);
|
||||
}
|
||||
|
||||
int64 OPM_SymRInt (void)
|
||||
int32 OPM_SymRInt (void)
|
||||
{
|
||||
int64 _o_result;
|
||||
int64 k;
|
||||
int32 _o_result;
|
||||
int32 k;
|
||||
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, &k);
|
||||
_o_result = k;
|
||||
return _o_result;
|
||||
|
|
@ -776,7 +779,7 @@ int64 OPM_SymRInt64 (void)
|
|||
|
||||
void OPM_SymRSet (SET *s)
|
||||
{
|
||||
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int64*)&*s);
|
||||
Files_ReadNum(&OPM_oldSF, Files_Rider__typ, (int32*)&*s);
|
||||
}
|
||||
|
||||
void OPM_SymRReal (REAL *r)
|
||||
|
|
@ -830,7 +833,7 @@ void OPM_SymWInt (int64 i)
|
|||
|
||||
void OPM_SymWSet (SET s)
|
||||
{
|
||||
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int64)s);
|
||||
Files_WriteNum(&OPM_newSF, Files_Rider__typ, (int32)s);
|
||||
}
|
||||
|
||||
void OPM_SymWReal (REAL r)
|
||||
|
|
@ -845,7 +848,7 @@ void OPM_SymWLReal (LONGREAL lr)
|
|||
|
||||
void OPM_RegisterNewSym (void)
|
||||
{
|
||||
if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 64)) {
|
||||
if (__STRCMP(OPM_modName, "SYSTEM") != 0 || __IN(10, OPM_opt, 32)) {
|
||||
Files_Register(OPM_newSFile);
|
||||
}
|
||||
}
|
||||
|
|
@ -874,7 +877,7 @@ void OPM_Write (CHAR ch)
|
|||
|
||||
void OPM_WriteString (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
int32 i;
|
||||
int16 i;
|
||||
i = 0;
|
||||
while (s[__X(i, s__len)] != 0x00) {
|
||||
i += 1;
|
||||
|
|
@ -884,7 +887,7 @@ void OPM_WriteString (CHAR *s, LONGINT s__len)
|
|||
|
||||
void OPM_WriteStringVar (CHAR *s, LONGINT s__len)
|
||||
{
|
||||
int32 i;
|
||||
int16 i;
|
||||
i = 0;
|
||||
while (s[__X(i, s__len)] != 0x00) {
|
||||
i += 1;
|
||||
|
|
@ -948,14 +951,14 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
|
|||
Texts_Reader R;
|
||||
CHAR s[32];
|
||||
CHAR ch;
|
||||
int32 i;
|
||||
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) {
|
||||
int16 i;
|
||||
if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) {
|
||||
if (suffx == 'f') {
|
||||
OPM_WriteString((CHAR*)"(REAL)", 7);
|
||||
} else {
|
||||
OPM_WriteString((CHAR*)"(LONGREAL)", 11);
|
||||
}
|
||||
OPM_WriteInt(__ENTIER(r));
|
||||
OPM_WriteInt((int32)__ENTIER(r));
|
||||
} else {
|
||||
Texts_OpenWriter(&W, Texts_Writer__typ);
|
||||
if (suffx == 'f') {
|
||||
|
|
@ -1036,7 +1039,7 @@ void OPM_OpenFiles (CHAR *moduleName, LONGINT moduleName__len)
|
|||
void OPM_CloseFiles (void)
|
||||
{
|
||||
CHAR FName[32];
|
||||
int32 res;
|
||||
int16 res;
|
||||
if (OPM_noerr) {
|
||||
OPM_LogWStr((CHAR*)" ", 3);
|
||||
OPM_LogWNum(Files_Pos(&OPM_R[1], Files_Rider__typ), 0);
|
||||
|
|
@ -1044,10 +1047,10 @@ void OPM_CloseFiles (void)
|
|||
}
|
||||
if (OPM_noerr) {
|
||||
if (__STRCMP(OPM_modName, "SYSTEM") == 0) {
|
||||
if (!__IN(10, OPM_opt, 64)) {
|
||||
if (!__IN(10, OPM_opt, 32)) {
|
||||
Files_Register(OPM_BFile);
|
||||
}
|
||||
} else if (!__IN(10, OPM_opt, 64)) {
|
||||
} else if (!__IN(10, OPM_opt, 32)) {
|
||||
OPM_Append(&OPM_R[2], Files_Rider__typ, OPM_HFile);
|
||||
Files_Register(OPM_HIFile);
|
||||
Files_Register(OPM_BFile);
|
||||
|
|
@ -1073,12 +1076,12 @@ void OPM_CloseFiles (void)
|
|||
|
||||
static void EnumPtrs(void (*P)(void*))
|
||||
{
|
||||
__ENUMR(&OPM_inR, Texts_Reader__typ, 96, 1, P);
|
||||
__ENUMR(&OPM_inR, Texts_Reader__typ, 72, 1, P);
|
||||
P(OPM_Log);
|
||||
__ENUMR(&OPM_W, Texts_Writer__typ, 72, 1, P);
|
||||
__ENUMR(&OPM_oldSF, Files_Rider__typ, 40, 1, P);
|
||||
__ENUMR(&OPM_newSF, Files_Rider__typ, 40, 1, P);
|
||||
__ENUMR(OPM_R, Files_Rider__typ, 40, 3, P);
|
||||
__ENUMR(&OPM_W, Texts_Writer__typ, 56, 1, P);
|
||||
__ENUMR(&OPM_oldSF, Files_Rider__typ, 24, 1, P);
|
||||
__ENUMR(&OPM_newSF, Files_Rider__typ, 24, 1, P);
|
||||
__ENUMR(OPM_R, Files_Rider__typ, 24, 3, P);
|
||||
P(OPM_oldSFile);
|
||||
P(OPM_newSFile);
|
||||
P(OPM_HFile);
|
||||
|
|
@ -1121,8 +1124,8 @@ export void *OPM__init(void)
|
|||
OPM_AddressSize = 8;
|
||||
OPM_Alignment = 8;
|
||||
OPM_ShortintSize = 1;
|
||||
OPM_IntegerSize = 4;
|
||||
OPM_LongintSize = 8;
|
||||
OPM_SetSize = 8;
|
||||
OPM_IntegerSize = 2;
|
||||
OPM_LongintSize = 4;
|
||||
OPM_SetSize = 4;
|
||||
__ENDMOD;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue