Moving to config independent types stage 1 - generate intxx types.

This commit is contained in:
David Brown 2016-09-01 14:14:06 +01:00
parent 159f5a3d80
commit ee8342ef0d
168 changed files with 6673 additions and 6565 deletions

View file

@ -13,17 +13,17 @@ typedef
typedef
struct OPT_ConstDesc {
OPT_ConstExt ext;
LONGINT intval, intval2;
int64 intval, intval2;
SET setval;
LONGREAL realval;
} OPT_ConstDesc;
typedef
struct OPT_ExpCtxt {
LONGINT reffp;
INTEGER ref;
SHORTINT nofm;
SHORTINT locmno[64];
int64 reffp;
int32 ref;
int8 nofm;
int8 locmno[64];
} OPT_ExpCtxt;
typedef
@ -34,13 +34,13 @@ typedef
typedef
struct OPT_ImpCtxt {
LONGINT nextTag, reffp;
INTEGER nofr, minr, nofm;
int64 nextTag, reffp;
int32 nofr, minr, nofm;
BOOLEAN self;
OPT_Struct ref[255];
OPT_Object old[255];
LONGINT pvfp[255];
SHORTINT glbmno[64];
int64 pvfp[255];
int8 glbmno[64];
} OPT_ImpCtxt;
typedef
@ -49,7 +49,7 @@ typedef
typedef
struct OPT_NodeDesc {
OPT_Node left, right, link;
SHORTINT class, subcl;
int8 class, subcl;
BOOLEAN readonly;
OPT_Struct typ;
OPT_Object obj;
@ -61,22 +61,22 @@ typedef
OPT_Object left, right, link, scope;
OPS_Name name;
BOOLEAN leaf;
SHORTINT mode, mnolev, vis, history;
int8 mode, mnolev, vis, history;
BOOLEAN used, fpdone;
LONGINT fprint;
int64 fprint;
OPT_Struct typ;
OPT_Const conval;
LONGINT adr, linkadr;
INTEGER x;
int64 adr, linkadr;
int32 x;
} OPT_ObjDesc;
typedef
struct OPT_StrDesc {
SHORTINT form, comp, mno, extlev;
INTEGER ref, sysflag;
LONGINT n, size, align, txtpos;
int8 form, comp, mno, extlev;
int32 ref, sysflag;
int64 n, size, align, txtpos;
BOOLEAN allocated, pbused, pvused, fpdone, idfpdone;
LONGINT idfp, pbfp, pvfp;
int64 idfp, pbfp, pvfp;
OPT_Struct BaseTyp;
OPT_Object link, strobj;
} OPT_StrDesc;
@ -85,7 +85,7 @@ typedef
export void (*OPT_typSize)(OPT_Struct);
export OPT_Object OPT_topScope;
export OPT_Struct OPT_undftyp, OPT_bytetyp, OPT_booltyp, OPT_chartyp, OPT_sinttyp, OPT_inttyp, OPT_linttyp, OPT_ainttyp, OPT_int8typ, OPT_int16typ, OPT_int32typ, OPT_int64typ, OPT_realtyp, OPT_lrltyp, OPT_settyp, OPT_stringtyp, OPT_niltyp, OPT_notyp, OPT_sysptrtyp;
export SHORTINT OPT_nofGmod;
export int8 OPT_nofGmod;
export OPT_Object OPT_GlbMod[64];
export OPS_Name OPT_SelfName;
export BOOLEAN OPT_SYSimported;
@ -93,7 +93,7 @@ static OPT_Struct OPT_IntTypes[20];
static OPT_Object OPT_universe, OPT_syslink;
static OPT_ImpCtxt OPT_impCtxt;
static OPT_ExpCtxt OPT_expCtxt;
static LONGINT OPT_nofhdfld;
static int64 OPT_nofhdfld;
static BOOLEAN OPT_newsf, OPT_findpc, OPT_extsf, OPT_sfpresent, OPT_symExtended, OPT_symNew;
export LONGINT *OPT_ConstDesc__typ;
@ -106,62 +106,62 @@ export LONGINT *OPT_ExpCtxt__typ;
export void OPT_Close (void);
export void OPT_CloseScope (void);
static void OPT_DebugStruct (OPT_Struct btyp);
static void OPT_EnterBoolConst (OPS_Name name, LONGINT value);
static void OPT_EnterProc (OPS_Name name, INTEGER num);
static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res);
static void OPT_EnterBoolConst (OPS_Name name, int64 value);
static void OPT_EnterProc (OPS_Name name, int32 num);
static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res);
export void OPT_Export (BOOLEAN *ext, BOOLEAN *new);
export void OPT_FPrintErr (OPT_Object obj, INTEGER errcode);
static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len);
export void OPT_FPrintErr (OPT_Object obj, int32 errcode);
static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len);
export void OPT_FPrintObj (OPT_Object obj);
static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par);
static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par);
export void OPT_FPrintStr (OPT_Struct typ);
export void OPT_Find (OPT_Object *res);
export void OPT_FindField (OPS_Name name, OPT_Struct typ, OPT_Object *res);
export void OPT_FindImport (OPT_Object mod, OPT_Object *res);
export void OPT_IdFPrint (OPT_Struct typ);
export void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done);
static void OPT_InConstant (LONGINT f, OPT_Const conval);
static void OPT_InConstant (int64 f, OPT_Const conval);
static OPT_Object OPT_InFld (void);
static void OPT_InMod (SHORTINT *mno);
static void OPT_InMod (int8 *mno);
static void OPT_InName (CHAR *name, LONGINT name__len);
static OPT_Object OPT_InObj (SHORTINT mno);
static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par);
static OPT_Object OPT_InObj (int8 mno);
static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par);
static void OPT_InStruct (OPT_Struct *typ);
static OPT_Object OPT_InTProc (SHORTINT mno);
static OPT_Struct OPT_InTyp (LONGINT tag);
static OPT_Object OPT_InTProc (int8 mno);
static OPT_Struct OPT_InTyp (int64 tag);
export void OPT_Init (OPS_Name name, SET opt);
static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form);
static void OPT_InitStruct (OPT_Struct *typ, int8 form);
export void OPT_Insert (OPS_Name name, OPT_Object *obj);
export void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old);
export OPT_Struct OPT_IntType (LONGINT size);
export OPT_Struct OPT_IntType (int64 size);
export OPT_Const OPT_NewConst (void);
export OPT_ConstExt OPT_NewExt (void);
export OPT_Node OPT_NewNode (SHORTINT class);
export OPT_Node OPT_NewNode (int8 class);
export OPT_Object OPT_NewObj (void);
export OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp);
export void OPT_OpenScope (SHORTINT level, OPT_Object owner);
export OPT_Struct OPT_NewStr (int8 form, int8 comp);
export void OPT_OpenScope (int8 level, OPT_Object owner);
static void OPT_OutConstant (OPT_Object obj);
static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible);
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr);
static void OPT_OutMod (INTEGER mno);
static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible);
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr);
static void OPT_OutMod (int32 mno);
static void OPT_OutName (CHAR *name, LONGINT name__len);
static void OPT_OutObj (OPT_Object obj);
static void OPT_OutSign (OPT_Struct result, OPT_Object par);
static void OPT_OutStr (OPT_Struct typ);
static void OPT_OutTProcs (OPT_Struct typ, OPT_Object obj);
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir);
static void OPT_err (INTEGER n);
export OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir);
static void OPT_err (int32 n);
static void OPT_err (INTEGER n)
static void OPT_err (int32 n)
{
OPM_err(n);
}
OPT_Struct OPT_IntType (LONGINT size)
OPT_Struct OPT_IntType (int64 size)
{
OPT_Struct _o_result;
INTEGER i;
int32 i;
i = 1;
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
i += 1;
@ -170,10 +170,10 @@ OPT_Struct OPT_IntType (LONGINT size)
return _o_result;
}
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir)
{
OPT_Struct _o_result;
INTEGER i;
int32 i;
__ASSERT(x->form == 4, 0);
__ASSERT(dir == 1 || dir == -1, 0);
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
@ -204,7 +204,7 @@ OPT_Object OPT_NewObj (void)
return _o_result;
}
OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp)
OPT_Struct OPT_NewStr (int8 form, int8 comp)
{
OPT_Struct _o_result;
OPT_Struct typ = NIL;
@ -221,7 +221,7 @@ OPT_Struct OPT_NewStr (SHORTINT form, SHORTINT comp)
return _o_result;
}
OPT_Node OPT_NewNode (SHORTINT class)
OPT_Node OPT_NewNode (int8 class)
{
OPT_Node _o_result;
OPT_Node node = NIL;
@ -235,12 +235,12 @@ OPT_ConstExt OPT_NewExt (void)
{
OPT_ConstExt _o_result;
OPT_ConstExt ext = NIL;
ext = __NEWARR(NIL, 1, 1, 1, 0, ((SYSTEM_INT64)(256)));
ext = __NEWARR(NIL, 1, 1, 1, 0, ((int64)(256)));
_o_result = ext;
return _o_result;
}
void OPT_OpenScope (SHORTINT level, OPT_Object owner)
void OPT_OpenScope (int8 level, OPT_Object owner)
{
OPT_Object head = NIL;
head = OPT_NewObj();
@ -278,7 +278,7 @@ void OPT_Init (OPS_Name name, SET opt)
void OPT_Close (void)
{
INTEGER i;
int32 i;
OPT_CloseScope();
i = 0;
while (i < 64) {
@ -370,7 +370,7 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
{
OPT_Object ob0 = NIL, ob1 = NIL;
BOOLEAN left;
SHORTINT mnolev;
int8 mnolev;
ob0 = OPT_topScope;
ob1 = ob0->right;
left = 0;
@ -408,9 +408,9 @@ void OPT_Insert (OPS_Name name, OPT_Object *obj)
*obj = ob1;
}
static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len)
static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len)
{
INTEGER i;
int32 i;
CHAR ch;
i = 0;
do {
@ -453,7 +453,7 @@ static void OPT_DebugStruct (OPT_Struct btyp)
OPM_LogWLn();
}
static void OPT_FPrintSign (LONGINT *fp, OPT_Struct result, OPT_Object par)
static void OPT_FPrintSign (int64 *fp, OPT_Struct result, OPT_Object par)
{
OPT_IdFPrint(result);
OPM_FPrint(&*fp, result->idfp);
@ -469,8 +469,8 @@ void OPT_IdFPrint (OPT_Struct typ)
{
OPT_Struct btyp = NIL;
OPT_Object strobj = NIL;
LONGINT idfp;
INTEGER f, c;
int64 idfp;
int32 f, c;
if (!typ->idfpdone) {
typ->idfpdone = 1;
idfp = 0;
@ -499,17 +499,17 @@ void OPT_IdFPrint (OPT_Struct typ)
}
static struct FPrintStr__12 {
LONGINT *pbfp, *pvfp;
int64 *pbfp, *pvfp;
struct FPrintStr__12 *lnk;
} *FPrintStr__12_s;
static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible);
static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr);
static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible);
static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr);
static void FPrintTProcs__17 (OPT_Object obj);
static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr)
static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr)
{
LONGINT i, j, n;
int64 i, j, n;
OPT_Struct btyp = NIL;
if (typ->comp == 4) {
FPrintFlds__13(typ->link, adr, 0);
@ -539,7 +539,7 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, LONGINT adr)
}
}
static void FPrintFlds__13 (OPT_Object fld, LONGINT adr, BOOLEAN visible)
static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible)
{
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
@ -574,10 +574,10 @@ static void FPrintTProcs__17 (OPT_Object obj)
void OPT_FPrintStr (OPT_Struct typ)
{
INTEGER f, c;
int32 f, c;
OPT_Struct btyp = NIL;
OPT_Object strobj = NIL, bstrobj = NIL;
LONGINT pbfp, pvfp;
int64 pbfp, pvfp;
struct FPrintStr__12 _s;
_s.pbfp = &pbfp;
_s.pvfp = &pvfp;
@ -638,8 +638,8 @@ void OPT_FPrintStr (OPT_Struct typ)
void OPT_FPrintObj (OPT_Object obj)
{
LONGINT fprint;
INTEGER f, m;
int64 fprint;
int32 f, m;
REAL rval;
OPT_ConstExt ext = NIL;
if (!obj->fpdone) {
@ -696,9 +696,9 @@ void OPT_FPrintObj (OPT_Object obj)
}
}
void OPT_FPrintErr (OPT_Object obj, INTEGER errcode)
void OPT_FPrintErr (OPT_Object obj, int32 errcode)
{
INTEGER i, j;
int32 i, j;
CHAR ch;
if (obj->mnolev != 0) {
__COPY(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, OPM_objname, 64);
@ -788,7 +788,7 @@ void OPT_InsertImport (OPT_Object obj, OPT_Object *root, OPT_Object *old)
static void OPT_InName (CHAR *name, LONGINT name__len)
{
INTEGER i;
int32 i;
CHAR ch;
i = 0;
do {
@ -798,12 +798,12 @@ static void OPT_InName (CHAR *name, LONGINT name__len)
} while (!(ch == 0x00));
}
static void OPT_InMod (SHORTINT *mno)
static void OPT_InMod (int8 *mno)
{
OPT_Object head = NIL;
OPS_Name name;
LONGINT mn;
SHORTINT i;
int64 mn;
int8 i;
mn = OPM_SymRInt();
if (mn == 0) {
*mno = OPT_impCtxt.glbmno[0];
@ -840,10 +840,10 @@ static void OPT_InMod (SHORTINT *mno)
}
}
static void OPT_InConstant (LONGINT f, OPT_Const conval)
static void OPT_InConstant (int64 f, OPT_Const conval)
{
CHAR ch;
INTEGER i;
int32 i;
OPT_ConstExt ext = NIL;
REAL rval;
switch (f) {
@ -889,10 +889,10 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
}
}
static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par)
static void OPT_InSign (int8 mno, OPT_Struct *res, OPT_Object *par)
{
OPT_Object last = NIL, new = NIL;
LONGINT tag;
int64 tag;
OPT_InStruct(&*res);
tag = OPM_SymRInt();
last = NIL;
@ -920,7 +920,7 @@ static void OPT_InSign (SHORTINT mno, OPT_Struct *res, OPT_Object *par)
static OPT_Object OPT_InFld (void)
{
OPT_Object _o_result;
LONGINT tag;
int64 tag;
OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag;
obj = OPT_NewObj();
@ -949,10 +949,10 @@ static OPT_Object OPT_InFld (void)
return _o_result;
}
static OPT_Object OPT_InTProc (SHORTINT mno)
static OPT_Object OPT_InTProc (int8 mno)
{
OPT_Object _o_result;
LONGINT tag;
int64 tag;
OPT_Object obj = NIL;
tag = OPT_impCtxt.nextTag;
obj = OPT_NewObj();
@ -977,7 +977,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
return _o_result;
}
static OPT_Struct OPT_InTyp (LONGINT tag)
static OPT_Struct OPT_InTyp (int64 tag)
{
OPT_Struct _o_result;
if (tag == 4) {
@ -992,9 +992,9 @@ static OPT_Struct OPT_InTyp (LONGINT tag)
static void OPT_InStruct (OPT_Struct *typ)
{
SHORTINT mno;
INTEGER ref;
LONGINT tag;
int8 mno;
int32 ref;
int64 tag;
OPS_Name name;
OPT_Struct t = NIL;
OPT_Object obj = NIL, last = NIL, fld = NIL, old = NIL, dummy = NIL;
@ -1050,7 +1050,7 @@ static void OPT_InStruct (OPT_Struct *typ)
obj->vis = 0;
tag = OPM_SymRInt();
if (tag == 35) {
(*typ)->sysflag = (SYSTEM_INT32)OPM_SymRInt();
(*typ)->sysflag = (int32)OPM_SymRInt();
tag = OPM_SymRInt();
}
switch (tag) {
@ -1172,14 +1172,14 @@ static void OPT_InStruct (OPT_Struct *typ)
}
}
static OPT_Object OPT_InObj (SHORTINT mno)
static OPT_Object OPT_InObj (int8 mno)
{
OPT_Object _o_result;
INTEGER i, s;
int32 i, s;
CHAR ch;
OPT_Object obj = NIL, old = NIL;
OPT_Struct typ = NIL;
LONGINT tag;
int64 tag;
OPT_ConstExt ext = NIL;
tag = OPT_impCtxt.nextTag;
if (tag == 19) {
@ -1212,7 +1212,7 @@ static OPT_Object OPT_InObj (SHORTINT mno)
obj->mode = 9;
ext = OPT_NewExt();
obj->conval->ext = ext;
s = (SYSTEM_INT32)OPM_SymRInt();
s = (int32)OPM_SymRInt();
(*ext)[0] = (CHAR)s;
i = 1;
while (i <= s) {
@ -1278,7 +1278,7 @@ static OPT_Object OPT_InObj (SHORTINT mno)
void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
{
OPT_Object obj = NIL;
SHORTINT mno;
int8 mno;
OPS_Name aliasName__copy;
__DUPARR(aliasName, OPS_Name);
if (__STRCMP(name, "SYSTEM") == 0) {
@ -1321,7 +1321,7 @@ void OPT_Import (OPS_Name aliasName, OPS_Name name, BOOLEAN *done)
static void OPT_OutName (CHAR *name, LONGINT name__len)
{
INTEGER i;
int32 i;
CHAR ch;
i = 0;
do {
@ -1331,7 +1331,7 @@ static void OPT_OutName (CHAR *name, LONGINT name__len)
} while (!(ch == 0x00));
}
static void OPT_OutMod (INTEGER mno)
static void OPT_OutMod (int32 mno)
{
if (OPT_expCtxt.locmno[__X(mno, 64)] < 0) {
OPM_SymWInt(16);
@ -1343,9 +1343,9 @@ static void OPT_OutMod (INTEGER mno)
}
}
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr)
static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, int64 adr)
{
LONGINT i, j, n;
int64 i, j, n;
OPT_Struct btyp = NIL;
if (typ->comp == 4) {
OPT_OutFlds(typ->link, adr, 0);
@ -1375,7 +1375,7 @@ static void OPT_OutHdFld (OPT_Struct typ, OPT_Object fld, LONGINT adr)
}
}
static void OPT_OutFlds (OPT_Object fld, LONGINT adr, BOOLEAN visible)
static void OPT_OutFlds (OPT_Object fld, int64 adr, BOOLEAN visible)
{
while ((fld != NIL && fld->mode == 4)) {
if ((fld->vis != 0 && visible)) {
@ -1530,7 +1530,7 @@ static void OPT_OutStr (OPT_Struct typ)
static void OPT_OutConstant (OPT_Object obj)
{
INTEGER f;
int32 f;
REAL rval;
f = obj->typ->form;
OPM_SymWInt(f);
@ -1565,7 +1565,7 @@ static void OPT_OutConstant (OPT_Object obj)
static void OPT_OutObj (OPT_Object obj)
{
INTEGER i, j;
int32 i, j;
OPT_ConstExt ext = NIL;
if (obj != NIL) {
OPT_OutObj(obj->left);
@ -1655,8 +1655,8 @@ static void OPT_OutObj (OPT_Object obj)
void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
{
INTEGER i;
SHORTINT nofmod;
int32 i;
int8 nofmod;
BOOLEAN done;
OPT_symExtended = 0;
OPT_symNew = 0;
@ -1698,7 +1698,7 @@ void OPT_Export (BOOLEAN *ext, BOOLEAN *new)
}
}
static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form)
static void OPT_InitStruct (OPT_Struct *typ, int8 form)
{
*typ = OPT_NewStr(form, 1);
(*typ)->ref = form;
@ -1712,7 +1712,7 @@ static void OPT_InitStruct (OPT_Struct *typ, SHORTINT form)
(*typ)->idfpdone = 1;
}
static void OPT_EnterBoolConst (OPS_Name name, LONGINT value)
static void OPT_EnterBoolConst (OPS_Name name, int64 value)
{
OPT_Object obj = NIL;
OPS_Name name__copy;
@ -1724,7 +1724,7 @@ static void OPT_EnterBoolConst (OPS_Name name, LONGINT value)
obj->conval->intval = value;
}
static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct *res)
static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res)
{
OPT_Object obj = NIL;
OPT_Struct typ = NIL;
@ -1747,7 +1747,7 @@ static void OPT_EnterTyp (OPS_Name name, SHORTINT form, INTEGER size, OPT_Struct
*res = typ;
}
static void OPT_EnterProc (OPS_Name name, INTEGER num)
static void OPT_EnterProc (OPS_Name name, int32 num)
{
OPT_Object obj = NIL;
OPS_Name name__copy;