Simplify parameterisable memory model variables.

This commit is contained in:
David Brown 2016-09-21 14:28:53 +01:00
parent 20a97bb570
commit 1c94abedc6
201 changed files with 607 additions and 763 deletions

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -18,6 +18,6 @@ export void *Configuration__init(void)
__DEFMOD; __DEFMOD;
__REGMOD("Configuration", 0); __REGMOD("Configuration", 0);
/* BEGIN */ /* BEGIN */
__MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h #ifndef Configuration__h
#define Configuration__h #define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h #ifndef Console__h
#define Console__h #define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h #ifndef Files__h
#define Files__h #define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h #ifndef Heap__h
#define Heap__h #define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h #ifndef Modules__h
#define Modules__h #define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_linttyp;
} }
@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_linttyp;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h #ifndef OPB__h
#define OPB__h #define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ)
OPC_Str1((CHAR*)", #), {", 8, typ->size); OPC_Str1((CHAR*)", #), {", 8, typ->size);
nofptrs = 0; nofptrs = 0;
OPC_PutPtrOffsets(typ, 0, &nofptrs); OPC_PutPtrOffsets(typ, 0, &nofptrs);
OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize));
OPC_EndStat(); OPC_EndStat();
} }
@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
if (OPC_ansi) { if (OPC_ansi) {
OPM_WriteInt(array->n); OPM_WriteInt(array->n);
} else { } else {
OPC_IntLiteral(array->n, OPM_PointerSize); OPC_IntLiteral(array->n, OPM_AddressSize);
} }
} }
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h #ifndef OPC__h
#define OPC__h #define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -19,7 +19,7 @@ typedef
static CHAR OPM_SourceFileName[256]; static CHAR OPM_SourceFileName[256];
export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
export int64 OPM_MaxIndex; export int64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr; export BOOLEAN OPM_noerr;
@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
case 'B': case 'B':
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_IntSize = (int16)s[__X(i, s__len)] - 48; OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48;
} }
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; OPM_AddressSize = (int16)s[__X(i, s__len)] - 48;
} }
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_Alignment = (int16)s[__X(i, s__len)] - 48; OPM_Alignment = (int16)s[__X(i, s__len)] - 48;
} }
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
if (OPM_IntegerSize == 2) {
OPM_LongintSize = 4;
OPM_SetSize = 4;
} else {
OPM_LongintSize = 8;
OPM_SetSize = 8;
}
Files_SetSearchPath((CHAR*)"", 1); Files_SetSearchPath((CHAR*)"", 1);
break; break;
case 'F': case 'F':
@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j)
static void OPM_VerboseListSizes (void) static void OPM_VerboseListSizes (void)
{ {
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWStr((CHAR*)"Type Size", 17);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"CHAR ", 14);
OPM_LogWNum(OPM_CharSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"BOOLEAN ", 14);
OPM_LogWNum(OPM_BoolSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", 14); OPM_LogWStr((CHAR*)"SHORTINT ", 14);
OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWNum(OPM_ShortintSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", 14); OPM_LogWStr((CHAR*)"INTEGER ", 14);
OPM_LogWNum(OPM_IntSize, 4); OPM_LogWNum(OPM_IntegerSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", 14); OPM_LogWStr((CHAR*)"LONGINT ", 14);
OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWStr((CHAR*)"SET ", 14);
OPM_LogWNum(OPM_SetSize, 4); OPM_LogWNum(OPM_SetSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"REAL ", 14); OPM_LogWStr((CHAR*)"ADDRESS ", 14);
OPM_LogWNum(OPM_RealSize, 4); OPM_LogWNum(OPM_AddressSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGREAL ", 14);
OPM_LogWNum(OPM_LRealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PTR ", 14);
OPM_LogWNum(OPM_PointerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROC ", 14);
OPM_LogWNum(OPM_ProcSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"RECORD ", 14);
OPM_LogWNum(OPM_RecSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Alignment: ", 12);
OPM_LogWNum(OPM_Alignment, 4);
OPM_LogWLn(); OPM_LogWLn();
} }
@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount)
static void OPM_GetProperties (void) static void OPM_GetProperties (void)
{ {
OPM_ProcSize = OPM_PointerSize;
OPM_LIntSize = __ASHL(OPM_IntSize, 1);
OPM_SetSize = OPM_LIntSize;
if (OPM_RealSize == 4) {
OPM_MaxReal = 3.40282346000000e+038; OPM_MaxReal = 3.40282346000000e+038;
} else if (OPM_RealSize == 8) {
OPM_MaxReal = 1.79769296342094e+308;
}
if (OPM_LRealSize == 4) {
OPM_MaxLReal = 3.40282346000000e+038;
} else if (OPM_LRealSize == 8) {
OPM_MaxLReal = 1.79769296342094e+308; OPM_MaxLReal = 1.79769296342094e+308;
}
OPM_MinReal = -OPM_MaxReal; OPM_MinReal = -OPM_MaxReal;
OPM_MinLReal = -OPM_MaxLReal; OPM_MinLReal = -OPM_MaxLReal;
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
if (OPM_Verbose) { if (OPM_Verbose) {
OPM_VerboseListSizes(); OPM_VerboseListSizes();
} }
@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i)
{ {
CHAR s[24]; CHAR s[24];
int64 i1, k; int64 i1, k;
if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) {
OPM_Write('('); OPM_Write('(');
OPM_WriteInt(i + 1); OPM_WriteInt(i + 1);
OPM_WriteString((CHAR*)"-1)", 4); OPM_WriteString((CHAR*)"-1)", 4);
@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
CHAR s[32]; CHAR s[32];
CHAR ch; CHAR ch;
int16 i; int16 i;
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) {
if (suffx == 'f') { if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", 7); OPM_WriteString((CHAR*)"(REAL)", 7);
} else { } else {
@ -1073,15 +1054,11 @@ export void *OPM__init(void)
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024);
OPM_CharSize = 1; OPM_AddressSize = 8;
OPM_BoolSize = 1;
OPM_SIntSize = 1;
OPM_RecSize = 1;
OPM_ByteSize = 1;
OPM_RealSize = 4;
OPM_LRealSize = 8;
OPM_PointerSize = 8;
OPM_Alignment = 8; OPM_Alignment = 8;
OPM_IntSize = 4; OPM_ShortintSize = 1;
OPM_IntegerSize = 4;
OPM_LongintSize = 8;
OPM_SetSize = 8;
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h #ifndef OPM__h
#define OPM__h #define OPM__h
@ -6,7 +6,7 @@
#include "SYSTEM.h" #include "SYSTEM.h"
import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
import int64 OPM_MaxIndex; import int64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr; import BOOLEAN OPM_noerr;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h #ifndef OPP__h
#define OPP__h #define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h #ifndef OPS__h
#define OPS__h #define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -89,7 +89,7 @@ typedef
export void (*OPT_typSize)(OPT_Struct); export void (*OPT_typSize)(OPT_Struct);
export OPT_Object OPT_topScope; export OPT_Object OPT_topScope;
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
export int8 OPT_nofGmod; export int8 OPT_nofGmod;
export OPT_Object OPT_GlbMod[64]; export OPT_Object OPT_GlbMod[64];
@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ)
switch (tag) { switch (tag) {
case 36: case 36:
(*typ)->form = 11; (*typ)->form = 11;
(*typ)->size = OPM_PointerSize; (*typ)->size = OPM_AddressSize;
(*typ)->n = 0; (*typ)->n = 0;
OPT_InStruct(&(*typ)->BaseTyp); OPT_InStruct(&(*typ)->BaseTyp);
break; break;
@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ)
break; break;
case 40: case 40:
(*typ)->form = 12; (*typ)->form = 12;
(*typ)->size = OPM_ProcSize; (*typ)->size = OPM_AddressSize;
OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link);
break; break;
default: default:
@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form)
{ {
*typ = OPT_NewStr(form, 1); *typ = OPT_NewStr(form, 1);
(*typ)->ref = form; (*typ)->ref = form;
(*typ)->size = OPM_ByteSize; (*typ)->size = 1;
(*typ)->allocated = 1; (*typ)->allocated = 1;
(*typ)->strobj = OPT_NewObj(); (*typ)->strobj = OPT_NewObj();
(*typ)->pbfp = form; (*typ)->pbfp = form;
@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*))
P(OPT_sinttyp); P(OPT_sinttyp);
P(OPT_inttyp); P(OPT_inttyp);
P(OPT_linttyp); P(OPT_linttyp);
P(OPT_hinttyp);
P(OPT_adrtyp); P(OPT_adrtyp);
P(OPT_int8typ); P(OPT_int8typ);
P(OPT_int16typ); P(OPT_int16typ);
@ -1916,9 +1917,9 @@ export void *OPT__init(void)
OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_notyp, 10);
OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_stringtyp, 8);
OPT_InitStruct(&OPT_niltyp, 9); OPT_InitStruct(&OPT_niltyp, 9);
OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp);
OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp);
OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp);
OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ);
OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ);
OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ);
@ -1938,11 +1939,12 @@ export void *OPT__init(void)
OPT_syslink = OPT_topScope->right; OPT_syslink = OPT_topScope->right;
OPT_universe = OPT_topScope; OPT_universe = OPT_topScope;
OPT_topScope->right = NIL; OPT_topScope->right = NIL;
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp);
OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp);
OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp);
OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj);
OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj);
OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h #ifndef OPT__h
#define OPT__h #define OPT__h
@ -68,7 +68,7 @@ typedef
import void (*OPT_typSize)(OPT_Struct); import void (*OPT_typSize)(OPT_Struct);
import OPT_Object OPT_topScope; import OPT_Object OPT_topScope;
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
import int8 OPT_nofGmod; import int8 OPT_nofGmod;
import OPT_Object OPT_GlbMod[64]; import OPT_Object OPT_GlbMod[64];

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ)
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
if (btyp == NIL) { if (btyp == NIL) {
offset = 0; offset = 0;
base = OPC_SizeAlignment(OPM_RecSize); base = 1;
} else { } else {
OPV_TypSize(btyp); OPV_TypSize(btyp);
offset = btyp->size - __ASHR(btyp->sysflag, 8); offset = btyp->size - __ASHR(btyp->sysflag, 8);
@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ)
OPV_TypSize(typ->BaseTyp); OPV_TypSize(typ->BaseTyp);
typ->size = typ->n * typ->BaseTyp->size; typ->size = typ->n * typ->BaseTyp->size;
} else if (f == 11) { } else if (f == 11) {
typ->size = OPM_PointerSize; typ->size = OPM_AddressSize;
if (typ->BaseTyp == OPT_undftyp) { if (typ->BaseTyp == OPT_undftyp) {
OPM_Mark(128, typ->n); OPM_Mark(128, typ->n);
} else { } else {
OPV_TypSize(typ->BaseTyp); OPV_TypSize(typ->BaseTyp);
} }
} else if (f == 12) { } else if (f == 12) {
typ->size = OPM_ProcSize; typ->size = OPM_AddressSize;
} else if (c == 3) { } else if (c == 3) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
OPV_TypSize(btyp); OPV_TypSize(btyp);
@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope)
OPT_int16typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2;
OPT_int32typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2;
OPT_int64typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2;
OPT_hinttyp->strobj->linkadr = 2;
OPT_lrltyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2;
OPT_booltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2;
OPT_bytetyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2;
@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
} else if (comp == 3) { } else if (comp == 3) {
if (n->class == 7) { if (n->class == 7) {
OPM_WriteString((CHAR*)", ", 3); OPM_WriteString((CHAR*)", ", 3);
OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize);
} else { } else {
aptyp = n->typ; aptyp = n->typ;
dim = 0; dim = 0;
@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
dim += 1; dim += 1;
aptyp = aptyp->BaseTyp; aptyp = aptyp->BaseTyp;
} }
OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); OPV_ParIntLiteral(aptyp->size, OPM_AddressSize);
} }
} }
} }
@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x)
OPM_WriteString((CHAR*)", ", 3); OPM_WriteString((CHAR*)", ", 3);
if (typ->comp == 3) { if (typ->comp == 3) {
if (x->class == 7) { if (x->class == 7) {
OPC_IntLiteral(x->conval->intval, OPM_PointerSize); OPC_IntLiteral(x->conval->intval, OPM_AddressSize);
} else { } else {
OPM_WriteString((CHAR*)"((address)(", 12); OPM_WriteString((CHAR*)"((address)(", 12);
OPV_expr(x, 10); OPV_expr(x, 10);
@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x)
} }
x = x->link; x = x->link;
} else { } else {
OPC_IntLiteral(typ->n, OPM_PointerSize); OPC_IntLiteral(typ->n, OPM_AddressSize);
} }
typ = typ->BaseTyp; typ = typ->BaseTyp;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPV__h #ifndef OPV__h
#define OPV__h #define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Platform__h #ifndef Platform__h
#define Platform__h #define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Reals__h #ifndef Reals__h
#define Reals__h #define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Strings__h #ifndef Strings__h
#define Strings__h #define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Texts__h #ifndef Texts__h
#define Texts__h #define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done)
static void Vishap_PropagateElementaryTypeSizes (void) static void Vishap_PropagateElementaryTypeSizes (void)
{ {
OPT_bytetyp->size = OPM_ByteSize; OPT_sysptrtyp->size = OPM_AddressSize;
OPT_sysptrtyp->size = OPM_PointerSize; OPT_adrtyp->size = OPM_AddressSize;
OPT_chartyp->size = OPM_CharSize;
OPT_settyp->size = OPM_SetSize; OPT_settyp->size = OPM_SetSize;
OPT_realtyp->size = OPM_RealSize; OPT_sinttyp = OPT_IntType(OPM_ShortintSize);
OPT_adrtyp->size = OPM_PointerSize; OPT_inttyp = OPT_IntType(OPM_IntegerSize);
OPT_lrltyp->size = OPM_LRealSize; OPT_linttyp = OPT_IntType(OPM_LongintSize);
OPT_booltyp->size = OPM_BoolSize;
OPT_sinttyp = OPT_int8typ;
if (OPM_IntSize == 2) {
OPT_inttyp = OPT_int16typ;
OPT_linttyp = OPT_int32typ;
} else {
OPT_inttyp = OPT_int32typ;
OPT_linttyp = OPT_int64typ;
}
OPT_sintobj->typ = OPT_sinttyp; OPT_sintobj->typ = OPT_sinttyp;
OPT_intobj->typ = OPT_inttyp; OPT_intobj->typ = OPT_inttyp;
OPT_lintobj->typ = OPT_linttyp; OPT_lintobj->typ = OPT_linttyp;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef errors__h #ifndef errors__h
#define errors__h #define errors__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef extTools__h #ifndef extTools__h
#define extTools__h #define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef vt100__h #ifndef vt100__h
#define vt100__h #define vt100__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -18,6 +18,6 @@ export void *Configuration__init(void)
__DEFMOD; __DEFMOD;
__REGMOD("Configuration", 0); __REGMOD("Configuration", 0);
/* BEGIN */ /* BEGIN */
__MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h #ifndef Configuration__h
#define Configuration__h #define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h #ifndef Console__h
#define Console__h #define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h #ifndef Files__h
#define Files__h #define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h #ifndef Heap__h
#define Heap__h #define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h #ifndef Modules__h
#define Modules__h #define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int16 fctno)
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_linttyp;
} }
@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_PointerSize))) { } else if (!((__IN(x->typ->form, 0x0810, 32) && x->typ->size == OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_linttyp;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h #ifndef OPB__h
#define OPB__h #define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ)
OPC_Str1((CHAR*)", #), {", 8, typ->size); OPC_Str1((CHAR*)", #), {", 8, typ->size);
nofptrs = 0; nofptrs = 0;
OPC_PutPtrOffsets(typ, 0, &nofptrs); OPC_PutPtrOffsets(typ, 0, &nofptrs);
OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_PointerSize)); OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * OPM_AddressSize));
OPC_EndStat(); OPC_EndStat();
} }
@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
if (OPC_ansi) { if (OPC_ansi) {
OPM_WriteInt(array->n); OPM_WriteInt(array->n);
} else { } else {
OPC_IntLiteral(array->n, OPM_PointerSize); OPC_IntLiteral(array->n, OPM_AddressSize);
} }
} }
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h #ifndef OPC__h
#define OPC__h #define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -19,7 +19,7 @@ typedef
static CHAR OPM_SourceFileName[256]; static CHAR OPM_SourceFileName[256];
export int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; export int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
export int64 OPM_MaxIndex; export int64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr; export BOOLEAN OPM_noerr;
@ -177,19 +177,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
case 'B': case 'B':
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_IntSize = (int16)s[__X(i, s__len)] - 48; OPM_IntegerSize = (int16)s[__X(i, s__len)] - 48;
} }
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_PointerSize = (int16)s[__X(i, s__len)] - 48; OPM_AddressSize = (int16)s[__X(i, s__len)] - 48;
} }
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_Alignment = (int16)s[__X(i, s__len)] - 48; OPM_Alignment = (int16)s[__X(i, s__len)] - 48;
} }
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
if (OPM_IntegerSize == 2) {
OPM_LongintSize = 4;
OPM_SetSize = 4;
} else {
OPM_LongintSize = 8;
OPM_SetSize = 8;
}
Files_SetSearchPath((CHAR*)"", 1); Files_SetSearchPath((CHAR*)"", 1);
break; break;
case 'F': case 'F':
@ -627,41 +634,26 @@ static int32 OPM_power0 (int32 i, int32 j)
static void OPM_VerboseListSizes (void) static void OPM_VerboseListSizes (void)
{ {
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWStr((CHAR*)"Type Size", 17);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"CHAR ", 14);
OPM_LogWNum(OPM_CharSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"BOOLEAN ", 14);
OPM_LogWNum(OPM_BoolSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", 14); OPM_LogWStr((CHAR*)"SHORTINT ", 14);
OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWNum(OPM_ShortintSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", 14); OPM_LogWStr((CHAR*)"INTEGER ", 14);
OPM_LogWNum(OPM_IntSize, 4); OPM_LogWNum(OPM_IntegerSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", 14); OPM_LogWStr((CHAR*)"LONGINT ", 14);
OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWStr((CHAR*)"SET ", 14);
OPM_LogWNum(OPM_SetSize, 4); OPM_LogWNum(OPM_SetSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"REAL ", 14); OPM_LogWStr((CHAR*)"ADDRESS ", 14);
OPM_LogWNum(OPM_RealSize, 4); OPM_LogWNum(OPM_AddressSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGREAL ", 14);
OPM_LogWNum(OPM_LRealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PTR ", 14);
OPM_LogWNum(OPM_PointerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROC ", 14);
OPM_LogWNum(OPM_ProcSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"RECORD ", 14);
OPM_LogWNum(OPM_RecSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Alignment: ", 12);
OPM_LogWNum(OPM_Alignment, 4);
OPM_LogWLn(); OPM_LogWLn();
} }
@ -684,23 +676,12 @@ int64 OPM_SignedMinimum (int32 bytecount)
static void OPM_GetProperties (void) static void OPM_GetProperties (void)
{ {
OPM_ProcSize = OPM_PointerSize;
OPM_LIntSize = __ASHL(OPM_IntSize, 1);
OPM_SetSize = OPM_LIntSize;
if (OPM_RealSize == 4) {
OPM_MaxReal = 3.40282346000000e+038; OPM_MaxReal = 3.40282346000000e+038;
} else if (OPM_RealSize == 8) {
OPM_MaxReal = 1.79769296342094e+308;
}
if (OPM_LRealSize == 4) {
OPM_MaxLReal = 3.40282346000000e+038;
} else if (OPM_LRealSize == 8) {
OPM_MaxLReal = 1.79769296342094e+308; OPM_MaxLReal = 1.79769296342094e+308;
}
OPM_MinReal = -OPM_MaxReal; OPM_MinReal = -OPM_MaxReal;
OPM_MinLReal = -OPM_MaxLReal; OPM_MinLReal = -OPM_MaxLReal;
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
if (OPM_Verbose) { if (OPM_Verbose) {
OPM_VerboseListSizes(); OPM_VerboseListSizes();
} }
@ -871,7 +852,7 @@ void OPM_WriteInt (int64 i)
{ {
CHAR s[24]; CHAR s[24];
int64 i1, k; int64 i1, k;
if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) {
OPM_Write('('); OPM_Write('(');
OPM_WriteInt(i + 1); OPM_WriteInt(i + 1);
OPM_WriteString((CHAR*)"-1)", 4); OPM_WriteString((CHAR*)"-1)", 4);
@ -904,7 +885,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
CHAR s[32]; CHAR s[32];
CHAR ch; CHAR ch;
int16 i; int16 i;
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == ((int32)__ENTIER(r)))) { if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == ((int32)__ENTIER(r)))) {
if (suffx == 'f') { if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", 7); OPM_WriteString((CHAR*)"(REAL)", 7);
} else { } else {
@ -1073,15 +1054,11 @@ export void *OPM__init(void)
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024);
OPM_CharSize = 1; OPM_AddressSize = 8;
OPM_BoolSize = 1;
OPM_SIntSize = 1;
OPM_RecSize = 1;
OPM_ByteSize = 1;
OPM_RealSize = 4;
OPM_LRealSize = 8;
OPM_PointerSize = 8;
OPM_Alignment = 8; OPM_Alignment = 8;
OPM_IntSize = 4; OPM_ShortintSize = 1;
OPM_IntegerSize = 4;
OPM_LongintSize = 8;
OPM_SetSize = 8;
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h #ifndef OPM__h
#define OPM__h #define OPM__h
@ -6,7 +6,7 @@
#include "SYSTEM.h" #include "SYSTEM.h"
import int16 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; import int16 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
import int64 OPM_MaxIndex; import int64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr; import BOOLEAN OPM_noerr;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h #ifndef OPP__h
#define OPP__h #define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h #ifndef OPS__h
#define OPS__h #define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -89,7 +89,7 @@ typedef
export void (*OPT_typSize)(OPT_Struct); export void (*OPT_typSize)(OPT_Struct);
export OPT_Object OPT_topScope; export OPT_Object OPT_topScope;
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
export int8 OPT_nofGmod; export int8 OPT_nofGmod;
export OPT_Object OPT_GlbMod[64]; export OPT_Object OPT_GlbMod[64];
@ -1110,7 +1110,7 @@ static void OPT_InStruct (OPT_Struct *typ)
switch (tag) { switch (tag) {
case 36: case 36:
(*typ)->form = 11; (*typ)->form = 11;
(*typ)->size = OPM_PointerSize; (*typ)->size = OPM_AddressSize;
(*typ)->n = 0; (*typ)->n = 0;
OPT_InStruct(&(*typ)->BaseTyp); OPT_InStruct(&(*typ)->BaseTyp);
break; break;
@ -1168,7 +1168,7 @@ static void OPT_InStruct (OPT_Struct *typ)
break; break;
case 40: case 40:
(*typ)->form = 12; (*typ)->form = 12;
(*typ)->size = OPM_ProcSize; (*typ)->size = OPM_AddressSize;
OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link);
break; break;
default: default:
@ -1756,7 +1756,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form)
{ {
*typ = OPT_NewStr(form, 1); *typ = OPT_NewStr(form, 1);
(*typ)->ref = form; (*typ)->ref = form;
(*typ)->size = OPM_ByteSize; (*typ)->size = 1;
(*typ)->allocated = 1; (*typ)->allocated = 1;
(*typ)->strobj = OPT_NewObj(); (*typ)->strobj = OPT_NewObj();
(*typ)->pbfp = form; (*typ)->pbfp = form;
@ -1834,6 +1834,7 @@ static void EnumPtrs(void (*P)(void*))
P(OPT_sinttyp); P(OPT_sinttyp);
P(OPT_inttyp); P(OPT_inttyp);
P(OPT_linttyp); P(OPT_linttyp);
P(OPT_hinttyp);
P(OPT_adrtyp); P(OPT_adrtyp);
P(OPT_int8typ); P(OPT_int8typ);
P(OPT_int16typ); P(OPT_int16typ);
@ -1916,9 +1917,9 @@ export void *OPT__init(void)
OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_notyp, 10);
OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_stringtyp, 8);
OPT_InitStruct(&OPT_niltyp, 9); OPT_InitStruct(&OPT_niltyp, 9);
OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp);
OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp);
OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp);
OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ);
OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ);
OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ);
@ -1938,11 +1939,12 @@ export void *OPT__init(void)
OPT_syslink = OPT_topScope->right; OPT_syslink = OPT_topScope->right;
OPT_universe = OPT_topScope; OPT_universe = OPT_topScope;
OPT_topScope->right = NIL; OPT_topScope->right = NIL;
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp);
OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp);
OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp);
OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj);
OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj);
OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h #ifndef OPT__h
#define OPT__h #define OPT__h
@ -68,7 +68,7 @@ typedef
import void (*OPT_typSize)(OPT_Struct); import void (*OPT_typSize)(OPT_Struct);
import OPT_Object OPT_topScope; import OPT_Object OPT_topScope;
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
import int8 OPT_nofGmod; import int8 OPT_nofGmod;
import OPT_Object OPT_GlbMod[64]; import OPT_Object OPT_GlbMod[64];

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -69,7 +69,7 @@ void OPV_TypSize (OPT_Struct typ)
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
if (btyp == NIL) { if (btyp == NIL) {
offset = 0; offset = 0;
base = OPC_SizeAlignment(OPM_RecSize); base = 1;
} else { } else {
OPV_TypSize(btyp); OPV_TypSize(btyp);
offset = btyp->size - __ASHR(btyp->sysflag, 8); offset = btyp->size - __ASHR(btyp->sysflag, 8);
@ -105,14 +105,14 @@ void OPV_TypSize (OPT_Struct typ)
OPV_TypSize(typ->BaseTyp); OPV_TypSize(typ->BaseTyp);
typ->size = typ->n * typ->BaseTyp->size; typ->size = typ->n * typ->BaseTyp->size;
} else if (f == 11) { } else if (f == 11) {
typ->size = OPM_PointerSize; typ->size = OPM_AddressSize;
if (typ->BaseTyp == OPT_undftyp) { if (typ->BaseTyp == OPT_undftyp) {
OPM_Mark(128, typ->n); OPM_Mark(128, typ->n);
} else { } else {
OPV_TypSize(typ->BaseTyp); OPV_TypSize(typ->BaseTyp);
} }
} else if (f == 12) { } else if (f == 12) {
typ->size = OPM_ProcSize; typ->size = OPM_AddressSize;
} else if (c == 3) { } else if (c == 3) {
btyp = typ->BaseTyp; btyp = typ->BaseTyp;
OPV_TypSize(btyp); OPV_TypSize(btyp);
@ -273,6 +273,7 @@ void OPV_AdrAndSize (OPT_Object topScope)
OPT_int16typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2;
OPT_int32typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2;
OPT_int64typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2;
OPT_hinttyp->strobj->linkadr = 2;
OPT_lrltyp->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2;
OPT_booltyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2;
OPT_bytetyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2;
@ -790,7 +791,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
} else if (comp == 3) { } else if (comp == 3) {
if (n->class == 7) { if (n->class == 7) {
OPM_WriteString((CHAR*)", ", 3); OPM_WriteString((CHAR*)", ", 3);
OPV_ParIntLiteral(n->conval->intval2, OPM_PointerSize); OPV_ParIntLiteral(n->conval->intval2, OPM_AddressSize);
} else { } else {
aptyp = n->typ; aptyp = n->typ;
dim = 0; dim = 0;
@ -809,7 +810,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
dim += 1; dim += 1;
aptyp = aptyp->BaseTyp; aptyp = aptyp->BaseTyp;
} }
OPV_ParIntLiteral(aptyp->size, OPM_PointerSize); OPV_ParIntLiteral(aptyp->size, OPM_AddressSize);
} }
} }
} }
@ -1314,7 +1315,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x)
OPM_WriteString((CHAR*)", ", 3); OPM_WriteString((CHAR*)", ", 3);
if (typ->comp == 3) { if (typ->comp == 3) {
if (x->class == 7) { if (x->class == 7) {
OPC_IntLiteral(x->conval->intval, OPM_PointerSize); OPC_IntLiteral(x->conval->intval, OPM_AddressSize);
} else { } else {
OPM_WriteString((CHAR*)"((address)(", 12); OPM_WriteString((CHAR*)"((address)(", 12);
OPV_expr(x, 10); OPV_expr(x, 10);
@ -1322,7 +1323,7 @@ static void OPV_NewArr (OPT_Node d, OPT_Node x)
} }
x = x->link; x = x->link;
} else { } else {
OPC_IntLiteral(typ->n, OPM_PointerSize); OPC_IntLiteral(typ->n, OPM_AddressSize);
} }
typ = typ->BaseTyp; typ = typ->BaseTyp;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPV__h #ifndef OPV__h
#define OPV__h #define OPV__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Platform__h #ifndef Platform__h
#define Platform__h #define Platform__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Reals__h #ifndef Reals__h
#define Reals__h #define Reals__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Strings__h #ifndef Strings__h
#define Strings__h #define Strings__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Texts__h #ifndef Texts__h
#define Texts__h #define Texts__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkamSf */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkamSf */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32
@ -79,22 +79,12 @@ void Vishap_Module (BOOLEAN *done)
static void Vishap_PropagateElementaryTypeSizes (void) static void Vishap_PropagateElementaryTypeSizes (void)
{ {
OPT_bytetyp->size = OPM_ByteSize; OPT_sysptrtyp->size = OPM_AddressSize;
OPT_sysptrtyp->size = OPM_PointerSize; OPT_adrtyp->size = OPM_AddressSize;
OPT_chartyp->size = OPM_CharSize;
OPT_settyp->size = OPM_SetSize; OPT_settyp->size = OPM_SetSize;
OPT_realtyp->size = OPM_RealSize; OPT_sinttyp = OPT_IntType(OPM_ShortintSize);
OPT_adrtyp->size = OPM_PointerSize; OPT_inttyp = OPT_IntType(OPM_IntegerSize);
OPT_lrltyp->size = OPM_LRealSize; OPT_linttyp = OPT_IntType(OPM_LongintSize);
OPT_booltyp->size = OPM_BoolSize;
OPT_sinttyp = OPT_int8typ;
if (OPM_IntSize == 2) {
OPT_inttyp = OPT_int16typ;
OPT_linttyp = OPT_int32typ;
} else {
OPT_inttyp = OPT_int32typ;
OPT_linttyp = OPT_int64typ;
}
OPT_sintobj->typ = OPT_sinttyp; OPT_sintobj->typ = OPT_sinttyp;
OPT_intobj->typ = OPT_inttyp; OPT_intobj->typ = OPT_inttyp;
OPT_lintobj->typ = OPT_linttyp; OPT_lintobj->typ = OPT_linttyp;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef errors__h #ifndef errors__h
#define errors__h #define errors__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef extTools__h #ifndef extTools__h
#define extTools__h #define extTools__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int16 #define INTEGER int16
#define LONGINT int32 #define LONGINT int32

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef vt100__h #ifndef vt100__h
#define vt100__h #define vt100__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64
@ -18,6 +18,6 @@ export void *Configuration__init(void)
__DEFMOD; __DEFMOD;
__REGMOD("Configuration", 0); __REGMOD("Configuration", 0);
/* BEGIN */ /* BEGIN */
__MOVE("1.95 [2016/09/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __MOVE("1.95 [2016/09/21] for gcc LP64 on cygwin", Configuration_versionLong, 41);
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Configuration__h #ifndef Configuration__h
#define Configuration__h #define Configuration__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Console__h #ifndef Console__h
#define Console__h #define Console__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#ifndef Files__h #ifndef Files__h
#define Files__h #define Files__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tskSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tskSfF */
#ifndef Heap__h #ifndef Heap__h
#define Heap__h #define Heap__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef Modules__h #ifndef Modules__h
#define Modules__h #define Modules__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64
@ -1940,7 +1940,7 @@ void OPB_StPar0 (OPT_Node *par0, int32 fctno)
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_linttyp;
} }
@ -2213,7 +2213,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, int8 fctno)
OPB_err(126); OPB_err(126);
} else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) { } else if ((((x->class == 7 && f == 4)) && x->typ->size < OPT_linttyp->size)) {
OPB_Convert(&x, OPT_linttyp); OPB_Convert(&x, OPT_linttyp);
} else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_PointerSize))) { } else if (!((__IN(x->typ->form, 0x0810, 64) && x->typ->size == (int64)OPM_AddressSize))) {
OPB_err(111); OPB_err(111);
x->typ = OPT_linttyp; x->typ = OPT_linttyp;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPB__h #ifndef OPB__h
#define OPB__h #define OPB__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64
@ -839,7 +839,7 @@ void OPC_TDescDecl (OPT_Struct typ)
OPC_Str1((CHAR*)", #), {", 8, typ->size); OPC_Str1((CHAR*)", #), {", 8, typ->size);
nofptrs = 0; nofptrs = 0;
OPC_PutPtrOffsets(typ, 0, &nofptrs); OPC_PutPtrOffsets(typ, 0, &nofptrs);
OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_PointerSize)); OPC_Str1((CHAR*)"#}}", 4, -((nofptrs + 1) * (int64)OPM_AddressSize));
OPC_EndStat(); OPC_EndStat();
} }
@ -1966,7 +1966,7 @@ void OPC_Len (OPT_Object obj, OPT_Struct array, int64 dim)
if (OPC_ansi) { if (OPC_ansi) {
OPM_WriteInt(array->n); OPM_WriteInt(array->n);
} else { } else {
OPC_IntLiteral(array->n, OPM_PointerSize); OPC_IntLiteral(array->n, OPM_AddressSize);
} }
} }
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPC__h #ifndef OPC__h
#define OPC__h #define OPC__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64
@ -19,7 +19,7 @@ typedef
static CHAR OPM_SourceFileName[256]; static CHAR OPM_SourceFileName[256];
export int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; export int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
export int64 OPM_MaxIndex; export int64 OPM_MaxIndex;
export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; export LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
export BOOLEAN OPM_noerr; export BOOLEAN OPM_noerr;
@ -176,19 +176,26 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
case 'B': case 'B':
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_IntSize = s[__X(i, s__len)] - 48; OPM_IntegerSize = s[__X(i, s__len)] - 48;
} }
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_PointerSize = s[__X(i, s__len)] - 48; OPM_AddressSize = s[__X(i, s__len)] - 48;
} }
if (s[__X(i + 1, s__len)] != 0x00) { if (s[__X(i + 1, s__len)] != 0x00) {
i += 1; i += 1;
OPM_Alignment = s[__X(i, s__len)] - 48; OPM_Alignment = s[__X(i, s__len)] - 48;
} }
__ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_IntegerSize == 2 || OPM_IntegerSize == 4, 0);
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); __ASSERT(OPM_AddressSize == 4 || OPM_AddressSize == 8, 0);
__ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0); __ASSERT(OPM_Alignment == 4 || OPM_Alignment == 8, 0);
if (OPM_IntegerSize == 2) {
OPM_LongintSize = 4;
OPM_SetSize = 4;
} else {
OPM_LongintSize = 8;
OPM_SetSize = 8;
}
Files_SetSearchPath((CHAR*)"", 1); Files_SetSearchPath((CHAR*)"", 1);
break; break;
case 'F': case 'F':
@ -624,41 +631,26 @@ static int64 OPM_power0 (int64 i, int64 j)
static void OPM_VerboseListSizes (void) static void OPM_VerboseListSizes (void)
{ {
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Type Size Alignement", 29); OPM_LogWStr((CHAR*)"Type Size", 17);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"CHAR ", 14);
OPM_LogWNum(OPM_CharSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"BOOLEAN ", 14);
OPM_LogWNum(OPM_BoolSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"SHORTINT ", 14); OPM_LogWStr((CHAR*)"SHORTINT ", 14);
OPM_LogWNum(OPM_SIntSize, 4); OPM_LogWNum(OPM_ShortintSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"INTEGER ", 14); OPM_LogWStr((CHAR*)"INTEGER ", 14);
OPM_LogWNum(OPM_IntSize, 4); OPM_LogWNum(OPM_IntegerSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGINT ", 14); OPM_LogWStr((CHAR*)"LONGINT ", 14);
OPM_LogWNum(OPM_LIntSize, 4); OPM_LogWNum(OPM_LongintSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"SET ", 14); OPM_LogWStr((CHAR*)"SET ", 14);
OPM_LogWNum(OPM_SetSize, 4); OPM_LogWNum(OPM_SetSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"REAL ", 14); OPM_LogWStr((CHAR*)"ADDRESS ", 14);
OPM_LogWNum(OPM_RealSize, 4); OPM_LogWNum(OPM_AddressSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"LONGREAL ", 14);
OPM_LogWNum(OPM_LRealSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PTR ", 14);
OPM_LogWNum(OPM_PointerSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"PROC ", 14);
OPM_LogWNum(OPM_ProcSize, 4);
OPM_LogWLn();
OPM_LogWStr((CHAR*)"RECORD ", 14);
OPM_LogWNum(OPM_RecSize, 4);
OPM_LogWLn(); OPM_LogWLn();
OPM_LogWStr((CHAR*)"Alignment: ", 12);
OPM_LogWNum(OPM_Alignment, 4);
OPM_LogWLn(); OPM_LogWLn();
} }
@ -681,23 +673,12 @@ int64 OPM_SignedMinimum (int64 bytecount)
static void OPM_GetProperties (void) static void OPM_GetProperties (void)
{ {
OPM_ProcSize = OPM_PointerSize;
OPM_LIntSize = __ASHL(OPM_IntSize, 1);
OPM_SetSize = OPM_LIntSize;
if (OPM_RealSize == 4) {
OPM_MaxReal = 3.40282346000000e+038; OPM_MaxReal = 3.40282346000000e+038;
} else if (OPM_RealSize == 8) {
OPM_MaxReal = 1.79769296342094e+308;
}
if (OPM_LRealSize == 4) {
OPM_MaxLReal = 3.40282346000000e+038;
} else if (OPM_LRealSize == 8) {
OPM_MaxLReal = 1.79769296342094e+308; OPM_MaxLReal = 1.79769296342094e+308;
}
OPM_MinReal = -OPM_MaxReal; OPM_MinReal = -OPM_MaxReal;
OPM_MinLReal = -OPM_MaxLReal; OPM_MinLReal = -OPM_MaxLReal;
OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1; OPM_MaxSet = __ASHL(OPM_SetSize, 3) - 1;
OPM_MaxIndex = OPM_SignedMaximum(OPM_PointerSize); OPM_MaxIndex = OPM_SignedMaximum(OPM_AddressSize);
if (OPM_Verbose) { if (OPM_Verbose) {
OPM_VerboseListSizes(); OPM_VerboseListSizes();
} }
@ -868,7 +849,7 @@ void OPM_WriteInt (int64 i)
{ {
CHAR s[24]; CHAR s[24];
int64 i1, k; int64 i1, k;
if ((i == OPM_SignedMinimum(OPM_IntSize) || i == OPM_SignedMinimum(OPM_LIntSize)) || i == OPM_SignedMinimum(8)) { if ((i == OPM_SignedMinimum(2) || i == OPM_SignedMinimum(4)) || i == OPM_SignedMinimum(8)) {
OPM_Write('('); OPM_Write('(');
OPM_WriteInt(i + 1); OPM_WriteInt(i + 1);
OPM_WriteString((CHAR*)"-1)", 4); OPM_WriteString((CHAR*)"-1)", 4);
@ -901,7 +882,7 @@ void OPM_WriteReal (LONGREAL r, CHAR suffx)
CHAR s[32]; CHAR s[32];
CHAR ch; CHAR ch;
int32 i; int32 i;
if ((((r < OPM_SignedMaximum(OPM_LIntSize) && r > OPM_SignedMinimum(OPM_LIntSize))) && r == (__ENTIER(r)))) { if ((((r < OPM_SignedMaximum(OPM_LongintSize) && r > OPM_SignedMinimum(OPM_LongintSize))) && r == (__ENTIER(r)))) {
if (suffx == 'f') { if (suffx == 'f') {
OPM_WriteString((CHAR*)"(REAL)", 7); OPM_WriteString((CHAR*)"(REAL)", 7);
} else { } else {
@ -1070,15 +1051,11 @@ export void *OPM__init(void)
Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/opt/voc", 9, (void*)OPM_OBERON, 1024);
Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024); Strings_Append((CHAR*)"/sym;", 6, (void*)OPM_OBERON, 1024);
Files_SetSearchPath(OPM_OBERON, 1024); Files_SetSearchPath(OPM_OBERON, 1024);
OPM_CharSize = 1; OPM_AddressSize = 8;
OPM_BoolSize = 1;
OPM_SIntSize = 1;
OPM_RecSize = 1;
OPM_ByteSize = 1;
OPM_RealSize = 4;
OPM_LRealSize = 8;
OPM_PointerSize = 8;
OPM_Alignment = 8; OPM_Alignment = 8;
OPM_IntSize = 4; OPM_ShortintSize = 1;
OPM_IntegerSize = 4;
OPM_LongintSize = 8;
OPM_SetSize = 8;
__ENDMOD; __ENDMOD;
} }

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPM__h #ifndef OPM__h
#define OPM__h #define OPM__h
@ -6,7 +6,7 @@
#include "SYSTEM.h" #include "SYSTEM.h"
import int32 OPM_Alignment, OPM_ByteSize, OPM_CharSize, OPM_BoolSize, OPM_SIntSize, OPM_IntSize, OPM_LIntSize, OPM_SetSize, OPM_RealSize, OPM_LRealSize, OPM_PointerSize, OPM_ProcSize, OPM_RecSize, OPM_MaxSet; import int32 OPM_Alignment, OPM_AddressSize, OPM_SetSize, OPM_ShortintSize, OPM_IntegerSize, OPM_LongintSize, OPM_MaxSet;
import int64 OPM_MaxIndex; import int64 OPM_MaxIndex;
import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal; import LONGREAL OPM_MinReal, OPM_MaxReal, OPM_MinLReal, OPM_MaxLReal;
import BOOLEAN OPM_noerr; import BOOLEAN OPM_noerr;

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPP__h #ifndef OPP__h
#define OPP__h #define OPP__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin tspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin tspkaSfF */
#ifndef OPS__h #ifndef OPS__h
#define OPS__h #define OPS__h

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#define INTEGER int32 #define INTEGER int32
#define LONGINT int64 #define LONGINT int64
@ -88,7 +88,7 @@ typedef
export void (*OPT_typSize)(OPT_Struct); export void (*OPT_typSize)(OPT_Struct);
export OPT_Object OPT_topScope; export OPT_Object OPT_topScope;
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; export OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
export int8 OPT_nofGmod; export int8 OPT_nofGmod;
export OPT_Object OPT_GlbMod[64]; export OPT_Object OPT_GlbMod[64];
@ -1109,7 +1109,7 @@ static void OPT_InStruct (OPT_Struct *typ)
switch (tag) { switch (tag) {
case 36: case 36:
(*typ)->form = 11; (*typ)->form = 11;
(*typ)->size = OPM_PointerSize; (*typ)->size = OPM_AddressSize;
(*typ)->n = 0; (*typ)->n = 0;
OPT_InStruct(&(*typ)->BaseTyp); OPT_InStruct(&(*typ)->BaseTyp);
break; break;
@ -1167,7 +1167,7 @@ static void OPT_InStruct (OPT_Struct *typ)
break; break;
case 40: case 40:
(*typ)->form = 12; (*typ)->form = 12;
(*typ)->size = OPM_ProcSize; (*typ)->size = OPM_AddressSize;
OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link); OPT_InSign(mno, &(*typ)->BaseTyp, &(*typ)->link);
break; break;
default: default:
@ -1755,7 +1755,7 @@ static void OPT_InitStruct (OPT_Struct *typ, int8 form)
{ {
*typ = OPT_NewStr(form, 1); *typ = OPT_NewStr(form, 1);
(*typ)->ref = form; (*typ)->ref = form;
(*typ)->size = OPM_ByteSize; (*typ)->size = 1;
(*typ)->allocated = 1; (*typ)->allocated = 1;
(*typ)->strobj = OPT_NewObj(); (*typ)->strobj = OPT_NewObj();
(*typ)->pbfp = form; (*typ)->pbfp = form;
@ -1833,6 +1833,7 @@ static void EnumPtrs(void (*P)(void*))
P(OPT_sinttyp); P(OPT_sinttyp);
P(OPT_inttyp); P(OPT_inttyp);
P(OPT_linttyp); P(OPT_linttyp);
P(OPT_hinttyp);
P(OPT_adrtyp); P(OPT_adrtyp);
P(OPT_int8typ); P(OPT_int8typ);
P(OPT_int16typ); P(OPT_int16typ);
@ -1915,9 +1916,9 @@ export void *OPT__init(void)
OPT_InitStruct(&OPT_notyp, 10); OPT_InitStruct(&OPT_notyp, 10);
OPT_InitStruct(&OPT_stringtyp, 8); OPT_InitStruct(&OPT_stringtyp, 8);
OPT_InitStruct(&OPT_niltyp, 9); OPT_InitStruct(&OPT_niltyp, 9);
OPT_EnterTyp((CHAR*)"BYTE", 1, OPM_ByteSize, &OPT_bytetyp); OPT_EnterTyp((CHAR*)"BYTE", 1, 1, &OPT_bytetyp);
OPT_EnterTyp((CHAR*)"PTR", 11, OPM_PointerSize, &OPT_sysptrtyp); OPT_EnterTyp((CHAR*)"PTR", 11, -1, &OPT_sysptrtyp);
OPT_EnterTyp((CHAR*)"ADDRESS", 4, OPM_PointerSize, &OPT_adrtyp); OPT_EnterTyp((CHAR*)"ADDRESS", 4, -1, &OPT_adrtyp);
OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ); OPT_EnterTyp((CHAR*)"INT8", 4, 1, &OPT_int8typ);
OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ); OPT_EnterTyp((CHAR*)"INT16", 4, 2, &OPT_int16typ);
OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ); OPT_EnterTyp((CHAR*)"INT32", 4, 4, &OPT_int32typ);
@ -1937,11 +1938,12 @@ export void *OPT__init(void)
OPT_syslink = OPT_topScope->right; OPT_syslink = OPT_topScope->right;
OPT_universe = OPT_topScope; OPT_universe = OPT_topScope;
OPT_topScope->right = NIL; OPT_topScope->right = NIL;
OPT_EnterTyp((CHAR*)"BOOLEAN", 2, OPM_BoolSize, &OPT_booltyp); OPT_EnterTyp((CHAR*)"BOOLEAN", 2, 1, &OPT_booltyp);
OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"CHAR", 3, 1, &OPT_chartyp);
OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"SET", 7, -1, &OPT_settyp);
OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); OPT_EnterTyp((CHAR*)"REAL", 5, 4, &OPT_realtyp);
OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, 8, &OPT_lrltyp);
OPT_EnterTyp((CHAR*)"HUGEINT", 4, 8, &OPT_hinttyp);
OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj);
OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj);
OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj);

View file

@ -1,4 +1,4 @@
/* voc 1.95 [2016/09/20] for gcc LP64 on cygwin xtspkaSfF */ /* voc 1.95 [2016/09/21] for gcc LP64 on cygwin xtspkaSfF */
#ifndef OPT__h #ifndef OPT__h
#define OPT__h #define OPT__h
@ -67,7 +67,7 @@ typedef
import void (*OPT_typSize)(OPT_Struct); import void (*OPT_typSize)(OPT_Struct);
import OPT_Object OPT_topScope; import OPT_Object OPT_topScope;
import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp; import OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_hinttyp, OPT_adrtyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import OPT_Object OPT_sintobj, OPT_intobj, OPT_lintobj;
import int8 OPT_nofGmod; import int8 OPT_nofGmod;
import OPT_Object OPT_GlbMod[64]; import OPT_Object OPT_GlbMod[64];

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