diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-44/Console.c b/bootstrap/unix-44/Console.c index 4007101f..168abb08 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 17a56a1d..a37ffdd3 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 81a5660b..c86d1186 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-44/Modules.c b/bootstrap/unix-44/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-44/OPC.c b/bootstrap/unix-44/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ 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_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 int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); 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_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index a7b7d28a..cdb47dd1 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index 574abdf6..6e372559 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 9ae78a2d..994ef48a 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index af7ba940..033c5c1a 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-44/Vishap.c b/bootstrap/unix-44/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; 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_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-44/extTools.c b/bootstrap/unix-44/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-44/vt100.c b/bootstrap/unix-44/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-48/Configuration.c b/bootstrap/unix-48/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-48/Console.c b/bootstrap/unix-48/Console.c index 4007101f..168abb08 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 17a56a1d..a37ffdd3 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 81a5660b..c86d1186 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-48/Modules.c b/bootstrap/unix-48/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-48/OPC.c b/bootstrap/unix-48/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ 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_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 int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); 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_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index a7b7d28a..cdb47dd1 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index 574abdf6..6e372559 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 660559f5..e14d923b 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index 5ac796d7..45ca0bb5 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-48/Vishap.c b/bootstrap/unix-48/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; 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_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-48/extTools.c b/bootstrap/unix-48/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-48/vt100.c b/bootstrap/unix-48/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/unix-88/Configuration.c b/bootstrap/unix-88/Configuration.c index e936fb1b..ec75a6df 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/unix-88/Console.c b/bootstrap/unix-88/Console.c index c25651d5..f7769827 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 288d9e0a..23f894db 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 79b77102..4c6982cc 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 048e6c0f..a5641b0c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index fa10e8c0..c99a229c 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index ecebdfeb..f9b4a041 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/unix-88/Modules.c b/bootstrap/unix-88/Modules.c index 66df0a5c..662b84f9 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 86580ab4..9f3d713d 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index 5a6a8dda..2f005fc6 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index 94ff6cbf..185aa968 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/unix-88/OPC.c b/bootstrap/unix-88/OPC.c index a4e6388c..689dfff4 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index 185ac689..bf22de26 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index 6b30d07b..23017356 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 9c71f996..7472bed7 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index dce9eaec..63191e02 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/unix-88/OPS.c b/bootstrap/unix-88/OPS.c index 61d3ad08..7caa7493 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index eef23e1f..6d67036e 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index d9b211df..b588c3f1 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -89,11 +89,11 @@ 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_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 int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); 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); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int32 errcode); static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int32 n) OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - int32 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) OPT_Struct _o_result; int32 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int64 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -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 FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) { int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int64 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 7b529043..504e70b7 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); 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_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 023ee089..46abf128 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 8bbc2357..874e4d6d 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 077cb445..86dbc3cb 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/unix-88/Reals.c b/bootstrap/unix-88/Reals.c index b4890fa9..08445989 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 37f91340..44e13bae 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index 4f6767e1..ad3ef185 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 235891d2..23e3adb8 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/unix-88/Texts.c b/bootstrap/unix-88/Texts.c index 7a6726a6..5a607fdd 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index ea9dde4b..f18817ff 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/unix-88/Vishap.c b/bootstrap/unix-88/Vishap.c index fef94478..1bc7e5ed 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; 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_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 88cb5688..8d3792df 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/unix-88/extTools.c b/bootstrap/unix-88/extTools.c index 08e242e0..d7c28163 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/unix-88/vt100.c b/bootstrap/unix-88/vt100.c index 96358c5b..a575d688 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index b9c5430c..f0786605 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-48/Configuration.c b/bootstrap/windows-48/Configuration.c index 06ec0ed7..1a0e2ffe 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-48/Console.c b/bootstrap/windows-48/Console.c index 931e8e9b..f1978da4 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 23ec5930..cca2c91e 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index 50b625ff..8c0d8fd5 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index f680e056..4a28825a 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index c3422d37..b80b6666 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 2a231c6e..50308888 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-48/Modules.c b/bootstrap/windows-48/Modules.c index 74cb4e47..142b60f4 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index ba7f2930..2dc36a9b 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 5bc128d1..90e93aed 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 8579409b..183a5f32 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-48/OPC.c b/bootstrap/windows-48/OPC.c index c1a7d45a..17690465 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 576bdf18..34d9ebc2 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index ffc05a37..18478d1e 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index 56b587e9..a36522a1 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index 7c0b62db..8db5ef60 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 29ea2414..fb0f2237 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 57cf06d3..d2b5dfb4 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index 62ff8882..83a2652b 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -89,11 +89,11 @@ 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_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 int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); static void OPT_EnterBoolConst (OPS_Name name, int32 value); static void OPT_EnterProc (OPS_Name name, int16 num); static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int16 errcode); static void OPT_FPrintName (int32 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int16 n) OPT_Struct OPT_IntType (int32 size) { OPT_Struct _o_result; - int16 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir) OPT_Struct _o_result; int16 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int32 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr); -static void FPrintTProcs__17 (OPT_Object obj); +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int32 adr) { int32 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int32 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int32 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int32 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int32 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int16 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int16 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 3140, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index dff6a509..d4b49da8 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); 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_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index b34d16d0..a32351aa 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index afc6f96c..614e2cb6 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index 2d3185ce..cfea54a7 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index 30d7462f..8b263757 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 034d0e43..6ff22ad6 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index a4ed943e..8758a988 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 226b6aeb..36e01e6c 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 660559f5..e14d923b 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index 5ac796d7..45ca0bb5 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-48/Vishap.c b/bootstrap/windows-48/Vishap.c index 93bbfaf4..1f322c5e 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int16 #define LONGINT int32 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; 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_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 330d0f79..689e3cdd 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-48/extTools.c b/bootstrap/windows-48/extTools.c index a0370292..c2339121 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-48/vt100.c b/bootstrap/windows-48/vt100.c index 7e16410c..341502ec 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int16 #define LONGINT int32 diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index c1c3c8fa..f7615911 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/bootstrap/windows-88/Configuration.c b/bootstrap/windows-88/Configuration.c index e936fb1b..ec75a6df 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -18,6 +18,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/09/15] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/09/18] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 9276e796..e5d79317 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Configuration__h #define Configuration__h diff --git a/bootstrap/windows-88/Console.c b/bootstrap/windows-88/Console.c index ef385b37..32408370 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 288d9e0a..23f894db 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Console__h #define Console__h diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 6b890417..c2097ffb 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index ab570a35..c98b006a 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef Files__h #define Files__h diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index fa10e8c0..c99a229c 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index ecebdfeb..f9b4a041 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tskSfF */ #ifndef Heap__h #define Heap__h diff --git a/bootstrap/windows-88/Modules.c b/bootstrap/windows-88/Modules.c index 66df0a5c..662b84f9 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 86580ab4..9f3d713d 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Modules__h #define Modules__h diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index 5a6a8dda..2f005fc6 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index 94ff6cbf..185aa968 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPB__h #define OPB__h diff --git a/bootstrap/windows-88/OPC.c b/bootstrap/windows-88/OPC.c index a4e6388c..689dfff4 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index 185ac689..bf22de26 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPC__h #define OPC__h diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index 6b30d07b..23017356 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 9c71f996..7472bed7 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPM__h #define OPM__h diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index dce9eaec..63191e02 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index e578b0bd..22557b29 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPP__h #define OPP__h diff --git a/bootstrap/windows-88/OPS.c b/bootstrap/windows-88/OPS.c index 61d3ad08..7caa7493 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index eef23e1f..6d67036e 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin tspkaSfF */ #ifndef OPS__h #define OPS__h diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index d9b211df..b588c3f1 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -89,11 +89,11 @@ 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_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 int8 OPT_nofGmod; export OPT_Object OPT_GlbMod[64]; export OPS_Name OPT_SelfName; export BOOLEAN OPT_SYSimported; -static OPT_Struct OPT_IntTypes[20]; static OPT_Object OPT_universe, OPT_syslink; static OPT_ImpCtxt OPT_impCtxt; static OPT_ExpCtxt OPT_expCtxt; @@ -113,6 +113,7 @@ static void OPT_DebugStruct (OPT_Struct btyp); 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); +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res); export void OPT_Export (BOOLEAN *ext, BOOLEAN *new); export void OPT_FPrintErr (OPT_Object obj, int32 errcode); static void OPT_FPrintName (int64 *fp, CHAR *name, LONGINT name__len); @@ -165,16 +166,20 @@ static void OPT_err (int32 n) OPT_Struct OPT_IntType (int64 size) { OPT_Struct _o_result; - int32 i; - i = 1; - while (i < 19) { - if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) { - _o_result = OPT_IntTypes[__X(i, 20)]; - return _o_result; - } - i += 1; + if (size <= OPT_int8typ->size) { + _o_result = OPT_int8typ; + return _o_result; } - __RETCHK; + if (size <= OPT_int16typ->size) { + _o_result = OPT_int16typ; + return _o_result; + } + if (size <= OPT_int32typ->size) { + _o_result = OPT_int32typ; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; } OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) @@ -182,15 +187,40 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir) OPT_Struct _o_result; int32 i; __ASSERT(x->form == 4, 0); - __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); - i = 0; - while ((OPT_IntTypes[__X(i, 20)] != x && i < 20)) { - i += 1; + __ASSERT(dir == 1 || dir == -1, 0); + if (dir > 0) { + if (x->size < OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + if (x->size < OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size < OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + _o_result = OPT_int64typ; + return _o_result; + } else { + if (x->size > OPT_linttyp->size) { + _o_result = OPT_linttyp; + return _o_result; + } + if (x->size > OPT_inttyp->size) { + _o_result = OPT_inttyp; + return _o_result; + } + if (x->size > OPT_sinttyp->size) { + _o_result = OPT_sinttyp; + return _o_result; + } + _o_result = OPT_int8typ; + return _o_result; } - __ASSERT(i < 19, 0); - _o_result = OPT_IntTypes[__X(i + dir, 20)]; - return _o_result; + __RETCHK; } OPT_Const OPT_NewConst (void) @@ -505,21 +535,21 @@ void OPT_IdFPrint (OPT_Struct typ) } } -static struct FPrintStr__12 { +static struct FPrintStr__13 { int64 *pbfp, *pvfp; - struct FPrintStr__12 *lnk; -} *FPrintStr__12_s; + struct FPrintStr__13 *lnk; +} *FPrintStr__13_s; -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 FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible); +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr); +static void FPrintTProcs__18 (OPT_Object obj); -static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) +static void FPrintHdFld__16 (OPT_Struct typ, OPT_Object fld, int64 adr) { int64 i, j, n; OPT_Struct btyp = NIL; if (typ->comp == 4) { - FPrintFlds__13(typ->link, adr, 0); + FPrintFlds__14(typ->link, adr, 0); } else if (typ->comp == 2) { btyp = typ->BaseTyp; n = typ->n; @@ -529,53 +559,53 @@ static void FPrintHdFld__15 (OPT_Struct typ, OPT_Object fld, int64 adr) } if (btyp->form == 11 || btyp->comp == 4) { j = OPT_nofhdfld; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); if (j != OPT_nofhdfld) { i = 1; while ((i < n && OPT_nofhdfld <= 2048)) { adr += btyp->size; - FPrintHdFld__15(btyp, fld, adr); + FPrintHdFld__16(btyp, fld, adr); i += 1; } } } } else if (typ->form == 11 || __STRCMP(fld->name, "@ptr") == 0) { - OPM_FPrint(&*FPrintStr__12_s->pvfp, 11); - OPM_FPrint(&*FPrintStr__12_s->pvfp, adr); + OPM_FPrint(&*FPrintStr__13_s->pvfp, 11); + OPM_FPrint(&*FPrintStr__13_s->pvfp, adr); OPT_nofhdfld += 1; } } -static void FPrintFlds__13 (OPT_Object fld, int64 adr, BOOLEAN visible) +static void FPrintFlds__14 (OPT_Object fld, int64 adr, BOOLEAN visible) { while ((fld != NIL && fld->mode == 4)) { if ((fld->vis != 0 && visible)) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->vis); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)fld->name, 256); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->adr); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->vis); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)fld->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->adr); OPT_FPrintStr(fld->typ); - OPM_FPrint(&*FPrintStr__12_s->pbfp, fld->typ->pbfp); - OPM_FPrint(&*FPrintStr__12_s->pvfp, fld->typ->pvfp); + OPM_FPrint(&*FPrintStr__13_s->pbfp, fld->typ->pbfp); + OPM_FPrint(&*FPrintStr__13_s->pvfp, fld->typ->pvfp); } else { - FPrintHdFld__15(fld->typ, fld, fld->adr + adr); + FPrintHdFld__16(fld->typ, fld, fld->adr + adr); } fld = fld->link; } } -static void FPrintTProcs__17 (OPT_Object obj) +static void FPrintTProcs__18 (OPT_Object obj) { if (obj != NIL) { - FPrintTProcs__17(obj->left); + FPrintTProcs__18(obj->left); if (obj->mode == 13) { if (obj->vis != 0) { - OPM_FPrint(&*FPrintStr__12_s->pbfp, 13); - OPM_FPrint(&*FPrintStr__12_s->pbfp, __ASHR(obj->adr, 16)); - OPT_FPrintSign(&*FPrintStr__12_s->pbfp, obj->typ, obj->link); - OPT_FPrintName(&*FPrintStr__12_s->pbfp, (void*)obj->name, 256); + OPM_FPrint(&*FPrintStr__13_s->pbfp, 13); + OPM_FPrint(&*FPrintStr__13_s->pbfp, __ASHR(obj->adr, 16)); + OPT_FPrintSign(&*FPrintStr__13_s->pbfp, obj->typ, obj->link); + OPT_FPrintName(&*FPrintStr__13_s->pbfp, (void*)obj->name, 256); } } - FPrintTProcs__17(obj->right); + FPrintTProcs__18(obj->right); } } @@ -585,11 +615,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPT_Struct btyp = NIL; OPT_Object strobj = NIL, bstrobj = NIL; int64 pbfp, pvfp; - struct FPrintStr__12 _s; + struct FPrintStr__13 _s; _s.pbfp = &pbfp; _s.pvfp = &pvfp; - _s.lnk = FPrintStr__12_s; - FPrintStr__12_s = &_s; + _s.lnk = FPrintStr__13_s; + FPrintStr__13_s = &_s; if (!typ->fpdone) { OPT_IdFPrint(typ); pbfp = typ->idfp; @@ -626,11 +656,11 @@ void OPT_FPrintStr (OPT_Struct typ) OPM_FPrint(&pvfp, typ->align); OPM_FPrint(&pvfp, typ->n); OPT_nofhdfld = 0; - FPrintFlds__13(typ->link, 0, 1); + FPrintFlds__14(typ->link, 0, 1); if (OPT_nofhdfld > 2048) { OPM_Mark(225, typ->txtpos); } - FPrintTProcs__17(typ->link); + FPrintTProcs__18(typ->link); OPM_FPrint(&pvfp, pbfp); strobj = typ->strobj; if (strobj == NIL || strobj->name[0] == 0x00) { @@ -640,7 +670,7 @@ void OPT_FPrintStr (OPT_Struct typ) typ->pbfp = pbfp; typ->pvfp = pvfp; } - FPrintStr__12_s = _s.lnk; + FPrintStr__13_s = _s.lnk; } void OPT_FPrintObj (OPT_Object obj) @@ -1754,6 +1784,18 @@ static void OPT_EnterTyp (OPS_Name name, int8 form, int32 size, OPT_Struct *res) *res = typ; } +static void OPT_EnterTypeAlias (OPS_Name name, OPT_Object *res) +{ + OPT_Object obj = NIL; + OPS_Name name__copy; + __DUPARR(name, OPS_Name); + OPT_Insert(name, &obj); + obj->mode = 5; + obj->typ = NIL; + obj->vis = 1; + *res = obj; +} + static void OPT_EnterProc (OPS_Name name, int32 num) { OPT_Object obj = NIL; @@ -1787,8 +1829,10 @@ static void EnumPtrs(void (*P)(void*)) P(OPT_niltyp); P(OPT_notyp); P(OPT_sysptrtyp); + P(OPT_sintobj); + P(OPT_intobj); + P(OPT_lintobj); __ENUMP(OPT_GlbMod, 64, P); - __ENUMP(OPT_IntTypes, 20, P); P(OPT_universe); P(OPT_syslink); __ENUMR(&OPT_impCtxt, OPT_ImpCtxt__typ, 6216, 1, P); @@ -1881,10 +1925,10 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"CHAR", 3, OPM_CharSize, &OPT_chartyp); OPT_EnterTyp((CHAR*)"SET", 7, OPM_SetSize, &OPT_settyp); OPT_EnterTyp((CHAR*)"REAL", 5, OPM_RealSize, &OPT_realtyp); - OPT_EnterTyp((CHAR*)"INTEGER", 4, OPM_IntSize, &OPT_inttyp); - OPT_EnterTyp((CHAR*)"LONGINT", 4, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 6, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTypeAlias((CHAR*)"SHORTINT", &OPT_sintobj); + OPT_EnterTypeAlias((CHAR*)"INTEGER", &OPT_intobj); + OPT_EnterTypeAlias((CHAR*)"LONGINT", &OPT_lintobj); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1912,7 +1956,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_inttyp; + OPT_impCtxt.ref[4] = OPT_int32typ; OPT_impCtxt.ref[5] = OPT_realtyp; OPT_impCtxt.ref[6] = OPT_lrltyp; OPT_impCtxt.ref[7] = OPT_settyp; @@ -1920,12 +1964,5 @@ export void *OPT__init(void) OPT_impCtxt.ref[9] = OPT_niltyp; OPT_impCtxt.ref[10] = OPT_notyp; OPT_impCtxt.ref[11] = OPT_sysptrtyp; - OPT_IntTypes[1] = OPT_sinttyp; - OPT_IntTypes[2] = OPT_inttyp; - OPT_IntTypes[3] = OPT_linttyp; - OPT_IntTypes[5] = OPT_int8typ; - OPT_IntTypes[6] = OPT_int16typ; - OPT_IntTypes[7] = OPT_int32typ; - OPT_IntTypes[8] = OPT_int64typ; __ENDMOD; } diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 7b529043..504e70b7 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h @@ -68,6 +68,7 @@ typedef import void (*OPT_typSize)(OPT_Struct); 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_Object OPT_sintobj, OPT_intobj, OPT_lintobj; import int8 OPT_nofGmod; import OPT_Object OPT_GlbMod[64]; import OPS_Name OPT_SelfName; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 023ee089..46abf128 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 @@ -258,6 +258,9 @@ static void OPV_Traverse (OPT_Object obj, OPT_Object outerScope, BOOLEAN exporte void OPV_AdrAndSize (OPT_Object topScope) { + __ASSERT(OPT_sinttyp != NIL, 0); + __ASSERT(OPT_inttyp != NIL, 0); + __ASSERT(OPT_linttyp != NIL, 0); OPM_errpos = topScope->adr; topScope->leaf = 1; OPV_Traverse(topScope->right, topScope, 1); @@ -265,15 +268,12 @@ void OPV_AdrAndSize (OPT_Object topScope) OPT_chartyp->strobj->linkadr = 2; OPT_settyp->strobj->linkadr = 2; OPT_realtyp->strobj->linkadr = 2; - OPT_inttyp->strobj->linkadr = 2; - OPT_linttyp->strobj->linkadr = 2; OPT_adrtyp->strobj->linkadr = 2; OPT_int8typ->strobj->linkadr = 2; OPT_int16typ->strobj->linkadr = 2; OPT_int32typ->strobj->linkadr = 2; OPT_int64typ->strobj->linkadr = 2; OPT_lrltyp->strobj->linkadr = 2; - OPT_sinttyp->strobj->linkadr = 2; OPT_booltyp->strobj->linkadr = 2; OPT_bytetyp->strobj->linkadr = 2; OPT_sysptrtyp->strobj->linkadr = 2; diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index 0716a62f..937f0ba6 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPV__h #define OPV__h diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index a8579af5..5af3b5f2 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index a016f061..a94b93a8 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Platform__h #define Platform__h diff --git a/bootstrap/windows-88/Reals.c b/bootstrap/windows-88/Reals.c index b4890fa9..08445989 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 37f91340..44e13bae 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index 4f6767e1..ad3ef185 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 235891d2..23e3adb8 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Strings__h #define Strings__h diff --git a/bootstrap/windows-88/Texts.c b/bootstrap/windows-88/Texts.c index 7a6726a6..5a607fdd 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index ea9dde4b..f18817ff 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Texts__h #define Texts__h diff --git a/bootstrap/windows-88/Vishap.c b/bootstrap/windows-88/Vishap.c index fef94478..1bc7e5ed 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkamSf */ #define INTEGER int32 #define LONGINT int64 @@ -84,12 +84,20 @@ static void Vishap_PropagateElementaryTypeSizes (void) OPT_chartyp->size = OPM_CharSize; OPT_settyp->size = OPM_SetSize; OPT_realtyp->size = OPM_RealSize; - OPT_inttyp->size = OPM_IntSize; - OPT_linttyp->size = OPM_LIntSize; OPT_adrtyp->size = OPM_PointerSize; OPT_lrltyp->size = OPM_LRealSize; - OPT_sinttyp->size = OPM_SIntSize; 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_intobj->typ = OPT_inttyp; + OPT_lintobj->typ = OPT_linttyp; } void Vishap_Translate (void) diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 88cb5688..8d3792df 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index f916c173..f5c1a708 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef errors__h #define errors__h diff --git a/bootstrap/windows-88/extTools.c b/bootstrap/windows-88/extTools.c index 08e242e0..d7c28163 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 04a7b8d6..6815aacb 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef extTools__h #define extTools__h diff --git a/bootstrap/windows-88/vt100.c b/bootstrap/windows-88/vt100.c index 96358c5b..a575d688 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #define INTEGER int32 #define LONGINT int64 diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index b9c5430c..f0786605 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/09/15] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/09/18] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index cd1eae8b..3f8e884e 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -160,18 +160,18 @@ VAR realtyp*, lrltyp*, settyp*, stringtyp*, niltyp*, notyp*, sysptrtyp*: Struct; + sintobj*, intobj*, lintobj*: Object; + nofGmod*: SHORTINT; (*nof imports*) GlbMod*: ARRAY maxImps OF Object; (* ^.right = first object, ^.name = module import name (not alias) *) SelfName*: OPS.Name; (* name of module being compiled *) SYSimported*: BOOLEAN; - IntTypes: ARRAY 20 OF Struct; (* Lists integer types in SHORT/LONG ordering *) + CONST - - (* Symbol file items *) Smname* = 16; Send* = 18; Stype* = 19; Salias* = 20; Svar* = 21; Srvar* = 22; Svalpar* = 23; Svarpar* = 24; Sfld* = 25; Srfld* = 26; @@ -209,34 +209,36 @@ VAR -PROCEDURE err(n: INTEGER); -BEGIN OPM.err(n) -END err; +PROCEDURE err(n: INTEGER); BEGIN OPM.err(n) END err; + + PROCEDURE IntType*(size: LONGINT): Struct; (* Selects smallest standard integer type for given size in bytes *) - VAR i: INTEGER; BEGIN - i := 1; WHILE i < LEN(IntTypes) - 1 DO (* First and last entries are always NIL *) - IF (IntTypes[i] # NIL) & (IntTypes[i].size >= size) THEN RETURN IntTypes[i] END; - INC(i) - END; + IF size <= int8typ.size THEN RETURN int8typ END; + IF size <= int16typ.size THEN RETURN int16typ END; + IF size <= int32typ.size THEN RETURN int32typ END; + RETURN int64typ END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN ASSERT(x.form = Int); - ASSERT((dir = 1) OR (dir = -1)); - (* Not sure if StPar0 (which calls this) always gets the baseiest type. This - ASSERT will tell me. *) ASSERT(x.BaseTyp = undftyp); - (* - WHILE x.BaseTyp # undftyp DO ASSERT(x # x.BaseTyp); ASSERT(x.BaseTyp # NIL); x := x.BaseTyp END; - *) - i := 0; WHILE (IntTypes[i] # x) & (i < LEN(IntTypes)) DO INC(i) END; - ASSERT(i < LEN(IntTypes)-1); - RETURN IntTypes[i+dir] + ASSERT((dir = 1) OR (dir = -1)); + IF dir > 0 THEN + IF x.size < sinttyp.size THEN RETURN sinttyp END; + IF x.size < inttyp.size THEN RETURN inttyp END; + IF x.size < linttyp.size THEN RETURN linttyp END; + RETURN int64typ + ELSE + IF x.size > linttyp.size THEN RETURN linttyp END; + IF x.size > inttyp.size THEN RETURN inttyp END; + IF x.size > sinttyp.size THEN RETURN sinttyp END; + RETURN int8typ + END END ShorterOrLongerType; @@ -1175,12 +1177,21 @@ END Import; typ^.idfp := form; typ^.idfpdone := TRUE; res := typ END EnterTyp; + PROCEDURE EnterTypeAlias(name: OPS.Name; VAR res: Object); + VAR obj: Object; + BEGIN + Insert(name, obj); obj^.mode := Typ; obj^.typ := NIL; obj^.vis := external; + res := obj + END EnterTypeAlias; + PROCEDURE EnterProc(name: OPS.Name; num: INTEGER); VAR obj: Object; BEGIN Insert(name, obj); obj^.mode := SProc; obj^.typ := notyp; obj^.adr := num END EnterProc; + + BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; InitStruct(undftyp, Undef); undftyp^.BaseTyp := undftyp; InitStruct(notyp, NoTyp); @@ -1195,6 +1206,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterTyp("INT16", Int, 2, int16typ); EnterTyp("INT32", Int, 4, int32typ); EnterTyp("INT64", Int, 8, int64typ); + EnterProc("ADR", adrfn); EnterProc("CC", ccfn); EnterProc("LSH", lshfn); @@ -1207,17 +1219,20 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; EnterProc("VAL", valfn); EnterProc("NEW", sysnewfn); EnterProc("MOVE", movefn); + syslink := topScope^.right; universe := topScope; topScope^.right := NIL; + EnterTyp("BOOLEAN", Bool, OPM.BoolSize, booltyp); EnterTyp("CHAR", Char, OPM.CharSize, chartyp); EnterTyp("SET", Set, OPM.SetSize, settyp); EnterTyp("REAL", Real, OPM.RealSize, realtyp); - EnterTyp("INTEGER", Int, OPM.IntSize, inttyp); - EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); + + EnterTypeAlias("SHORTINT", sintobj); + EnterTypeAlias("INTEGER", intobj); + EnterTypeAlias("LONGINT", lintobj); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1248,7 +1263,7 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[Int] := inttyp; + impCtxt.ref[Int] := int32typ; impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; @@ -1257,15 +1272,6 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[NoTyp] := notyp; impCtxt.ref[Pointer] := sysptrtyp; - IntTypes[1] := sinttyp; - IntTypes[2] := inttyp; - IntTypes[3] := linttyp; - - IntTypes[5] := int8typ; - IntTypes[6] := int16typ; - IntTypes[7] := int32typ; - IntTypes[8] := int64typ - END OPT. Objects: diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index f4a82ca5..fa20523b 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -181,6 +181,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE AdrAndSize* (topScope: OPT.Object); BEGIN + ASSERT(OPT.sinttyp # NIL); ASSERT(OPT.inttyp # NIL); ASSERT(OPT.linttyp # NIL); + OPM.errpos := topScope^.adr; (* text position of scope used if error *) topScope^.leaf := TRUE; Traverse(topScope^.right, topScope, TRUE); (* first pass only on exported types and procedures *) @@ -189,15 +191,18 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPT.chartyp^.strobj^.linkadr := PredefinedType; OPT.settyp^.strobj^.linkadr := PredefinedType; OPT.realtyp^.strobj^.linkadr := PredefinedType; + + (* SHORTINT, INTEGER and LONGINT are alternate names for INT8, INT16, INT32 and INT64 and have not been set up yet. + OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.inttyp^.strobj^.linkadr := PredefinedType; OPT.linttyp^.strobj^.linkadr := PredefinedType; + *) OPT.adrtyp^.strobj^.linkadr := PredefinedType; OPT.int8typ^.strobj^.linkadr := PredefinedType; OPT.int16typ^.strobj^.linkadr := PredefinedType; OPT.int32typ^.strobj^.linkadr := PredefinedType; OPT.int64typ^.strobj^.linkadr := PredefinedType; OPT.lrltyp^.strobj^.linkadr := PredefinedType; - OPT.sinttyp^.strobj^.linkadr := PredefinedType; OPT.booltyp^.strobj^.linkadr := PredefinedType; OPT.bytetyp^.strobj^.linkadr := PredefinedType; OPT.sysptrtyp^.strobj^.linkadr := PredefinedType; diff --git a/src/compiler/Vishap.Mod b/src/compiler/Vishap.Mod index 3323883d..33481260 100644 --- a/src/compiler/Vishap.Mod +++ b/src/compiler/Vishap.Mod @@ -56,12 +56,21 @@ MODULE Vishap; (* J. Templ 3.2.95 *) OPT.chartyp.size := OPM.CharSize; OPT.settyp.size := OPM.SetSize; OPT.realtyp.size := OPM.RealSize; - OPT.inttyp.size := OPM.IntSize; - OPT.linttyp.size := OPM.LIntSize; OPT.adrtyp.size := OPM.PointerSize; OPT.lrltyp.size := OPM.LRealSize; - OPT.sinttyp.size := OPM.SIntSize; - OPT.booltyp.size := OPM.BoolSize + OPT.booltyp.size := OPM.BoolSize; + + OPT.sinttyp := OPT.int8typ; + IF OPM.IntSize = 2 THEN + OPT.inttyp := OPT.int16typ; + OPT.linttyp := OPT.int32typ + ELSE + OPT.inttyp := OPT.int32typ; + OPT.linttyp := OPT.int64typ + END; + OPT.sintobj.typ := OPT.sinttyp; + OPT.intobj.typ := OPT.inttyp; + OPT.lintobj.typ := OPT.linttyp END PropagateElementaryTypeSizes;