diff --git a/bootstrap/unix-44/Configuration.c b/bootstrap/unix-44/Configuration.c index 36e599bd..b4cdd828 100644 --- a/bootstrap/unix-44/Configuration.c +++ b/bootstrap/unix-44/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/16] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-44/Configuration.h b/bootstrap/unix-44/Configuration.h index 9712e1ee..c108c791 100644 --- a/bootstrap/unix-44/Configuration.h +++ b/bootstrap/unix-44/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 e6b9c126..d0c9621d 100644 --- a/bootstrap/unix-44/Console.c +++ b/bootstrap/unix-44/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-44/Console.h b/bootstrap/unix-44/Console.h index 06f26feb..6fc6afd9 100644 --- a/bootstrap/unix-44/Console.h +++ b/bootstrap/unix-44/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 1a2edfbf..e175fe23 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/Files.h b/bootstrap/unix-44/Files.h index 6cbf6d8f..694e9589 100644 --- a/bootstrap/unix-44/Files.h +++ b/bootstrap/unix-44/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 2383245d..395a53ab 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-44/Heap.h b/bootstrap/unix-44/Heap.h index 03e3bc31..b503b070 100644 --- a/bootstrap/unix-44/Heap.h +++ b/bootstrap/unix-44/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] 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 558cd58f..49f8a341 100644 --- a/bootstrap/unix-44/Modules.c +++ b/bootstrap/unix-44/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-44/Modules.h b/bootstrap/unix-44/Modules.h index cf536137..ac58c524 100644 --- a/bootstrap/unix-44/Modules.h +++ b/bootstrap/unix-44/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 adf8defa..dcf7d09d 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -36,6 +36,7 @@ export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -52,6 +53,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); static INTEGER OPB_SignedByteSize (LONGINT n); static LONGINT OPB_SignedMaximum (LONGINT bytecount); static LONGINT OPB_SignedMinimum (LONGINT bytecount); @@ -224,6 +226,23 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static LONGINT OPB_SignedMaximum (LONGINT bytecount) +{ + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +static LONGINT OPB_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPB_SignedMaximum(bytecount) - 1; + return _o_result; +} + static INTEGER OPB_SignedByteSize (LONGINT n) { INTEGER _o_result; @@ -232,17 +251,39 @@ static INTEGER OPB_SignedByteSize (LONGINT n) n = -(n + 1); } b = 1; - while (b < 8) { - if (__ASH(n, -(__ASHL(b, 3) - 1)) == 0) { - _o_result = b; - return _o_result; - } + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = 8; + _o_result = b; return _o_result; } +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (LONGINT)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (LONGINT)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + static OPT_Struct OPB_IntType (LONGINT size) { OPT_Struct _o_result; @@ -407,16 +448,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__63 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__63 *lnk; +} *TypTest__63_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__64 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__64 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -429,54 +470,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__63_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__63_s->x, NIL); + (*TypTest__63_s->x)->readonly = (*TypTest__63_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__63_s->guard) { + if ((*TypTest__63_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__63_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__63 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__63_s; + TypTest__63_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__64((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__64((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -485,7 +526,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__63_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -551,13 +592,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__29 { - struct MOp__29 *lnk; -} *MOp__29_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -574,9 +615,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__29 _s; - _s.lnk = MOp__29_s; - MOp__29_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -590,7 +631,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -618,7 +659,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -639,7 +680,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -651,7 +692,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -664,7 +705,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -677,7 +718,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -686,7 +727,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -703,7 +744,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__29_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -1197,15 +1238,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__39 { +static struct Op__40 { INTEGER *f, *g; - struct Op__39 *lnk; -} *Op__39_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1216,29 +1257,29 @@ static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 10; - if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__39_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__39_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__39_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__39_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1255,11 +1296,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__39 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__39_s; - Op__39_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1371,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1390,7 +1431,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1413,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1431,7 +1472,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1441,7 +1482,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1464,7 +1505,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1473,7 +1514,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1484,7 +1525,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1492,16 +1533,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__42(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__42(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1510,7 +1551,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1520,7 +1561,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__39_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1613,7 +1654,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; @@ -1725,23 +1766,6 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -static LONGINT OPB_SignedMaximum (LONGINT bytecount) -{ - LONGINT _o_result; - LONGINT result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); - _o_result = result - 1; - return _o_result; -} - -static LONGINT OPB_SignedMinimum (LONGINT bytecount) -{ - LONGINT _o_result; - _o_result = -OPB_SignedMaximum(bytecount) - 1; - return _o_result; -} - void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) { INTEGER f; @@ -1889,10 +1913,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (LONGINT)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1902,10 +1924,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (LONGINT)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1953,7 +1973,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (LONGINT)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1991,9 +2011,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2042,13 +2062,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__58 { + struct StPar1__58 *lnk; +} *StPar1__58_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2065,9 +2085,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__58 _s; + _s.lnk = StPar1__58_s; + StPar1__58_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2083,7 +2103,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2094,7 +2114,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2119,7 +2139,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__59(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2141,7 +2161,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__59(19, 18, p, x); } else { OPB_err(111); } @@ -2167,7 +2187,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__59(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2198,9 +2218,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__59(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__59(12, 28, p, x); } p->typ = p->left->typ; } @@ -2217,7 +2237,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2227,7 +2247,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__59(12, 26, p, x); } else { OPB_err(111); } @@ -2251,7 +2271,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__59(19, 30, p, x); } else { OPB_err(111); } @@ -2260,9 +2280,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2297,7 +2317,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__58_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2416,7 +2436,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2499,7 +2519,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-44/OPB.h b/bootstrap/unix-44/OPB.h index 4de09d08..20c7906a 100644 --- a/bootstrap/unix-44/OPB.h +++ b/bootstrap/unix-44/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 beb2a994..2efc2010 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPC.h b/bootstrap/unix-44/OPC.h index 70e642a0..ac61a9a4 100644 --- a/bootstrap/unix-44/OPC.h +++ b/bootstrap/unix-44/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 dd62beba..fc316318 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -550,7 +550,10 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - OPM_FPrint(&*fp, __VAL(LONGINT, lr)); + __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); + __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); } static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) diff --git a/bootstrap/unix-44/OPM.h b/bootstrap/unix-44/OPM.h index b813f21a..ec53cacf 100644 --- a/bootstrap/unix-44/OPM.h +++ b/bootstrap/unix-44/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 0b912709..16e0120d 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPP.h b/bootstrap/unix-44/OPP.h index 2de55e8b..fd1bcfb5 100644 --- a/bootstrap/unix-44/OPP.h +++ b/bootstrap/unix-44/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 9ee4c536..d0000064 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-44/OPS.h b/bootstrap/unix-44/OPS.h index 7f4d049d..fa915439 100644 --- a/bootstrap/unix-44/OPS.h +++ b/bootstrap/unix-44/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 898af6d0..fb9d4f53 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-44/OPT.h b/bootstrap/unix-44/OPT.h index 1346d74e..a492d562 100644 --- a/bootstrap/unix-44/OPT.h +++ b/bootstrap/unix-44/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 9699164e..961c5e11 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -963,11 +963,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); diff --git a/bootstrap/unix-44/OPV.h b/bootstrap/unix-44/OPV.h index e31b63fe..90fd99e0 100644 --- a/bootstrap/unix-44/OPV.h +++ b/bootstrap/unix-44/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 da8c75d2..196fab12 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/Platform.h b/bootstrap/unix-44/Platform.h index f1a0d63f..d4c03121 100644 --- a/bootstrap/unix-44/Platform.h +++ b/bootstrap/unix-44/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 fe1db847..b7e710d1 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -1,15 +1,17 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -55,17 +57,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); - _o_result = (int)__MASK(__ASHR(l, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -115,34 +127,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/unix-44/Reals.h b/bootstrap/unix-44/Reals.h index 6f9b9ca8..9e6fe8b0 100644 --- a/bootstrap/unix-44/Reals.h +++ b/bootstrap/unix-44/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -10,10 +10,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/unix-44/SYSTEM.h b/bootstrap/unix-44/SYSTEM.h index 394407bd..7ea8b8de 100644 --- a/bootstrap/unix-44/SYSTEM.h +++ b/bootstrap/unix-44/SYSTEM.h @@ -134,10 +134,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ /* SYSTEM ops */ -//#define __VAL(t, x) ((t)(x)) -//#define __VALP(t, x) ((t)(uintptr_t)(x)) #define __VAL(t, x) (*(t*)&(x)) -#define __VALP(t, x) (*(t*)&(x)) #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index d944f9bc..93143345 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-44/Strings.h b/bootstrap/unix-44/Strings.h index 43c4284d..692cd75c 100644 --- a/bootstrap/unix-44/Strings.h +++ b/bootstrap/unix-44/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 bcd72091..17a5095c 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-44/Texts.h b/bootstrap/unix-44/Texts.h index 36073bc7..49e953e7 100644 --- a/bootstrap/unix-44/Texts.h +++ b/bootstrap/unix-44/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 c2ec4928..a9dfcfeb 100644 --- a/bootstrap/unix-44/Vishap.c +++ b/bootstrap/unix-44/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-44/errors.c b/bootstrap/unix-44/errors.c index 31ec3cc6..af15b204 100644 --- a/bootstrap/unix-44/errors.c +++ b/bootstrap/unix-44/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-44/errors.h b/bootstrap/unix-44/errors.h index 3270e9f8..79a85935 100644 --- a/bootstrap/unix-44/errors.h +++ b/bootstrap/unix-44/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 3cad087d..ff1668dc 100644 --- a/bootstrap/unix-44/extTools.c +++ b/bootstrap/unix-44/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-44/extTools.h b/bootstrap/unix-44/extTools.h index 191d54b2..6954be86 100644 --- a/bootstrap/unix-44/extTools.h +++ b/bootstrap/unix-44/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 d8bd7a49..72e640c5 100644 --- a/bootstrap/unix-44/vt100.c +++ b/bootstrap/unix-44/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-44/vt100.h b/bootstrap/unix-44/vt100.h index 9d09c058..de72ffbc 100644 --- a/bootstrap/unix-44/vt100.h +++ b/bootstrap/unix-44/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 36e599bd..b4cdd828 100644 --- a/bootstrap/unix-48/Configuration.c +++ b/bootstrap/unix-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/16] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-48/Configuration.h b/bootstrap/unix-48/Configuration.h index 9712e1ee..c108c791 100644 --- a/bootstrap/unix-48/Configuration.h +++ b/bootstrap/unix-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 e6b9c126..d0c9621d 100644 --- a/bootstrap/unix-48/Console.c +++ b/bootstrap/unix-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-48/Console.h b/bootstrap/unix-48/Console.h index 06f26feb..6fc6afd9 100644 --- a/bootstrap/unix-48/Console.h +++ b/bootstrap/unix-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 1a2edfbf..e175fe23 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/Files.h b/bootstrap/unix-48/Files.h index 6cbf6d8f..694e9589 100644 --- a/bootstrap/unix-48/Files.h +++ b/bootstrap/unix-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 2383245d..395a53ab 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/unix-48/Heap.h b/bootstrap/unix-48/Heap.h index 03e3bc31..b503b070 100644 --- a/bootstrap/unix-48/Heap.h +++ b/bootstrap/unix-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] 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 558cd58f..49f8a341 100644 --- a/bootstrap/unix-48/Modules.c +++ b/bootstrap/unix-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/unix-48/Modules.h b/bootstrap/unix-48/Modules.h index cf536137..ac58c524 100644 --- a/bootstrap/unix-48/Modules.h +++ b/bootstrap/unix-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 adf8defa..dcf7d09d 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -36,6 +36,7 @@ export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -52,6 +53,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); static INTEGER OPB_SignedByteSize (LONGINT n); static LONGINT OPB_SignedMaximum (LONGINT bytecount); static LONGINT OPB_SignedMinimum (LONGINT bytecount); @@ -224,6 +226,23 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static LONGINT OPB_SignedMaximum (LONGINT bytecount) +{ + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +static LONGINT OPB_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPB_SignedMaximum(bytecount) - 1; + return _o_result; +} + static INTEGER OPB_SignedByteSize (LONGINT n) { INTEGER _o_result; @@ -232,17 +251,39 @@ static INTEGER OPB_SignedByteSize (LONGINT n) n = -(n + 1); } b = 1; - while (b < 8) { - if (__ASH(n, -(__ASHL(b, 3) - 1)) == 0) { - _o_result = b; - return _o_result; - } + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = 8; + _o_result = b; return _o_result; } +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (LONGINT)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (LONGINT)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + static OPT_Struct OPB_IntType (LONGINT size) { OPT_Struct _o_result; @@ -407,16 +448,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__63 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__63 *lnk; +} *TypTest__63_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__64 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__64 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -429,54 +470,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__63_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__63_s->x, NIL); + (*TypTest__63_s->x)->readonly = (*TypTest__63_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__63_s->guard) { + if ((*TypTest__63_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__63_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__63 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__63_s; + TypTest__63_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__64((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__64((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -485,7 +526,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__63_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -551,13 +592,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__29 { - struct MOp__29 *lnk; -} *MOp__29_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -574,9 +615,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__29 _s; - _s.lnk = MOp__29_s; - MOp__29_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -590,7 +631,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -618,7 +659,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -639,7 +680,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -651,7 +692,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -664,7 +705,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -677,7 +718,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -686,7 +727,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -703,7 +744,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__29_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -1197,15 +1238,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__39 { +static struct Op__40 { INTEGER *f, *g; - struct Op__39 *lnk; -} *Op__39_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1216,29 +1257,29 @@ static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 10; - if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__39_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__39_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__39_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__39_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1255,11 +1296,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__39 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__39_s; - Op__39_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1371,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1390,7 +1431,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1413,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1431,7 +1472,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1441,7 +1482,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1464,7 +1505,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1473,7 +1514,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1484,7 +1525,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1492,16 +1533,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__42(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__42(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1510,7 +1551,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1520,7 +1561,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__39_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1613,7 +1654,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; @@ -1725,23 +1766,6 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -static LONGINT OPB_SignedMaximum (LONGINT bytecount) -{ - LONGINT _o_result; - LONGINT result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); - _o_result = result - 1; - return _o_result; -} - -static LONGINT OPB_SignedMinimum (LONGINT bytecount) -{ - LONGINT _o_result; - _o_result = -OPB_SignedMaximum(bytecount) - 1; - return _o_result; -} - void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) { INTEGER f; @@ -1889,10 +1913,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (LONGINT)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1902,10 +1924,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (LONGINT)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1953,7 +1973,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (LONGINT)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1991,9 +2011,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2042,13 +2062,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__58 { + struct StPar1__58 *lnk; +} *StPar1__58_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2065,9 +2085,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__58 _s; + _s.lnk = StPar1__58_s; + StPar1__58_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2083,7 +2103,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2094,7 +2114,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2119,7 +2139,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__59(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2141,7 +2161,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__59(19, 18, p, x); } else { OPB_err(111); } @@ -2167,7 +2187,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__59(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2198,9 +2218,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__59(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__59(12, 28, p, x); } p->typ = p->left->typ; } @@ -2217,7 +2237,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2227,7 +2247,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__59(12, 26, p, x); } else { OPB_err(111); } @@ -2251,7 +2271,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__59(19, 30, p, x); } else { OPB_err(111); } @@ -2260,9 +2280,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2297,7 +2317,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__58_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2416,7 +2436,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2499,7 +2519,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-48/OPB.h b/bootstrap/unix-48/OPB.h index 4de09d08..20c7906a 100644 --- a/bootstrap/unix-48/OPB.h +++ b/bootstrap/unix-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 beb2a994..2efc2010 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPC.h b/bootstrap/unix-48/OPC.h index 70e642a0..ac61a9a4 100644 --- a/bootstrap/unix-48/OPC.h +++ b/bootstrap/unix-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 dd62beba..fc316318 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -550,7 +550,10 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - OPM_FPrint(&*fp, __VAL(LONGINT, lr)); + __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); + __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); } static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) diff --git a/bootstrap/unix-48/OPM.h b/bootstrap/unix-48/OPM.h index b813f21a..ec53cacf 100644 --- a/bootstrap/unix-48/OPM.h +++ b/bootstrap/unix-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 0b912709..16e0120d 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPP.h b/bootstrap/unix-48/OPP.h index 2de55e8b..fd1bcfb5 100644 --- a/bootstrap/unix-48/OPP.h +++ b/bootstrap/unix-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 9ee4c536..d0000064 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-48/OPS.h b/bootstrap/unix-48/OPS.h index 7f4d049d..fa915439 100644 --- a/bootstrap/unix-48/OPS.h +++ b/bootstrap/unix-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 898af6d0..fb9d4f53 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/unix-48/OPT.h b/bootstrap/unix-48/OPT.h index 1346d74e..a492d562 100644 --- a/bootstrap/unix-48/OPT.h +++ b/bootstrap/unix-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 9699164e..961c5e11 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -963,11 +963,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); diff --git a/bootstrap/unix-48/OPV.h b/bootstrap/unix-48/OPV.h index e31b63fe..90fd99e0 100644 --- a/bootstrap/unix-48/OPV.h +++ b/bootstrap/unix-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 da8c75d2..196fab12 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/Platform.h b/bootstrap/unix-48/Platform.h index f1a0d63f..d4c03121 100644 --- a/bootstrap/unix-48/Platform.h +++ b/bootstrap/unix-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 fe1db847..b7e710d1 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -1,15 +1,17 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -55,17 +57,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); - _o_result = (int)__MASK(__ASHR(l, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -115,34 +127,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/unix-48/Reals.h b/bootstrap/unix-48/Reals.h index 6f9b9ca8..9e6fe8b0 100644 --- a/bootstrap/unix-48/Reals.h +++ b/bootstrap/unix-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -10,10 +10,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/unix-48/SYSTEM.h b/bootstrap/unix-48/SYSTEM.h index 394407bd..7ea8b8de 100644 --- a/bootstrap/unix-48/SYSTEM.h +++ b/bootstrap/unix-48/SYSTEM.h @@ -134,10 +134,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ /* SYSTEM ops */ -//#define __VAL(t, x) ((t)(x)) -//#define __VALP(t, x) ((t)(uintptr_t)(x)) #define __VAL(t, x) (*(t*)&(x)) -#define __VALP(t, x) (*(t*)&(x)) #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index d944f9bc..93143345 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/unix-48/Strings.h b/bootstrap/unix-48/Strings.h index 43c4284d..692cd75c 100644 --- a/bootstrap/unix-48/Strings.h +++ b/bootstrap/unix-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 9df4e8d1..110f4931 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/unix-48/Texts.h b/bootstrap/unix-48/Texts.h index a2e8c7d0..6000e489 100644 --- a/bootstrap/unix-48/Texts.h +++ b/bootstrap/unix-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 c2ec4928..a9dfcfeb 100644 --- a/bootstrap/unix-48/Vishap.c +++ b/bootstrap/unix-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/unix-48/errors.c b/bootstrap/unix-48/errors.c index 31ec3cc6..af15b204 100644 --- a/bootstrap/unix-48/errors.c +++ b/bootstrap/unix-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/unix-48/errors.h b/bootstrap/unix-48/errors.h index 3270e9f8..79a85935 100644 --- a/bootstrap/unix-48/errors.h +++ b/bootstrap/unix-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 3cad087d..ff1668dc 100644 --- a/bootstrap/unix-48/extTools.c +++ b/bootstrap/unix-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/unix-48/extTools.h b/bootstrap/unix-48/extTools.h index 191d54b2..6954be86 100644 --- a/bootstrap/unix-48/extTools.h +++ b/bootstrap/unix-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 d8bd7a49..72e640c5 100644 --- a/bootstrap/unix-48/vt100.c +++ b/bootstrap/unix-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/unix-48/vt100.h b/bootstrap/unix-48/vt100.h index 9d09c058..de72ffbc 100644 --- a/bootstrap/unix-48/vt100.h +++ b/bootstrap/unix-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 ba9e7098..a917e60f 100644 --- a/bootstrap/unix-88/Configuration.c +++ b/bootstrap/unix-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/16] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/unix-88/Configuration.h b/bootstrap/unix-88/Configuration.h index 4657606c..8c710916 100644 --- a/bootstrap/unix-88/Configuration.h +++ b/bootstrap/unix-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 8e06ac08..40695c51 100644 --- a/bootstrap/unix-88/Console.c +++ b/bootstrap/unix-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/unix-88/Console.h b/bootstrap/unix-88/Console.h index 2397393b..5c76ef74 100644 --- a/bootstrap/unix-88/Console.h +++ b/bootstrap/unix-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 eb46629e..9c7a1af7 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/Files.h b/bootstrap/unix-88/Files.h index 2c953a36..82661e2c 100644 --- a/bootstrap/unix-88/Files.h +++ b/bootstrap/unix-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 47408639..2ba52d2f 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Heap.h b/bootstrap/unix-88/Heap.h index 5e2d316f..53b21f41 100644 --- a/bootstrap/unix-88/Heap.h +++ b/bootstrap/unix-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] 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 ae712385..9efb8a96 100644 --- a/bootstrap/unix-88/Modules.c +++ b/bootstrap/unix-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/Modules.h b/bootstrap/unix-88/Modules.h index 6854654f..25b9b785 100644 --- a/bootstrap/unix-88/Modules.h +++ b/bootstrap/unix-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 248a0348..514304bd 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -37,6 +37,7 @@ export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -53,6 +54,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); static INTEGER OPB_SignedByteSize (LONGINT n); static LONGINT OPB_SignedMaximum (LONGINT bytecount); static LONGINT OPB_SignedMinimum (LONGINT bytecount); @@ -225,6 +227,23 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static LONGINT OPB_SignedMaximum (LONGINT bytecount) +{ + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +static LONGINT OPB_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPB_SignedMaximum(bytecount) - 1; + return _o_result; +} + static INTEGER OPB_SignedByteSize (LONGINT n) { INTEGER _o_result; @@ -233,17 +252,39 @@ static INTEGER OPB_SignedByteSize (LONGINT n) n = -(n + 1); } b = 1; - while (b < 8) { - if (__ASH(n, -(__ASHL(b, 3) - 1)) == 0) { - _o_result = b; - return _o_result; - } + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = 8; + _o_result = b; return _o_result; } +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (LONGINT)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (LONGINT)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + static OPT_Struct OPB_IntType (LONGINT size) { OPT_Struct _o_result; @@ -408,16 +449,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__63 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__63 *lnk; +} *TypTest__63_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__64 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__64 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -430,54 +471,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__63_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__63_s->x, NIL); + (*TypTest__63_s->x)->readonly = (*TypTest__63_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__63_s->guard) { + if ((*TypTest__63_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__63_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__63 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__63_s; + TypTest__63_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__64((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__64((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -486,7 +527,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__63_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -552,13 +593,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__29 { - struct MOp__29 *lnk; -} *MOp__29_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -575,9 +616,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__29 _s; - _s.lnk = MOp__29_s; - MOp__29_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -591,7 +632,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -619,7 +660,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -640,7 +681,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -652,7 +693,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -665,7 +706,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -678,7 +719,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -687,7 +728,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -704,7 +745,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__29_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -1198,15 +1239,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__39 { +static struct Op__40 { INTEGER *f, *g; - struct Op__39 *lnk; -} *Op__39_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1217,29 +1258,29 @@ static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 10; - if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__39_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__39_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__39_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__39_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1256,11 +1297,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__39 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__39_s; - Op__39_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1372,7 +1413,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1391,7 +1432,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1414,7 +1455,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1432,7 +1473,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1442,7 +1483,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1465,7 +1506,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1474,7 +1515,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1485,7 +1526,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1493,16 +1534,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__42(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__42(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1511,7 +1552,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1521,7 +1562,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__39_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1614,7 +1655,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; @@ -1726,23 +1767,6 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -static LONGINT OPB_SignedMaximum (LONGINT bytecount) -{ - LONGINT _o_result; - LONGINT result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); - _o_result = result - 1; - return _o_result; -} - -static LONGINT OPB_SignedMinimum (LONGINT bytecount) -{ - LONGINT _o_result; - _o_result = -OPB_SignedMaximum(bytecount) - 1; - return _o_result; -} - void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) { INTEGER f; @@ -1890,10 +1914,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (LONGINT)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1903,10 +1925,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (LONGINT)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1954,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (LONGINT)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1992,9 +2012,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2043,13 +2063,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__58 { + struct StPar1__58 *lnk; +} *StPar1__58_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2066,9 +2086,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__58 _s; + _s.lnk = StPar1__58_s; + StPar1__58_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2084,7 +2104,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2095,7 +2115,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2120,7 +2140,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__59(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2142,7 +2162,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__59(19, 18, p, x); } else { OPB_err(111); } @@ -2168,7 +2188,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__59(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2199,9 +2219,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__59(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__59(12, 28, p, x); } p->typ = p->left->typ; } @@ -2218,7 +2238,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2228,7 +2248,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__59(12, 26, p, x); } else { OPB_err(111); } @@ -2252,7 +2272,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__59(19, 30, p, x); } else { OPB_err(111); } @@ -2261,9 +2281,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2298,7 +2318,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__58_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2417,7 +2437,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2500,7 +2520,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/unix-88/OPB.h b/bootstrap/unix-88/OPB.h index f5706dd7..6e90fcf5 100644 --- a/bootstrap/unix-88/OPB.h +++ b/bootstrap/unix-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 efe720a3..b286807f 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/OPC.h b/bootstrap/unix-88/OPC.h index eec830f1..1b09dedc 100644 --- a/bootstrap/unix-88/OPC.h +++ b/bootstrap/unix-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 092edf6c..27de68da 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -552,10 +552,7 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); - __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FPrint(&*fp, __VAL(LONGINT, lr)); } static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) diff --git a/bootstrap/unix-88/OPM.h b/bootstrap/unix-88/OPM.h index 18397e74..78d88d0b 100644 --- a/bootstrap/unix-88/OPM.h +++ b/bootstrap/unix-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 f69a1750..8c5428b2 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/unix-88/OPP.h b/bootstrap/unix-88/OPP.h index 6e42de59..04840f08 100644 --- a/bootstrap/unix-88/OPP.h +++ b/bootstrap/unix-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 57b90bad..5196bbd6 100644 --- a/bootstrap/unix-88/OPS.c +++ b/bootstrap/unix-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPS.h b/bootstrap/unix-88/OPS.h index b2d2cf55..b4346886 100644 --- a/bootstrap/unix-88/OPS.h +++ b/bootstrap/unix-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 371d31a9..365abe0b 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/unix-88/OPT.h b/bootstrap/unix-88/OPT.h index 343a6059..4fe1b205 100644 --- a/bootstrap/unix-88/OPT.h +++ b/bootstrap/unix-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index f5d943cd..5c482eb4 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -964,11 +964,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); diff --git a/bootstrap/unix-88/OPV.h b/bootstrap/unix-88/OPV.h index b10b4265..349e3d10 100644 --- a/bootstrap/unix-88/OPV.h +++ b/bootstrap/unix-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 a2e4d4e9..3dd6c3f2 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Platform.h b/bootstrap/unix-88/Platform.h index 294cd0ea..74c368da 100644 --- a/bootstrap/unix-88/Platform.h +++ b/bootstrap/unix-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 f38e5bd8..e42135a4 100644 --- a/bootstrap/unix-88/Reals.c +++ b/bootstrap/unix-88/Reals.c @@ -1,16 +1,18 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -56,17 +58,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, i, INTEGER); - _o_result = (int)__MASK(__ASHR((LONGINT)i, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -103,34 +115,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/unix-88/Reals.h b/bootstrap/unix-88/Reals.h index 0647106c..3a3a206a 100644 --- a/bootstrap/unix-88/Reals.h +++ b/bootstrap/unix-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -11,10 +11,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/unix-88/SYSTEM.h b/bootstrap/unix-88/SYSTEM.h index 394407bd..7ea8b8de 100644 --- a/bootstrap/unix-88/SYSTEM.h +++ b/bootstrap/unix-88/SYSTEM.h @@ -134,10 +134,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ /* SYSTEM ops */ -//#define __VAL(t, x) ((t)(x)) -//#define __VALP(t, x) ((t)(uintptr_t)(x)) #define __VAL(t, x) (*(t*)&(x)) -#define __VALP(t, x) (*(t*)&(x)) #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) diff --git a/bootstrap/unix-88/Strings.c b/bootstrap/unix-88/Strings.c index a1b5c956..b64d7db9 100644 --- a/bootstrap/unix-88/Strings.c +++ b/bootstrap/unix-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/Strings.h b/bootstrap/unix-88/Strings.h index 29cd1c88..68433fb9 100644 --- a/bootstrap/unix-88/Strings.h +++ b/bootstrap/unix-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 fa9a1311..a3432709 100644 --- a/bootstrap/unix-88/Texts.c +++ b/bootstrap/unix-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/unix-88/Texts.h b/bootstrap/unix-88/Texts.h index 240b0acb..a86b8717 100644 --- a/bootstrap/unix-88/Texts.h +++ b/bootstrap/unix-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 bc48ed60..b889aad9 100644 --- a/bootstrap/unix-88/Vishap.c +++ b/bootstrap/unix-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/errors.c b/bootstrap/unix-88/errors.c index 4911b020..98e42790 100644 --- a/bootstrap/unix-88/errors.c +++ b/bootstrap/unix-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/unix-88/errors.h b/bootstrap/unix-88/errors.h index 571c65b9..314ab2dc 100644 --- a/bootstrap/unix-88/errors.h +++ b/bootstrap/unix-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 6865568d..8a238c7f 100644 --- a/bootstrap/unix-88/extTools.c +++ b/bootstrap/unix-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/unix-88/extTools.h b/bootstrap/unix-88/extTools.h index 88620668..359df725 100644 --- a/bootstrap/unix-88/extTools.h +++ b/bootstrap/unix-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 e668fc2c..99663386 100644 --- a/bootstrap/unix-88/vt100.c +++ b/bootstrap/unix-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/unix-88/vt100.h b/bootstrap/unix-88/vt100.h index 15d39b23..94b58ced 100644 --- a/bootstrap/unix-88/vt100.h +++ b/bootstrap/unix-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 36e599bd..b4cdd828 100644 --- a/bootstrap/windows-48/Configuration.c +++ b/bootstrap/windows-48/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" @@ -13,6 +13,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/16] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-48/Configuration.h b/bootstrap/windows-48/Configuration.h index 9712e1ee..c108c791 100644 --- a/bootstrap/windows-48/Configuration.h +++ b/bootstrap/windows-48/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 bac2ff35..d1736bef 100644 --- a/bootstrap/windows-48/Console.c +++ b/bootstrap/windows-48/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-48/Console.h b/bootstrap/windows-48/Console.h index 06f26feb..6fc6afd9 100644 --- a/bootstrap/windows-48/Console.h +++ b/bootstrap/windows-48/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 a6827339..3460499e 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/Files.h b/bootstrap/windows-48/Files.h index 69fc5ad3..cfe27379 100644 --- a/bootstrap/windows-48/Files.h +++ b/bootstrap/windows-48/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 2383245d..395a53ab 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tskSfF */ #include "SYSTEM.h" struct Heap__1 { diff --git a/bootstrap/windows-48/Heap.h b/bootstrap/windows-48/Heap.h index 03e3bc31..b503b070 100644 --- a/bootstrap/windows-48/Heap.h +++ b/bootstrap/windows-48/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] 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 558cd58f..49f8a341 100644 --- a/bootstrap/windows-48/Modules.c +++ b/bootstrap/windows-48/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Heap.h" diff --git a/bootstrap/windows-48/Modules.h b/bootstrap/windows-48/Modules.h index cf536137..ac58c524 100644 --- a/bootstrap/windows-48/Modules.h +++ b/bootstrap/windows-48/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 adf8defa..dcf7d09d 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" @@ -36,6 +36,7 @@ export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -52,6 +53,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); static INTEGER OPB_SignedByteSize (LONGINT n); static LONGINT OPB_SignedMaximum (LONGINT bytecount); static LONGINT OPB_SignedMinimum (LONGINT bytecount); @@ -224,6 +226,23 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static LONGINT OPB_SignedMaximum (LONGINT bytecount) +{ + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +static LONGINT OPB_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPB_SignedMaximum(bytecount) - 1; + return _o_result; +} + static INTEGER OPB_SignedByteSize (LONGINT n) { INTEGER _o_result; @@ -232,17 +251,39 @@ static INTEGER OPB_SignedByteSize (LONGINT n) n = -(n + 1); } b = 1; - while (b < 8) { - if (__ASH(n, -(__ASHL(b, 3) - 1)) == 0) { - _o_result = b; - return _o_result; - } + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = 8; + _o_result = b; return _o_result; } +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (LONGINT)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (LONGINT)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + static OPT_Struct OPB_IntType (LONGINT size) { OPT_Struct _o_result; @@ -407,16 +448,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__63 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__63 *lnk; +} *TypTest__63_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__64 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__64 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -429,54 +470,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__63_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__63_s->x, NIL); + (*TypTest__63_s->x)->readonly = (*TypTest__63_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__63_s->guard) { + if ((*TypTest__63_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__63_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__63 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__63_s; + TypTest__63_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__64((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__64((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -485,7 +526,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__63_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -551,13 +592,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__29 { - struct MOp__29 *lnk; -} *MOp__29_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -574,9 +615,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__29 _s; - _s.lnk = MOp__29_s; - MOp__29_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -590,7 +631,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -618,7 +659,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -639,7 +680,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -651,7 +692,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -664,7 +705,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -677,7 +718,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -686,7 +727,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -703,7 +744,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__29_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -1197,15 +1238,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__39 { +static struct Op__40 { INTEGER *f, *g; - struct Op__39 *lnk; -} *Op__39_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1216,29 +1257,29 @@ static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 10; - if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__39_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__39_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__39_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__39_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1255,11 +1296,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__39 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__39_s; - Op__39_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1371,7 +1412,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1390,7 +1431,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1413,7 +1454,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1431,7 +1472,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1441,7 +1482,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1464,7 +1505,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1473,7 +1514,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1484,7 +1525,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1492,16 +1533,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__42(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__42(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1510,7 +1551,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1520,7 +1561,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__39_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1613,7 +1654,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; @@ -1725,23 +1766,6 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -static LONGINT OPB_SignedMaximum (LONGINT bytecount) -{ - LONGINT _o_result; - LONGINT result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); - _o_result = result - 1; - return _o_result; -} - -static LONGINT OPB_SignedMinimum (LONGINT bytecount) -{ - LONGINT _o_result; - _o_result = -OPB_SignedMaximum(bytecount) - 1; - return _o_result; -} - void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) { INTEGER f; @@ -1889,10 +1913,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (LONGINT)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1902,10 +1924,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (LONGINT)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1953,7 +1973,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (LONGINT)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1991,9 +2011,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2042,13 +2062,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__58 { + struct StPar1__58 *lnk; +} *StPar1__58_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2065,9 +2085,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__58 _s; + _s.lnk = StPar1__58_s; + StPar1__58_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2083,7 +2103,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2094,7 +2114,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2119,7 +2139,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__59(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2141,7 +2161,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__59(19, 18, p, x); } else { OPB_err(111); } @@ -2167,7 +2187,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__59(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2198,9 +2218,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__59(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__59(12, 28, p, x); } p->typ = p->left->typ; } @@ -2217,7 +2237,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2227,7 +2247,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__59(12, 26, p, x); } else { OPB_err(111); } @@ -2251,7 +2271,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__59(19, 30, p, x); } else { OPB_err(111); } @@ -2260,9 +2280,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2297,7 +2317,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__58_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2416,7 +2436,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2499,7 +2519,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/windows-48/OPB.h b/bootstrap/windows-48/OPB.h index 4de09d08..20c7906a 100644 --- a/bootstrap/windows-48/OPB.h +++ b/bootstrap/windows-48/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 beb2a994..2efc2010 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPC.h b/bootstrap/windows-48/OPC.h index 70e642a0..ac61a9a4 100644 --- a/bootstrap/windows-48/OPC.h +++ b/bootstrap/windows-48/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 dd62beba..fc316318 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" @@ -550,7 +550,10 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - OPM_FPrint(&*fp, __VAL(LONGINT, lr)); + __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); + __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); + OPM_FPrint(&*fp, l); + OPM_FPrint(&*fp, h); } static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) diff --git a/bootstrap/windows-48/OPM.h b/bootstrap/windows-48/OPM.h index b813f21a..ec53cacf 100644 --- a/bootstrap/windows-48/OPM.h +++ b/bootstrap/windows-48/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 0b912709..16e0120d 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPB.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPP.h b/bootstrap/windows-48/OPP.h index 2de55e8b..fd1bcfb5 100644 --- a/bootstrap/windows-48/OPP.h +++ b/bootstrap/windows-48/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 9ee4c536..d0000064 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-48/OPS.h b/bootstrap/windows-48/OPS.h index 7f4d049d..fa915439 100644 --- a/bootstrap/windows-48/OPS.h +++ b/bootstrap/windows-48/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 898af6d0..fb9d4f53 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPM.h" #include "OPS.h" diff --git a/bootstrap/windows-48/OPT.h b/bootstrap/windows-48/OPT.h index 1346d74e..a492d562 100644 --- a/bootstrap/windows-48/OPT.h +++ b/bootstrap/windows-48/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 9699164e..961c5e11 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "OPC.h" #include "OPM.h" @@ -963,11 +963,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); diff --git a/bootstrap/windows-48/OPV.h b/bootstrap/windows-48/OPV.h index e31b63fe..90fd99e0 100644 --- a/bootstrap/windows-48/OPV.h +++ b/bootstrap/windows-48/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 506cf3ba..9ec851b2 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/Platform.h b/bootstrap/windows-48/Platform.h index eac1f538..a2f6181f 100644 --- a/bootstrap/windows-48/Platform.h +++ b/bootstrap/windows-48/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 fe1db847..b7e710d1 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -1,15 +1,17 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -55,17 +57,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, l, LONGINT); - _o_result = (int)__MASK(__ASHR(l, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -115,34 +127,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/windows-48/Reals.h b/bootstrap/windows-48/Reals.h index 6f9b9ca8..9e6fe8b0 100644 --- a/bootstrap/windows-48/Reals.h +++ b/bootstrap/windows-48/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -10,10 +10,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/windows-48/SYSTEM.h b/bootstrap/windows-48/SYSTEM.h index 394407bd..7ea8b8de 100644 --- a/bootstrap/windows-48/SYSTEM.h +++ b/bootstrap/windows-48/SYSTEM.h @@ -134,10 +134,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ /* SYSTEM ops */ -//#define __VAL(t, x) ((t)(x)) -//#define __VALP(t, x) ((t)(uintptr_t)(x)) #define __VAL(t, x) (*(t*)&(x)) -#define __VALP(t, x) (*(t*)&(x)) #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index d944f9bc..93143345 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" diff --git a/bootstrap/windows-48/Strings.h b/bootstrap/windows-48/Strings.h index 43c4284d..692cd75c 100644 --- a/bootstrap/windows-48/Strings.h +++ b/bootstrap/windows-48/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 9df4e8d1..110f4931 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Files.h" #include "Modules.h" diff --git a/bootstrap/windows-48/Texts.h b/bootstrap/windows-48/Texts.h index a2e8c7d0..6000e489 100644 --- a/bootstrap/windows-48/Texts.h +++ b/bootstrap/windows-48/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 c2ec4928..a9dfcfeb 100644 --- a/bootstrap/windows-48/Vishap.c +++ b/bootstrap/windows-48/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkamSf */ #include "SYSTEM.h" #include "Configuration.h" #include "Heap.h" diff --git a/bootstrap/windows-48/errors.c b/bootstrap/windows-48/errors.c index 31ec3cc6..af15b204 100644 --- a/bootstrap/windows-48/errors.c +++ b/bootstrap/windows-48/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" typedef diff --git a/bootstrap/windows-48/errors.h b/bootstrap/windows-48/errors.h index 3270e9f8..79a85935 100644 --- a/bootstrap/windows-48/errors.h +++ b/bootstrap/windows-48/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 3cad087d..ff1668dc 100644 --- a/bootstrap/windows-48/extTools.c +++ b/bootstrap/windows-48/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Configuration.h" #include "Console.h" diff --git a/bootstrap/windows-48/extTools.h b/bootstrap/windows-48/extTools.h index 191d54b2..6954be86 100644 --- a/bootstrap/windows-48/extTools.h +++ b/bootstrap/windows-48/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 d8bd7a49..72e640c5 100644 --- a/bootstrap/windows-48/vt100.c +++ b/bootstrap/windows-48/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #include "SYSTEM.h" #include "Console.h" #include "Strings.h" diff --git a/bootstrap/windows-48/vt100.h b/bootstrap/windows-48/vt100.h index 9d09c058..de72ffbc 100644 --- a/bootstrap/windows-48/vt100.h +++ b/bootstrap/windows-48/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 ba9e7098..a917e60f 100644 --- a/bootstrap/windows-88/Configuration.c +++ b/bootstrap/windows-88/Configuration.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" @@ -14,6 +14,6 @@ export void *Configuration__init(void) __DEFMOD; __REGMOD("Configuration", 0); /* BEGIN */ - __MOVE("1.95 [2016/08/16] for gcc LP64 on cygwin", Configuration_versionLong, 41); + __MOVE("1.95 [2016/08/20] for gcc LP64 on cygwin", Configuration_versionLong, 41); __ENDMOD; } diff --git a/bootstrap/windows-88/Configuration.h b/bootstrap/windows-88/Configuration.h index 4657606c..8c710916 100644 --- a/bootstrap/windows-88/Configuration.h +++ b/bootstrap/windows-88/Configuration.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 84d6d43a..7ebcf06b 100644 --- a/bootstrap/windows-88/Console.c +++ b/bootstrap/windows-88/Console.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Platform.h" diff --git a/bootstrap/windows-88/Console.h b/bootstrap/windows-88/Console.h index 2397393b..5c76ef74 100644 --- a/bootstrap/windows-88/Console.h +++ b/bootstrap/windows-88/Console.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 e7ae960d..c1f4b480 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/Files.h b/bootstrap/windows-88/Files.h index 8ead191e..302ea14e 100644 --- a/bootstrap/windows-88/Files.h +++ b/bootstrap/windows-88/Files.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 47408639..2ba52d2f 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tskSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Heap.h b/bootstrap/windows-88/Heap.h index 5e2d316f..53b21f41 100644 --- a/bootstrap/windows-88/Heap.h +++ b/bootstrap/windows-88/Heap.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tskSfF */ +/* voc 1.95 [2016/08/20] 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 ae712385..9efb8a96 100644 --- a/bootstrap/windows-88/Modules.c +++ b/bootstrap/windows-88/Modules.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/Modules.h b/bootstrap/windows-88/Modules.h index 6854654f..25b9b785 100644 --- a/bootstrap/windows-88/Modules.h +++ b/bootstrap/windows-88/Modules.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 248a0348..514304bd 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" @@ -37,6 +37,7 @@ export void OPB_Inittd (OPT_Node *inittd, OPT_Node *last, OPT_Struct typ); static BOOLEAN OPB_IntToBool (LONGINT i); static OPT_Struct OPB_IntType (LONGINT size); export void OPB_Link (OPT_Node *x, OPT_Node *last, OPT_Node y); +static LONGINT OPB_LongerSize (LONGINT i); export void OPB_MOp (SHORTINT op, OPT_Node *x); export OPT_Node OPB_NewBoolConst (BOOLEAN boolval); export OPT_Node OPB_NewIntConst (LONGINT intval); @@ -53,6 +54,7 @@ export void OPB_Return (OPT_Node *x, OPT_Object proc); export void OPB_SetElem (OPT_Node *x); static void OPB_SetIntType (OPT_Node node); export void OPB_SetRange (OPT_Node *x, OPT_Node y); +static LONGINT OPB_ShorterSize (LONGINT i); static INTEGER OPB_SignedByteSize (LONGINT n); static LONGINT OPB_SignedMaximum (LONGINT bytecount); static LONGINT OPB_SignedMinimum (LONGINT bytecount); @@ -225,6 +227,23 @@ OPT_Node OPB_EmptySet (void) return _o_result; } +static LONGINT OPB_SignedMaximum (LONGINT bytecount) +{ + LONGINT _o_result; + LONGINT result; + result = 1; + result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); + _o_result = result - 1; + return _o_result; +} + +static LONGINT OPB_SignedMinimum (LONGINT bytecount) +{ + LONGINT _o_result; + _o_result = -OPB_SignedMaximum(bytecount) - 1; + return _o_result; +} + static INTEGER OPB_SignedByteSize (LONGINT n) { INTEGER _o_result; @@ -233,17 +252,39 @@ static INTEGER OPB_SignedByteSize (LONGINT n) n = -(n + 1); } b = 1; - while (b < 8) { - if (__ASH(n, -(__ASHL(b, 3) - 1)) == 0) { - _o_result = b; - return _o_result; - } + while ((b < 8 && __ASH(n, -(__ASHL(b, 3) - 1)) != 0)) { b += 1; } - _o_result = 8; + _o_result = b; return _o_result; } +static LONGINT OPB_ShorterSize (LONGINT i) +{ + LONGINT _o_result; + if (i >= (LONGINT)OPM_LIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_SIntSize; + return _o_result; + } + __RETCHK; +} + +static LONGINT OPB_LongerSize (LONGINT i) +{ + LONGINT _o_result; + if (i <= (LONGINT)OPM_SIntSize) { + _o_result = OPM_IntSize; + return _o_result; + } else { + _o_result = OPM_LIntSize; + return _o_result; + } + __RETCHK; +} + static OPT_Struct OPB_IntType (LONGINT size) { OPT_Struct _o_result; @@ -408,16 +449,16 @@ void OPB_Field (OPT_Node *x, OPT_Object y) } } -static struct TypTest__61 { +static struct TypTest__63 { OPT_Node *x; OPT_Object *obj; BOOLEAN *guard; - struct TypTest__61 *lnk; -} *TypTest__61_s; + struct TypTest__63 *lnk; +} *TypTest__63_s; -static void GTT__62 (OPT_Struct t0, OPT_Struct t1); +static void GTT__64 (OPT_Struct t0, OPT_Struct t1); -static void GTT__62 (OPT_Struct t0, OPT_Struct t1) +static void GTT__64 (OPT_Struct t0, OPT_Struct t1) { OPT_Node node = NIL; OPT_Struct t = NIL; @@ -430,54 +471,54 @@ static void GTT__62 (OPT_Struct t0, OPT_Struct t1) t1 = t1->BaseTyp; } if (t1 == t0 || t0->form == 0) { - if (*TypTest__61_s->guard) { - OPB_BindNodes(5, NIL, &*TypTest__61_s->x, NIL); - (*TypTest__61_s->x)->readonly = (*TypTest__61_s->x)->left->readonly; + if (*TypTest__63_s->guard) { + OPB_BindNodes(5, NIL, &*TypTest__63_s->x, NIL); + (*TypTest__63_s->x)->readonly = (*TypTest__63_s->x)->left->readonly; } else { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } } else { OPB_err(85); } } else if (t0 != t1) { OPB_err(85); - } else if (!*TypTest__61_s->guard) { - if ((*TypTest__61_s->x)->class == 5) { + } else if (!*TypTest__63_s->guard) { + if ((*TypTest__63_s->x)->class == 5) { node = OPT_NewNode(11); node->subcl = 16; - node->left = *TypTest__61_s->x; - node->obj = *TypTest__61_s->obj; - *TypTest__61_s->x = node; + node->left = *TypTest__63_s->x; + node->obj = *TypTest__63_s->obj; + *TypTest__63_s->x = node; } else { - *TypTest__61_s->x = OPB_NewBoolConst(1); + *TypTest__63_s->x = OPB_NewBoolConst(1); } } } void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) { - struct TypTest__61 _s; + struct TypTest__63 _s; _s.x = x; _s.obj = &obj; _s.guard = &guard; - _s.lnk = TypTest__61_s; - TypTest__61_s = &_s; + _s.lnk = TypTest__63_s; + TypTest__63_s = &_s; if (OPB_NotVar(*x)) { OPB_err(112); } else if ((*x)->typ->form == 13) { if (((*x)->typ->BaseTyp->comp != 4 && (*x)->typ != OPT_sysptrtyp)) { OPB_err(85); } else if (obj->typ->form == 13) { - GTT__62((*x)->typ->BaseTyp, obj->typ->BaseTyp); + GTT__64((*x)->typ->BaseTyp, obj->typ->BaseTyp); } else { OPB_err(86); } } else if (((((*x)->typ->comp == 4 && (*x)->class == 1)) && obj->typ->comp == 4)) { - GTT__62((*x)->typ, obj->typ); + GTT__64((*x)->typ, obj->typ); } else { OPB_err(87); } @@ -486,7 +527,7 @@ void OPB_TypTest (OPT_Node *x, OPT_Object obj, BOOLEAN guard) } else { (*x)->typ = OPT_booltyp; } - TypTest__61_s = _s.lnk; + TypTest__63_s = _s.lnk; } void OPB_In (OPT_Node *x, OPT_Node y) @@ -552,13 +593,13 @@ static void OPB_CheckRealType (INTEGER f, INTEGER nr, OPT_Const x) x->intval = -1; } -static struct MOp__29 { - struct MOp__29 *lnk; -} *MOp__29_s; +static struct MOp__30 { + struct MOp__30 *lnk; +} *MOp__30_s; -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z); +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z); -static OPT_Node NewOp__30 (SHORTINT op, OPT_Struct typ, OPT_Node z) +static OPT_Node NewOp__31 (SHORTINT op, OPT_Struct typ, OPT_Node z) { OPT_Node _o_result; OPT_Node node = NIL; @@ -575,9 +616,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) INTEGER f; OPT_Struct typ = NIL; OPT_Node z = NIL; - struct MOp__29 _s; - _s.lnk = MOp__29_s; - MOp__29_s = &_s; + struct MOp__30 _s; + _s.lnk = MOp__30_s; + MOp__30_s = &_s; z = *x; if (z->class == 8 || z->class == 9) { OPB_err(126); @@ -591,7 +632,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(!OPB_IntToBool(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(98); @@ -619,7 +660,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(97); @@ -640,7 +681,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -652,7 +693,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = (int)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -665,7 +706,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; } else { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } } else { OPB_err(111); @@ -678,7 +719,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) f = 10; } if (z->class < 7 || f == 10) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(127); } @@ -687,7 +728,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 25: if ((__IN(f, 0x70) && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { - z = NewOp__30(op, typ, z); + z = NewOp__31(op, typ, z); } else { OPB_err(219); } @@ -704,7 +745,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } } *x = z; - MOp__29_s = _s.lnk; + MOp__30_s = _s.lnk; } static void OPB_CheckPtr (OPT_Node x, OPT_Node y) @@ -1198,15 +1239,15 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) (*x)->typ = typ; } -static struct Op__39 { +static struct Op__40 { INTEGER *f, *g; - struct Op__39 *lnk; -} *Op__39_s; + struct Op__40 *lnk; +} *Op__40_s; -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y); +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y); +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y); -static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) +static void NewOp__41 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) { OPT_Node node = NIL; node = OPT_NewNode(12); @@ -1217,29 +1258,29 @@ static void NewOp__40 (SHORTINT op, OPT_Struct typ, OPT_Node *x, OPT_Node y) *x = node; } -static BOOLEAN strings__42 (OPT_Node *x, OPT_Node *y) +static BOOLEAN strings__43 (OPT_Node *x, OPT_Node *y) { BOOLEAN _o_result; BOOLEAN ok, xCharArr, yCharArr; - xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__39_s->f == 10; - yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__39_s->g == 10; - if ((((xCharArr && *Op__39_s->g == 3)) && (*y)->class == 7)) { + xCharArr = (__IN((*x)->typ->comp, 0x0c) && (*x)->typ->BaseTyp->form == 3) || *Op__40_s->f == 10; + yCharArr = (__IN((*y)->typ->comp, 0x0c) && (*y)->typ->BaseTyp->form == 3) || *Op__40_s->g == 10; + if ((((xCharArr && *Op__40_s->g == 3)) && (*y)->class == 7)) { OPB_CharToString(*y); - *Op__39_s->g = 10; + *Op__40_s->g = 10; yCharArr = 1; } - if ((((yCharArr && *Op__39_s->f == 3)) && (*x)->class == 7)) { + if ((((yCharArr && *Op__40_s->f == 3)) && (*x)->class == 7)) { OPB_CharToString(*x); - *Op__39_s->f = 10; + *Op__40_s->f = 10; xCharArr = 1; } ok = (xCharArr && yCharArr); if (ok) { - if ((*Op__39_s->f == 10 && (*x)->conval->intval2 == 1)) { + if ((*Op__40_s->f == 10 && (*x)->conval->intval2 == 1)) { (*x)->typ = OPT_chartyp; (*x)->conval->intval = 0; OPB_Index(&*y, OPB_NewIntConst(((LONGINT)(0)))); - } else if ((*Op__39_s->g == 10 && (*y)->conval->intval2 == 1)) { + } else if ((*Op__40_s->g == 10 && (*y)->conval->intval2 == 1)) { (*y)->typ = OPT_chartyp; (*y)->conval->intval = 0; OPB_Index(&*x, OPB_NewIntConst(((LONGINT)(0)))); @@ -1256,11 +1297,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPT_Struct typ = NIL; BOOLEAN do_; LONGINT val; - struct Op__39 _s; + struct Op__40 _s; _s.f = &f; _s.g = &g; - _s.lnk = Op__39_s; - Op__39_s = &_s; + _s.lnk = Op__40_s; + Op__40_s = &_s; z = *x; if (((z->class == 8 || z->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); @@ -1372,7 +1413,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 2: @@ -1391,7 +1432,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(102); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 3: do_ = 1; @@ -1414,7 +1455,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 4: @@ -1432,7 +1473,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(104); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 5: if (f == 2) { @@ -1442,7 +1483,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(94); @@ -1465,7 +1506,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } if (do_) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 7: @@ -1474,7 +1515,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) typ = OPT_undftyp; } if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } break; case 8: @@ -1485,7 +1526,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } else if ((y->class == 7 && !OPB_IntToBool(y->conval->intval))) { } else { - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); } } else if (f != 0) { OPB_err(95); @@ -1493,16 +1534,16 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 9: case 10: - if (__IN(f, 0x6bff) || strings__42(&z, &y)) { + if (__IN(f, 0x6bff) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPB_err(107); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; case 11: case 12: case 13: case 14: - if (__IN(f, 0x01f9) || strings__42(&z, &y)) { + if (__IN(f, 0x01f9) || strings__43(&z, &y)) { typ = OPT_booltyp; } else { OPM_LogWLn(); @@ -1511,7 +1552,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(108); typ = OPT_undftyp; } - NewOp__40(op, typ, &z, y); + NewOp__41(op, typ, &z, y); break; default: OPM_LogWStr((CHAR*)"unhandled case in OPB.Op, op = ", (LONGINT)32); @@ -1521,7 +1562,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } } *x = z; - Op__39_s = _s.lnk; + Op__40_s = _s.lnk; } void OPB_SetRange (OPT_Node *x, OPT_Node y) @@ -1614,7 +1655,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!__IN(g, 0x1a)) { + if (!((__IN(g, 0x7a) && y->size == 1))) { OPB_err(113); } break; @@ -1726,23 +1767,6 @@ static void OPB_CheckLeaf (OPT_Node x, BOOLEAN dynArrToo) { } -static LONGINT OPB_SignedMaximum (LONGINT bytecount) -{ - LONGINT _o_result; - LONGINT result; - result = 1; - result = __LSH(result, __ASHL(bytecount, 3) - 1, LONGINT); - _o_result = result - 1; - return _o_result; -} - -static LONGINT OPB_SignedMinimum (LONGINT bytecount) -{ - LONGINT _o_result; - _o_result = -OPB_SignedMaximum(bytecount) - 1; - return _o_result; -} - void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) { INTEGER f; @@ -1890,10 +1914,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 5) { - OPB_Convert(&x, OPT_sinttyp); - } else if (f == 6) { - OPB_Convert(&x, OPT_inttyp); + } else if ((__IN(f, 0x70) && x->typ->size > (LONGINT)OPM_SIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_ShorterSize(x->typ->size))); } else if (f == 8) { OPB_Convert(&x, OPT_realtyp); } else { @@ -1903,10 +1925,8 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (f == 4) { - OPB_Convert(&x, OPT_inttyp); - } else if (f == 5) { - OPB_Convert(&x, OPT_linttyp); + } else if ((__IN(f, 0x70) && x->typ->size < (LONGINT)OPM_LIntSize)) { + OPB_Convert(&x, OPB_IntType(OPB_LongerSize(x->typ->size))); } else if (f == 7) { OPB_Convert(&x, OPT_lrltyp); } else if (f == 3) { @@ -1954,7 +1974,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - if (f != 6) { + if (x->typ->size != (LONGINT)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } } else { @@ -1992,9 +2012,9 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 24: case 25: case 28: case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2043,13 +2063,13 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) *par0 = x; } -static struct StPar1__56 { - struct StPar1__56 *lnk; -} *StPar1__56_s; +static struct StPar1__58 { + struct StPar1__58 *lnk; +} *StPar1__58_s; -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right); -static OPT_Node NewOp__57 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) +static OPT_Node NewOp__59 (SHORTINT class, SHORTINT subcl, OPT_Node left, OPT_Node right) { OPT_Node _o_result; OPT_Node node = NIL; @@ -2066,9 +2086,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) INTEGER f, L; OPT_Struct typ = NIL; OPT_Node p = NIL, t = NIL; - struct StPar1__56 _s; - _s.lnk = StPar1__56_s; - StPar1__56_s = &_s; + struct StPar1__58 _s; + _s.lnk = StPar1__58_s; + StPar1__58_s = &_s; p = *par0; f = x->typ->form; switch (fctno) { @@ -2084,7 +2104,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); p->typ = OPT_notyp; } break; @@ -2095,7 +2115,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (LONGINT)OPM_MaxSet))) { OPB_err(202); } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2120,7 +2140,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p = p->left; x->conval->intval += 1; } - p = NewOp__57(12, 19, p, x); + p = NewOp__59(12, 19, p, x); p->typ = OPT_linttyp; } else { p = x; @@ -2142,7 +2162,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) t = x; x = p; p = t; - p = NewOp__57(19, 18, p, x); + p = NewOp__59(19, 18, p, x); } else { OPB_err(111); } @@ -2168,7 +2188,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) } p->obj = NIL; } else { - p = NewOp__57(12, 17, p, x); + p = NewOp__59(12, 17, p, x); p->typ = OPT_linttyp; } } else { @@ -2199,9 +2219,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) OPB_err(111); } else { if (fctno == 22) { - p = NewOp__57(12, 27, p, x); + p = NewOp__59(12, 27, p, x); } else { - p = NewOp__57(12, 28, p, x); + p = NewOp__59(12, 28, p, x); } p->typ = p->left->typ; } @@ -2218,7 +2238,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) x = p; p = t; } - p = NewOp__57(19, fctno, p, x); + p = NewOp__59(19, fctno, p, x); } else { OPB_err(111); } @@ -2228,7 +2248,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(12, 26, p, x); + p = NewOp__59(12, 26, p, x); } else { OPB_err(111); } @@ -2252,7 +2272,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (__IN(f, 0x70)) { - p = NewOp__57(19, 30, p, x); + p = NewOp__59(19, 30, p, x); } else { OPB_err(111); } @@ -2261,9 +2281,9 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 31: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if ((x->class == 7 && __IN(f, 0x30))) { + } else if ((((x->class == 7 && __IN(f, 0x70))) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!__IN(f, 0x2040)) { + } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (LONGINT)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } @@ -2298,7 +2318,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) break; } *par0 = p; - StPar1__56_s = _s.lnk; + StPar1__58_s = _s.lnk; } void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) @@ -2417,7 +2437,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa ftyp = ftyp->BaseTyp; atyp = atyp->BaseTyp; if ((fvarpar && ftyp == OPT_bytetyp)) { - if (!__IN(f, 0x0c) || !__IN(atyp->form, 0x1e)) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x7e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2500,7 +2520,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp) OPB_err(111); } } else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) { - } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && __IN(ap->typ->form, 0x18))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x7e) && ap->typ->size == 1)))))) { OPB_err(123); } else if ((fp->typ->form == 13 && ap->class == 5)) { OPB_err(123); diff --git a/bootstrap/windows-88/OPB.h b/bootstrap/windows-88/OPB.h index f5706dd7..6e90fcf5 100644 --- a/bootstrap/windows-88/OPB.h +++ b/bootstrap/windows-88/OPB.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 efe720a3..b286807f 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/OPC.h b/bootstrap/windows-88/OPC.h index eec830f1..1b09dedc 100644 --- a/bootstrap/windows-88/OPC.h +++ b/bootstrap/windows-88/OPC.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 092edf6c..27de68da 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" @@ -552,10 +552,7 @@ void OPM_FPrintReal (LONGINT *fp, REAL real) void OPM_FPrintLReal (LONGINT *fp, LONGREAL lr) { LONGINT l, h; - __GET((LONGINT)(uintptr_t)&lr, l, LONGINT); - __GET((LONGINT)(uintptr_t)&lr + 4, h, LONGINT); - OPM_FPrint(&*fp, l); - OPM_FPrint(&*fp, h); + OPM_FPrint(&*fp, __VAL(LONGINT, lr)); } static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONGINT name__len, INTEGER *size, INTEGER *align) diff --git a/bootstrap/windows-88/OPM.h b/bootstrap/windows-88/OPM.h index 18397e74..78d88d0b 100644 --- a/bootstrap/windows-88/OPM.h +++ b/bootstrap/windows-88/OPM.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 f69a1750..8c5428b2 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPB.h" diff --git a/bootstrap/windows-88/OPP.h b/bootstrap/windows-88/OPP.h index 6e42de59..04840f08 100644 --- a/bootstrap/windows-88/OPP.h +++ b/bootstrap/windows-88/OPP.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 57b90bad..5196bbd6 100644 --- a/bootstrap/windows-88/OPS.c +++ b/bootstrap/windows-88/OPS.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin tspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPS.h b/bootstrap/windows-88/OPS.h index b2d2cf55..b4346886 100644 --- a/bootstrap/windows-88/OPS.h +++ b/bootstrap/windows-88/OPS.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin tspkaSfF */ +/* voc 1.95 [2016/08/20] 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 371d31a9..365abe0b 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPM.h" diff --git a/bootstrap/windows-88/OPT.h b/bootstrap/windows-88/OPT.h index 343a6059..4fe1b205 100644 --- a/bootstrap/windows-88/OPT.h +++ b/bootstrap/windows-88/OPT.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef OPT__h #define OPT__h diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index f5d943cd..5c482eb4 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "OPC.h" @@ -964,11 +964,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } OPV_expr(l, exprPrec); } else { - if (__IN(n->typ->form, 0x6000) || __IN(l->typ->form, 0x6000)) { - OPM_WriteString((CHAR*)"__VALP(", (LONGINT)8); - } else { - OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); - } + OPM_WriteString((CHAR*)"__VAL(", (LONGINT)7); OPC_Ident(n->typ->strobj); OPM_WriteString((CHAR*)", ", (LONGINT)3); OPV_expr(l, -1); diff --git a/bootstrap/windows-88/OPV.h b/bootstrap/windows-88/OPV.h index b10b4265..349e3d10 100644 --- a/bootstrap/windows-88/OPV.h +++ b/bootstrap/windows-88/OPV.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 662ebee0..9305e613 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Platform.h b/bootstrap/windows-88/Platform.h index da294adf..72eceb25 100644 --- a/bootstrap/windows-88/Platform.h +++ b/bootstrap/windows-88/Platform.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 f38e5bd8..e42135a4 100644 --- a/bootstrap/windows-88/Reals.c +++ b/bootstrap/windows-88/Reals.c @@ -1,16 +1,18 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len); export void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); export void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -export void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +export void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); export void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); export INTEGER Reals_Expo (REAL x); export INTEGER Reals_ExpoL (LONGREAL x); +export void Reals_SetExpo (REAL *x, INTEGER ex); export REAL Reals_Ten (INTEGER e); export LONGREAL Reals_TenL (INTEGER e); static CHAR Reals_ToHex (INTEGER i); @@ -56,17 +58,27 @@ LONGREAL Reals_TenL (INTEGER e) INTEGER Reals_Expo (REAL x) { INTEGER _o_result; - _o_result = (int)__MASK(__ASHR((LONGINT)(__VAL(INTEGER, x)), 23), -256); + INTEGER i; + __GET((LONGINT)(uintptr_t)&x + 2, i, INTEGER); + _o_result = __MASK(__ASHR(i, 7), -256); return _o_result; } +void Reals_SetExpo (REAL *x, INTEGER ex) +{ + CHAR c; + __GET((LONGINT)(uintptr_t)x + 3, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 3, (CHAR)(__ASHL(__ASHR((int)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __GET((LONGINT)(uintptr_t)x + 2, c, CHAR); + __PUT((LONGINT)(uintptr_t)x + 2, (CHAR)(__MASK((int)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); +} + INTEGER Reals_ExpoL (LONGREAL x) { INTEGER _o_result; INTEGER i; - LONGINT l; - __GET((LONGINT)(uintptr_t)&x + 4, i, INTEGER); - _o_result = (int)__MASK(__ASHR((LONGINT)i, 20), -2048); + __GET((LONGINT)(uintptr_t)&x + 6, i, INTEGER); + _o_result = __MASK(__ASHR(i, 4), -2048); return _o_result; } @@ -103,34 +115,29 @@ static CHAR Reals_ToHex (INTEGER i) __RETCHK; } -typedef - CHAR (*pc4__3)[4]; - -void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) +static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LONGINT d__len) { - pc4__3 p = NIL; INTEGER i; - p = (pc4__3)(uintptr_t)((LONGINT)(uintptr_t)&y); + LONGINT l; + CHAR by; i = 0; - while (i < 4) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(4)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(4)))], -16)); + l = b__len; + while ((LONGINT)i < l) { + by = __VAL(CHAR, b[__X(i, b__len)]); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)by, -16)); + i += 1; } } -typedef - CHAR (*pc8__5)[8]; - -void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len) +void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len) { - pc8__5 p = NIL; - INTEGER i; - p = (pc8__5)(uintptr_t)((LONGINT)(uintptr_t)&y); - i = 0; - while (i < 8) { - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((int)(*p)[__X(i, ((LONGINT)(8)))], 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((int)(*p)[__X(i, ((LONGINT)(8)))], -16)); - } + Reals_BytesToHex((void*)&y, ((LONGINT)(4)), (void*)d, d__len * ((LONGINT)(1))); +} + +void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len) +{ + Reals_BytesToHex((void*)&x, ((LONGINT)(8)), (void*)d, d__len * ((LONGINT)(1))); } diff --git a/bootstrap/windows-88/Reals.h b/bootstrap/windows-88/Reals.h index 0647106c..3a3a206a 100644 --- a/bootstrap/windows-88/Reals.h +++ b/bootstrap/windows-88/Reals.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef Reals__h #define Reals__h @@ -11,10 +11,11 @@ import void Reals_Convert (REAL x, INTEGER n, CHAR *d, LONGINT d__len); import void Reals_ConvertH (REAL y, CHAR *d, LONGINT d__len); -import void Reals_ConvertHL (LONGREAL y, CHAR *d, LONGINT d__len); +import void Reals_ConvertHL (LONGREAL x, CHAR *d, LONGINT d__len); import void Reals_ConvertL (LONGREAL x, INTEGER n, CHAR *d, LONGINT d__len); import INTEGER Reals_Expo (REAL x); import INTEGER Reals_ExpoL (LONGREAL x); +import void Reals_SetExpo (REAL *x, INTEGER ex); import REAL Reals_Ten (INTEGER e); import LONGREAL Reals_TenL (INTEGER e); import void *Reals__init(void); diff --git a/bootstrap/windows-88/SYSTEM.h b/bootstrap/windows-88/SYSTEM.h index 394407bd..7ea8b8de 100644 --- a/bootstrap/windows-88/SYSTEM.h +++ b/bootstrap/windows-88/SYSTEM.h @@ -134,10 +134,7 @@ static int __str_cmp(CHAR *x, CHAR *y){ /* SYSTEM ops */ -//#define __VAL(t, x) ((t)(x)) -//#define __VALP(t, x) ((t)(uintptr_t)(x)) #define __VAL(t, x) (*(t*)&(x)) -#define __VALP(t, x) (*(t*)&(x)) #define __GET(a, x, t) x= *(t*)(uintptr_t)(a) diff --git a/bootstrap/windows-88/Strings.c b/bootstrap/windows-88/Strings.c index a1b5c956..b64d7db9 100644 --- a/bootstrap/windows-88/Strings.c +++ b/bootstrap/windows-88/Strings.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/Strings.h b/bootstrap/windows-88/Strings.h index 29cd1c88..68433fb9 100644 --- a/bootstrap/windows-88/Strings.h +++ b/bootstrap/windows-88/Strings.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 fa9a1311..a3432709 100644 --- a/bootstrap/windows-88/Texts.c +++ b/bootstrap/windows-88/Texts.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Files.h" diff --git a/bootstrap/windows-88/Texts.h b/bootstrap/windows-88/Texts.h index 240b0acb..a86b8717 100644 --- a/bootstrap/windows-88/Texts.h +++ b/bootstrap/windows-88/Texts.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 bc48ed60..b889aad9 100644 --- a/bootstrap/windows-88/Vishap.c +++ b/bootstrap/windows-88/Vishap.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkamSf */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkamSf */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/errors.c b/bootstrap/windows-88/errors.c index 4911b020..98e42790 100644 --- a/bootstrap/windows-88/errors.c +++ b/bootstrap/windows-88/errors.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" diff --git a/bootstrap/windows-88/errors.h b/bootstrap/windows-88/errors.h index 571c65b9..314ab2dc 100644 --- a/bootstrap/windows-88/errors.h +++ b/bootstrap/windows-88/errors.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 6865568d..8a238c7f 100644 --- a/bootstrap/windows-88/extTools.c +++ b/bootstrap/windows-88/extTools.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Configuration.h" diff --git a/bootstrap/windows-88/extTools.h b/bootstrap/windows-88/extTools.h index 88620668..359df725 100644 --- a/bootstrap/windows-88/extTools.h +++ b/bootstrap/windows-88/extTools.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] 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 e668fc2c..99663386 100644 --- a/bootstrap/windows-88/vt100.c +++ b/bootstrap/windows-88/vt100.c @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #define LARGE #include "SYSTEM.h" #include "Console.h" diff --git a/bootstrap/windows-88/vt100.h b/bootstrap/windows-88/vt100.h index 15d39b23..94b58ced 100644 --- a/bootstrap/windows-88/vt100.h +++ b/bootstrap/windows-88/vt100.h @@ -1,4 +1,4 @@ -/* voc 1.95 [2016/08/16] for gcc LP64 on cygwin xtspkaSfF */ +/* voc 1.95 [2016/08/20] for gcc LP64 on cygwin xtspkaSfF */ #ifndef vt100__h #define vt100__h diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index ebc1aaf9..2f6d8b84 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -106,19 +106,37 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END EmptySet; + (* Integer size support *) + + PROCEDURE SignedMaximum(bytecount: LONGINT): LONGINT; + VAR result: LONGINT; + BEGIN + result := 1; + result := SYSTEM.LSH(result, bytecount*8-1); + RETURN result - 1; + END SignedMaximum; + + PROCEDURE SignedMinimum(bytecount: LONGINT): LONGINT; + BEGIN RETURN -SignedMaximum(bytecount) - 1 + END SignedMinimum; + PROCEDURE SignedByteSize(n: LONGINT): INTEGER; (* Returns number of bytes required to represent signed value n *) VAR b: INTEGER; BEGIN - IF n < 0 THEN n := -(n+1) END; (* Positive value in the range 0 - 7F..FF *) - b := 1; - WHILE b < 8 DO - IF ASH(n, -(8*b-1)) = 0 THEN RETURN b END; - INC(b); - END; - RETURN 8 + IF n < 0 THEN n := -(n+1) END; (* Positive value in the range 0 - 7F.. *) + b := 1; WHILE (b < 8) & (ASH(n, -(8*b-1)) # 0) DO INC(b) END; + RETURN b END SignedByteSize; + PROCEDURE ShorterSize(i: LONGINT): LONGINT; + BEGIN IF i >= OPM.LIntSize THEN RETURN OPM.IntSize ELSE RETURN OPM.SIntSize END + END ShorterSize; + + PROCEDURE LongerSize(i: LONGINT): LONGINT; + BEGIN IF i <= OPM.SIntSize THEN RETURN OPM.IntSize ELSE RETURN OPM.LIntSize END + END LongerSize; + PROCEDURE IntType(size: LONGINT): OPT.Struct; (* Selects smallest standard integer type for given size in bytes *) VAR result: OPT.Struct; @@ -485,35 +503,6 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPM.Char: IF g = OPM.String THEN CharToString(x) ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END ; - (* - |OPM.SInt: IF g IN OPM.intSet THEN x^.typ := y^.typ - ELSIF g = OPM.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval - ELSIF g = OPM.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END - |OPM.Int: IF g = OPM.SInt THEN y^.typ := OPT.inttyp - ELSIF g IN OPM.intSet THEN x^.typ := y^.typ - ELSIF g = OPM.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval - ELSIF g = OPM.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END - |OPM.LInt: IF g IN OPM.intSet THEN y^.typ := OPT.linttyp - ELSIF g = OPM.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval - ELSIF g = OPM.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval - ELSE err(100); y^.typ := x^.typ; yval^ := xval^ - END - - f g x.typ := - SInt SInt y.typ - SInt Int y.typ - SInt Lint y.typ - Int SInt OPT.inttyp - Int Int y.typ - Int Lint y.typ - LInt SInt OPT.linttyp - LInt Int OPT.linttyp - LInt Lint OPT.linttyp - *) |OPM.SInt, OPM.Int, OPM.LInt: IF g IN OPM.intSet THEN @@ -522,8 +511,6 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF g = OPM.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END - - |OPM.Real: IF g IN OPM.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval ELSIF g = OPM.LReal THEN x^.typ := OPT.lrltyp ELSE err(100); y^.typ := x^.typ; yval^ := xval^ @@ -721,37 +708,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g := y^.typ^.form; CASE z^.typ^.form OF |OPM.Char: IF z^.class = OPM.Nconst THEN CharToString(z) ELSE err(100) END - - (* - |OPM.SInt: IF g IN OPM.intSet + OPM.realSet THEN Convert(z, y^.typ) - ELSE err(100) - END - |OPM.Int: IF g = OPM.SInt THEN Convert(y, z^.typ) - ELSIF g IN OPM.intSet + OPM.realSet THEN Convert(z, y^.typ) - ELSE err(100) - END - |OPM.LInt: IF g IN OPM.intSet THEN Convert(y, z^.typ) - ELSIF g IN OPM.realSet THEN Convert(z, y^.typ) - ELSE err(100) - END - x.typ y.typ Conversion - SInt SInt Convert(z, y.typ) - SInt Int Convert(z, y.typ) - SInt Lint Convert(z, y.typ) - Int SInt Convert(y, z.typ) - Int Int Convert(z, y.typ) - Int Lint Convert(z, y.typ) - LInt SInt Convert(y, z.typ) - LInt Int Convert(y, z.typ) - LInt Lint Convert(y, z.typ) - *) |OPM.SInt, OPM.Int, OPM.LInt: IF (g IN OPM.intSet) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) ELSIF g IN OPM.intSet + OPM.realSet THEN Convert(z, y.typ) ELSE err(100) END - |OPM.Real: IF g IN OPM.intSet THEN Convert(y, z^.typ) ELSIF g IN OPM.realSet THEN Convert(z, y^.typ) ELSE err(100) @@ -932,8 +894,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPM.Undef, OPM.String: - | OPM.Byte: IF ~( (g IN {OPM.Byte, OPM.Char}) - OR ((g IN OPM.intSet) & (y.size = 1))) THEN err(113) END + | OPM.Byte: IF ~((g IN ({OPM.Byte, OPM.Char} + OPM.intSet)) & (y.size = 1)) THEN err(113) END | OPM.Bool, OPM.Char, OPM.Set: IF g # f THEN err(113) END @@ -1002,29 +963,6 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) *) END CheckLeaf; - - PROCEDURE SignedMaximum(bytecount: LONGINT): LONGINT; - VAR result: LONGINT; - BEGIN - result := 1; - result := SYSTEM.LSH(result, bytecount*8-1); - RETURN result - 1; - END SignedMaximum; - - PROCEDURE SignedMinimum(bytecount: LONGINT): LONGINT; - BEGIN RETURN -SignedMaximum(bytecount) - 1 - END SignedMinimum; - - PROCEDURE ByteSized(typ: OPT.Struct): BOOLEAN; - BEGIN RETURN (typ.form IN {OPM.Byte..OPM.Char}) - OR (typ.form IN OPM.intSet) & (typ.size = 1); - END ByteSized; - - PROCEDURE PointerSized(typ: OPT.Struct): BOOLEAN; - BEGIN RETURN (typ.form = OPM.Pointer) - OR (typ.form IN OPM.intSet) & (typ.size = OPM.PointerSize) - END PointerSized; - PROCEDURE StPar0*(VAR par0: OPT.Node; fctno: INTEGER); (* par0: first param of standard proc *) VAR f: INTEGER; typ: OPT.Struct; x: OPT.Node; BEGIN x := par0; f := x^.typ^.form; @@ -1108,15 +1046,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPM.shortfn: (*SHORT*) IF (x^.class = OPM.Ntype) OR (x^.class = OPM.Nproc) THEN err(126) - ELSIF f = OPM.Int THEN Convert(x, OPT.sinttyp) - ELSIF f = OPM.LInt THEN Convert(x, OPT.inttyp) + ELSIF (f IN OPM.intSet) & (x.typ.size > OPM.SIntSize) THEN Convert(x, IntType(ShorterSize(x.typ.size))) ELSIF f = OPM.LReal THEN Convert(x, OPT.realtyp) ELSE err(111) END |OPM.longfn: (*LONG*) IF (x^.class = OPM.Ntype) OR (x^.class = OPM.Nproc) THEN err(126) - ELSIF f = OPM.SInt THEN Convert(x, OPT.inttyp) - ELSIF f = OPM.Int THEN Convert(x, OPT.linttyp) + ELSIF (f IN OPM.intSet) & (x.typ.size < OPM.LIntSize) THEN Convert(x, IntType(LongerSize(x.typ.size))) ELSIF f = OPM.Real THEN Convert(x, OPT.lrltyp) ELSIF f = OPM.Char THEN Convert(x, OPT.linttyp) ELSE err(111) @@ -1169,7 +1105,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) OPM.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPM.Ntype) OR (x^.class = OPM.Nproc) THEN err(126) ELSIF (x^.class = OPM.Nconst) & (f IN OPM.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~PointerSized(x.typ) THEN err(111); x^.typ := OPT.linttyp + ELSIF ~((x.typ.form IN {OPM.Pointer} + OPM.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp END |OPM.getrfn, OPM.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) @@ -1337,8 +1273,8 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPM.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPM.Ntype) OR (x^.class = OPM.Nproc) THEN err(126) ELSIF (x^.class = OPM.Nconst) & (f IN OPM.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~(PointerSized(x.typ)) THEN err(111); x^.typ := OPT.linttyp - END ; + ELSIF ~((x.typ.form IN {OPM.Pointer} + OPM.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + END; p^.link := x |OPM.assertfn: (*ASSERT*) IF (f IN OPM.intSet) & (x^.class = OPM.Nconst) THEN @@ -1433,7 +1369,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN (* ftyp^.comp = OPM.DynArr *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) - IF ~(f IN {OPM.Array, OPM.DynArr}) OR ~(ByteSized(atyp)) THEN + IF ~(f IN {OPM.Array, OPM.DynArr}) OR ~((atyp.form IN {OPM.Byte..OPM.Char} + OPM.intSet) & (atyp.size = 1)) THEN IF OPM.verbose IN OPM.opt THEN err(-301) END END ELSIF f IN {OPM.Array, OPM.DynArr} THEN @@ -1486,7 +1422,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ; IF q = NIL THEN err(111) END ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPM.Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPM.Byte) & (ByteSized(ap.typ))) THEN err(123) + ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPM.Byte) & ((ap.typ.form IN {OPM.Byte..OPM.Char} + OPM.intSet) & (ap.typ.size = 1))) THEN err(123) ELSIF (fp^.typ^.form = OPM.Pointer) & (ap^.class = OPM.Nguard) THEN err(123) END ELSIF fp^.typ^.comp = OPM.DynArr THEN