From a1fd798f6d63622063833360e19ed5be8e082217 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 31 Aug 2016 18:33:53 +0100 Subject: [PATCH] Remove all use of forms SInt and LInt and remove intSet using just Int instead. --- bootstrap/unix-44/Files.c | 16 ++-- bootstrap/unix-44/Heap.c | 16 ++-- bootstrap/unix-44/OPB.c | 146 ++++++++++++++++---------------- bootstrap/unix-44/OPC.c | 18 ++-- bootstrap/unix-44/OPM.c | 22 ++--- bootstrap/unix-44/OPP.c | 26 +++--- bootstrap/unix-44/OPS.c | 6 +- bootstrap/unix-44/OPT.c | 30 +++---- bootstrap/unix-44/OPV.c | 20 ++--- bootstrap/unix-44/Platform.c | 8 +- bootstrap/unix-44/Reals.c | 8 +- bootstrap/unix-44/Strings.c | 2 +- bootstrap/unix-44/Texts.c | 22 ++--- bootstrap/unix-48/Files.c | 16 ++-- bootstrap/unix-48/Heap.c | 16 ++-- bootstrap/unix-48/OPB.c | 146 ++++++++++++++++---------------- bootstrap/unix-48/OPC.c | 18 ++-- bootstrap/unix-48/OPM.c | 22 ++--- bootstrap/unix-48/OPP.c | 26 +++--- bootstrap/unix-48/OPS.c | 6 +- bootstrap/unix-48/OPT.c | 30 +++---- bootstrap/unix-48/OPV.c | 20 ++--- bootstrap/unix-48/Platform.c | 8 +- bootstrap/unix-48/Reals.c | 8 +- bootstrap/unix-48/Strings.c | 2 +- bootstrap/unix-48/Texts.c | 22 ++--- bootstrap/unix-88/Files.c | 4 +- bootstrap/unix-88/Heap.c | 16 ++-- bootstrap/unix-88/OPB.c | 140 +++++++++++++++--------------- bootstrap/unix-88/OPC.c | 4 +- bootstrap/unix-88/OPM.c | 6 +- bootstrap/unix-88/OPP.c | 20 ++--- bootstrap/unix-88/OPT.c | 16 ++-- bootstrap/unix-88/OPV.c | 14 +-- bootstrap/unix-88/Platform.c | 4 +- bootstrap/windows-48/Files.c | 16 ++-- bootstrap/windows-48/Heap.c | 16 ++-- bootstrap/windows-48/OPB.c | 146 ++++++++++++++++---------------- bootstrap/windows-48/OPC.c | 18 ++-- bootstrap/windows-48/OPM.c | 22 ++--- bootstrap/windows-48/OPP.c | 26 +++--- bootstrap/windows-48/OPS.c | 6 +- bootstrap/windows-48/OPT.c | 30 +++---- bootstrap/windows-48/OPV.c | 20 ++--- bootstrap/windows-48/Platform.c | 8 +- bootstrap/windows-48/Reals.c | 8 +- bootstrap/windows-48/Strings.c | 2 +- bootstrap/windows-48/Texts.c | 22 ++--- bootstrap/windows-88/Files.c | 4 +- bootstrap/windows-88/Heap.c | 16 ++-- bootstrap/windows-88/OPB.c | 140 +++++++++++++++--------------- bootstrap/windows-88/OPC.c | 4 +- bootstrap/windows-88/OPM.c | 6 +- bootstrap/windows-88/OPP.c | 20 ++--- bootstrap/windows-88/OPT.c | 16 ++-- bootstrap/windows-88/OPV.c | 14 +-- bootstrap/windows-88/Platform.c | 4 +- src/compiler/OPB.Mod | 146 +++++++++++++++----------------- src/compiler/OPC.Mod | 8 +- src/compiler/OPP.Mod | 18 ++-- src/compiler/OPT.Mod | 29 +++---- src/compiler/OPV.Mod | 20 ++--- 62 files changed, 828 insertions(+), 861 deletions(-) diff --git a/bootstrap/unix-44/Files.c b/bootstrap/unix-44/Files.c index 05991786..a6db1a11 100644 --- a/bootstrap/unix-44/Files.c +++ b/bootstrap/unix-44/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-44/Heap.c b/bootstrap/unix-44/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/unix-44/Heap.c +++ b/bootstrap/unix-44/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-44/OPB.c b/bootstrap/unix-44/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/unix-44/OPB.c +++ b/bootstrap/unix-44/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,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, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,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, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && 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/OPC.c b/bootstrap/unix-44/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/unix-44/OPC.c +++ b/bootstrap/unix-44/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-44/OPM.c b/bootstrap/unix-44/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/unix-44/OPM.c +++ b/bootstrap/unix-44/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/unix-44/OPP.c b/bootstrap/unix-44/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/unix-44/OPP.c +++ b/bootstrap/unix-44/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-44/OPS.c b/bootstrap/unix-44/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/unix-44/OPS.c +++ b/bootstrap/unix-44/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-44/OPT.c b/bootstrap/unix-44/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/unix-44/OPT.c +++ b/bootstrap/unix-44/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-44/OPV.c b/bootstrap/unix-44/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/unix-44/OPV.c +++ b/bootstrap/unix-44/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-44/Platform.c b/bootstrap/unix-44/Platform.c index 6ff2920b..2508f6f7 100644 --- a/bootstrap/unix-44/Platform.c +++ b/bootstrap/unix-44/Platform.c @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/unix-44/Reals.c b/bootstrap/unix-44/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/unix-44/Reals.c +++ b/bootstrap/unix-44/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-44/Strings.c b/bootstrap/unix-44/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/unix-44/Strings.c +++ b/bootstrap/unix-44/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-44/Texts.c b/bootstrap/unix-44/Texts.c index 58a4ec95..e473e702 100644 --- a/bootstrap/unix-44/Texts.c +++ b/bootstrap/unix-44/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-48/Files.c b/bootstrap/unix-48/Files.c index 05991786..a6db1a11 100644 --- a/bootstrap/unix-48/Files.c +++ b/bootstrap/unix-48/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-48/Heap.c b/bootstrap/unix-48/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/unix-48/Heap.c +++ b/bootstrap/unix-48/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-48/OPB.c b/bootstrap/unix-48/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/unix-48/OPB.c +++ b/bootstrap/unix-48/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,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, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,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, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && 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/OPC.c b/bootstrap/unix-48/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/unix-48/OPC.c +++ b/bootstrap/unix-48/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-48/OPM.c b/bootstrap/unix-48/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/unix-48/OPM.c +++ b/bootstrap/unix-48/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/unix-48/OPP.c b/bootstrap/unix-48/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/unix-48/OPP.c +++ b/bootstrap/unix-48/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-48/OPS.c b/bootstrap/unix-48/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/unix-48/OPS.c +++ b/bootstrap/unix-48/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/unix-48/OPT.c b/bootstrap/unix-48/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/unix-48/OPT.c +++ b/bootstrap/unix-48/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-48/OPV.c b/bootstrap/unix-48/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/unix-48/OPV.c +++ b/bootstrap/unix-48/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-48/Platform.c b/bootstrap/unix-48/Platform.c index 6ff2920b..2508f6f7 100644 --- a/bootstrap/unix-48/Platform.c +++ b/bootstrap/unix-48/Platform.c @@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/unix-48/Reals.c b/bootstrap/unix-48/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/unix-48/Reals.c +++ b/bootstrap/unix-48/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/unix-48/Strings.c b/bootstrap/unix-48/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/unix-48/Strings.c +++ b/bootstrap/unix-48/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/unix-48/Texts.c b/bootstrap/unix-48/Texts.c index 129aa156..bd5d1115 100644 --- a/bootstrap/unix-48/Texts.c +++ b/bootstrap/unix-48/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/unix-88/Files.c b/bootstrap/unix-88/Files.c index 01a8d9ef..5ae22903 100644 --- a/bootstrap/unix-88/Files.c +++ b/bootstrap/unix-88/Files.c @@ -868,7 +868,7 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -959,7 +959,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/unix-88/Heap.c b/bootstrap/unix-88/Heap.c index a8a51e7c..a5063871 100644 --- a/bootstrap/unix-88/Heap.c +++ b/bootstrap/unix-88/Heap.c @@ -328,11 +328,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 24; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/unix-88/OPB.c b/bootstrap/unix-88/OPB.c index c3322a77..fef28dff 100644 --- a/bootstrap/unix-88/OPB.c +++ b/bootstrap/unix-88/OPB.c @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -568,14 +568,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -865,8 +865,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -885,7 +885,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -897,7 +897,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -965,7 +965,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -989,7 +989,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1043,7 +1043,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1248,17 +1248,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1267,7 +1267,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1346,7 +1346,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1584,7 +1584,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1593,18 +1593,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1778,7 +1778,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1809,7 +1809,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,7 +1843,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1859,7 +1859,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,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, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2459,7 +2459,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, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && 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/OPC.c b/bootstrap/unix-88/OPC.c index 57fdcb05..b8a0608e 100644 --- a/bootstrap/unix-88/OPC.c +++ b/bootstrap/unix-88/OPC.c @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1977,7 +1977,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/unix-88/OPM.c b/bootstrap/unix-88/OPM.c index edc81f01..450ed83d 100644 --- a/bootstrap/unix-88/OPM.c +++ b/bootstrap/unix-88/OPM.c @@ -533,12 +533,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/unix-88/OPP.c b/bootstrap/unix-88/OPP.c index c525c696..becc2507 100644 --- a/bootstrap/unix-88/OPP.c +++ b/bootstrap/unix-88/OPP.c @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -269,7 +269,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (SYSTEM_INT8)(*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/unix-88/OPT.c b/bootstrap/unix-88/OPT.c index 5861f882..f8762935 100644 --- a/bootstrap/unix-88/OPT.c +++ b/bootstrap/unix-88/OPT.c @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -650,7 +650,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -851,7 +851,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1538,7 +1538,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1877,7 +1877,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,9 +1905,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/unix-88/OPV.c b/bootstrap/unix-88/OPV.c index 49956ac6..b5cebda5 100644 --- a/bootstrap/unix-88/OPV.c +++ b/bootstrap/unix-88/OPV.c @@ -475,7 +475,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -507,7 +507,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -798,10 +798,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -966,7 +966,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1116,7 +1116,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/unix-88/Platform.c b/bootstrap/unix-88/Platform.c index 6e34dddd..9801d5f9 100644 --- a/bootstrap/unix-88/Platform.c +++ b/bootstrap/unix-88/Platform.c @@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -263,7 +263,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/bootstrap/windows-48/Files.c b/bootstrap/windows-48/Files.c index a0e79aca..08d1739f 100644 --- a/bootstrap/windows-48/Files.c +++ b/bootstrap/windows-48/Files.c @@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x) { CHAR b[2]; Files_ReadBytes(&*R, R__typ, (void*)b, 2, 2); - *x = b[0] + __ASHL(b[1], 8); + *x = (SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8); } void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x) { CHAR b[4]; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - *x = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); } void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) @@ -866,8 +866,8 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) CHAR b[4]; LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); - l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -922,12 +922,12 @@ void Files_ReadNum (Files_Rider *R, LONGINT *R__typ, LONGINT *x) s = 0; n = 0; Files_Read(&*R, R__typ, (void*)&ch); - while (ch >= 128) { - n += __ASH((ch - 128), s); + while ((SYSTEM_INT16)ch >= 128) { + n += __ASH(((SYSTEM_INT16)ch - 128), s); s += 7; Files_Read(&*R, R__typ, (void*)&ch); } - n += __ASH((__MASK(ch, -64) - __ASHL(__ASHR(ch, 6), 6)), s); + n += __ASH((__MASK((SYSTEM_INT16)ch, -64) - __ASHL(__ASHR((SYSTEM_INT16)ch, 6), 6)), s); *x = n; } @@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/windows-48/Heap.c b/bootstrap/windows-48/Heap.c index e42a752c..f35765c6 100644 --- a/bootstrap/windows-48/Heap.c +++ b/bootstrap/windows-48/Heap.c @@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 31, 4), 4); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 12; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 12; __PUT(tag - 4, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 4, -4, LONGINT); - __PUT(__VAL(LONGINT, new) - 4, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 4, tagbits + 1, LONGINT); __PUT(q - 4, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -553,7 +553,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -572,7 +572,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -699,7 +699,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-48/OPB.c b/bootstrap/windows-48/OPB.c index 73416071..e6e966a6 100644 --- a/bootstrap/windows-48/OPB.c +++ b/bootstrap/windows-48/OPB.c @@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > OPM_MaxSet) { @@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-2147483647-1)) { OPB_err(203); } else { @@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) case 22: if (f == 3) { if (z->class == 7) { - z->conval->intval = __CAP((CHAR)z->conval->intval); + z->conval->intval = (SYSTEM_INT16)__CAP((CHAR)z->conval->intval); z->obj = NIL; } else { z = NewOp__29(op, typ, z); @@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -864,8 +864,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(2147483647, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-2147483647-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-2147483647-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-2147483647-1))) && yv != (-2147483647-1))) && -xv <= __DIV(2147483647, -yv))) { @@ -964,7 +964,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = (int)__MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) { xval->intval += yval->intval; @@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) } } (*x)->obj = NIL; - } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((*x)->left->typ->form < f || f > g))) { + } else if (((((*x)->class == 11 && (*x)->subcl == 20)) && ((SYSTEM_INT16)(*x)->left->typ->form < f || f > g))) { if ((*x)->left->typ == typ) { *x = (*x)->left; } @@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > OPM_MaxSet) { @@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) { OPB_err(202); } @@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { - L = x->conval->intval; + L = (SYSTEM_INT16)x->conval->intval; typ = p->typ; while ((L > 0 && __IN(typ->comp, 0x0c))) { typ = typ->BaseTyp; @@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2137,7 +2137,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2219,16 +2219,16 @@ 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2287,7 +2287,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2375,7 +2375,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, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2458,7 +2458,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, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && 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/OPC.c b/bootstrap/windows-48/OPC.c index 494d985f..45784a13 100644 --- a/bootstrap/windows-48/OPC.c +++ b/bootstrap/windows-48/OPC.c @@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len) i = 0; h = 0; while ((s[__X(i, s__len)] != 0x00 && i < 5)) { - h = 3 * h + s[__X(i, s__len)]; + h = 3 * h + (SYSTEM_INT16)s[__X(i, s__len)]; i += 1; } _o_result = (int)__MOD(h, 105); @@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) INTEGER _for__9; if (obj != NIL) { OPC_CProcDefs(obj->left, vis); - if ((((obj->mode == 9 && obj->vis >= vis)) && obj->adr == 1)) { + if ((((obj->mode == 9 && (SYSTEM_INT16)obj->vis >= vis)) && obj->adr == 1)) { ext = obj->conval->ext; i = 1; if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) { @@ -768,7 +768,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis) OPC_DeclareParams(obj->link, 1); OPM_Write(0x09); } - _for__9 = (*obj->conval->ext)[0]; + _for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0]; i = i; while (i <= _for__9) { OPM_Write((*obj->conval->ext)[__X(i, 256)]); @@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis) first = 1; while ((obj != NIL && obj->mode != 13)) { if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) { - if (obj->typ != base || obj->vis != lastvis) { + if (obj->typ != base || (SYSTEM_INT16)obj->vis != lastvis) { if (!first) { OPC_EndStat(); } @@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis) { if (obj != NIL) { OPC_IncludeImports(obj->left, vis); - if ((((obj->mode == 11 && obj->mnolev != 0)) && OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { + if ((((obj->mode == 11 && obj->mnolev != 0)) && (SYSTEM_INT16)OPT_GlbMod[__X(-obj->mnolev, 64)]->vis >= vis)) { OPC_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256); } OPC_IncludeImports(obj->right, vis); @@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap) INTEGER i; __ASSERT(ap->typ->comp == 4, 0); if (ap->mode == 2) { - if (ap->mnolev != OPM_level) { + if ((SYSTEM_INT16)ap->mnolev != OPM_level) { OPM_WriteStringVar((void*)ap->scope->name, 256); OPM_WriteString((CHAR*)"_s->", 5); OPC_Ident(ap); @@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l) OPM_Write('"'); i = 0; while (i < l) { - c = s[__X(i, s__len)]; + c = (SYSTEM_INT16)s[__X(i, s__len)]; if (c < 32 || c > 126) { OPM_Write('\\'); OPM_Write((CHAR)(48 + __ASHR(c, 6))); @@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/windows-48/OPM.c b/bootstrap/windows-48/OPM.c index c3bece55..979d9598 100644 --- a/bootstrap/windows-48/OPM.c +++ b/bootstrap/windows-48/OPM.c @@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt) case 'B': if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_IntSize = s[__X(i, s__len)] - 48; + OPM_IntSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_PointerSize = s[__X(i, s__len)] - 48; + OPM_PointerSize = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } if (s[__X(i + 1, s__len)] != 0x00) { i += 1; - OPM_Alignment = s[__X(i, s__len)] - 48; + OPM_Alignment = (SYSTEM_INT16)s[__X(i, s__len)] - 48; } __ASSERT(OPM_IntSize == 2 || OPM_IntSize == 4, 0); __ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0); @@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos) if (pos >= OPM_ErrorLineLimitPos) { pos = OPM_ErrorLineLimitPos - 1; } - i = (pos - OPM_ErrorLineStartPos); + i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos); while (i > 0) { OPM_LogW(' '); i -= 1; @@ -532,12 +532,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -563,13 +563,13 @@ static void OPM_GetProperty (Texts_Scanner *S, LONGINT *S__typ, CHAR *name, LONG if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) { Texts_Scan(&*S, S__typ); if ((*S).class == 3) { - *size = (*S).i; + *size = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); } if ((*S).class == 3) { - *align = (*S).i; + *align = (SYSTEM_INT16)(*S).i; Texts_Scan(&*S, S__typ); } else { OPM_Mark(-157, -1); @@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) @@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i) { CHAR s[3]; INTEGER digit; - digit = __ASHR(i, 4); + digit = __ASHR((SYSTEM_INT16)i, 4); if (digit < 10) { s[0] = (CHAR)(48 + digit); } else { s[0] = (CHAR)(87 + digit); } - digit = __MASK(i, -16); + digit = __MASK((SYSTEM_INT16)i, -16); if (digit < 10) { s[1] = (CHAR)(48 + digit); } else { diff --git a/bootstrap/windows-48/OPP.c b/bootstrap/windows-48/OPP.c index f44a2167..b0e235d3 100644 --- a/bootstrap/windows-48/OPP.c +++ b/bootstrap/windows-48/OPP.c @@ -58,7 +58,7 @@ static void OPP_err (INTEGER n) static void OPP_CheckSym (INTEGER s) { - if (OPP_sym == s) { + if ((SYSTEM_INT16)OPP_sym == s) { OPS_Get(&OPP_sym); } else { OPM_err(s); @@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(51); sf = 0; } - *sysflag = sf; + *sysflag = (SYSTEM_INT16)sf; OPP_CheckSym(23); } else { *sysflag = default_; @@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } - } else if (LabelTyp->form != f) { + } else if ((SYSTEM_INT16)LabelTyp->form != f) { OPP_err(60); } if (OPP_sym == 21) { OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if (((SYSTEM_INT16)y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-48/OPS.c b/bootstrap/windows-48/OPS.c index 2a093f8e..89c8242e 100644 --- a/bootstrap/windows-48/OPS.c +++ b/bootstrap/windows-48/OPS.c @@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym) if (OPS_intval == 2) { *sym = 35; OPS_numtyp = 1; - OPS_intval = OPS_str[0]; + OPS_intval = (SYSTEM_INT16)OPS_str[0]; } else { *sym = 37; } @@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex) { INTEGER _o_result; if (ch <= '9') { - _o_result = ch - 48; + _o_result = (SYSTEM_INT16)ch - 48; return _o_result; } else if (hex) { - _o_result = (ch - 65) + 10; + _o_result = ((SYSTEM_INT16)ch - 65) + 10; return _o_result; } else { OPS_err(2); diff --git a/bootstrap/windows-48/OPT.c b/bootstrap/windows-48/OPT.c index c81989cb..7398b44a 100644 --- a/bootstrap/windows-48/OPT.c +++ b/bootstrap/windows-48/OPT.c @@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len) i = 0; do { ch = name[__X(i, name__len)]; - OPM_FPrint(&*fp, ch); + OPM_FPrint(&*fp, (SYSTEM_INT16)ch); i += 1; } while (!(ch == 0x00)); } @@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj) } else if (obj->mode == 9) { OPT_FPrintSign(&fprint, obj->typ, obj->link); ext = obj->conval->ext; - m = (*ext)[0]; + m = (SYSTEM_INT16)(*ext)[0]; f = 1; OPM_FPrint(&fprint, m); while (f <= m) { - OPM_FPrint(&fprint, (*ext)[__X(f, 256)]); + OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]); f += 1; } } else if (obj->mode == 5) { @@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) switch (f) { case 1: case 3: case 2: OPM_SymRCh(&ch); - conval->intval = ch; + conval->intval = (SYSTEM_INT16)ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ) obj->vis = 0; tag = OPM_SymRInt(); if (tag == 35) { - (*typ)->sysflag = OPM_SymRInt(); + (*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt(); tag = OPM_SymRInt(); } switch (tag) { @@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno) obj->mode = 9; ext = OPT_NewExt(); obj->conval->ext = ext; - s = OPM_SymRInt(); + s = (SYSTEM_INT16)OPM_SymRInt(); (*ext)[0] = (CHAR)s; i = 1; while (i <= s) { @@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj) OPM_SymWInt(33); OPT_OutSign(obj->typ, obj->link); ext = obj->conval->ext; - j = (*ext)[0]; + j = (SYSTEM_INT16)(*ext)[0]; i = 1; OPM_SymWInt(j); while (i <= j) { @@ -1876,7 +1876,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1904,9 +1904,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/windows-48/OPV.c b/bootstrap/windows-48/OPV.c index 75adb37c..7538f014 100644 --- a/bootstrap/windows-48/OPV.c +++ b/bootstrap/windows-48/OPV.c @@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ) } typ->size = offset; typ->align = base; - typ->sysflag = __MASK(typ->sysflag, -256) + __ASHL(offset - off0, 8); + typ->sysflag = __MASK(typ->sysflag, -256) + (SYSTEM_INT16)__ASHL(offset - off0, 8); } else if (c == 2) { OPV_TypSize(typ->BaseTyp); typ->size = typ->n * typ->BaseTyp->size; @@ -474,7 +474,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -506,7 +506,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) obj = n->obj; class = n->class; designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp); - if ((((((class == 0 && obj->mnolev > 0)) && obj->mnolev != OPM_level)) && prec == 10)) { + if ((((((class == 0 && obj->mnolev > 0)) && (SYSTEM_INT16)obj->mnolev != OPM_level)) && prec == 10)) { designPrec = 9; } if (prec > designPrec) { @@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec) if (__IN(3, OPM_opt)) { if (typ->comp == 4) { OPM_WriteString((CHAR*)"__GUARDR(", 10); - if (obj->mnolev != OPM_level) { + if ((SYSTEM_INT16)obj->mnolev != OPM_level) { OPM_WriteStringVar((void*)obj->scope->name, 256); OPM_WriteString((CHAR*)"__curr->", 9); OPC_Ident(obj); @@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -811,7 +811,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/windows-48/Platform.c b/bootstrap/windows-48/Platform.c index 273d1182..60cb401c 100644 --- a/bootstrap/windows-48/Platform.c +++ b/bootstrap/windows-48/Platform.c @@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -280,7 +280,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } @@ -296,11 +296,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val) i = 1; } k = 0; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; while ((d >= 0 && d <= 9)) { k = k * 10 + d; i += 1; - d = s[__X(i, 64)] - 48; + d = (SYSTEM_INT16)s[__X(i, 64)] - 48; } if (s[0] == '-') { k = -k; diff --git a/bootstrap/windows-48/Reals.c b/bootstrap/windows-48/Reals.c index f2a4b1e4..bea1f4aa 100644 --- a/bootstrap/windows-48/Reals.c +++ b/bootstrap/windows-48/Reals.c @@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex) { CHAR c; __GET((SYSTEM_ADRINT)x + 3, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR(c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); + __PUT((SYSTEM_ADRINT)x + 3, (CHAR)(__ASHL(__ASHR((SYSTEM_INT16)c, 7), 7) + __MASK(__ASHR(ex, 1), -128)), CHAR); __GET((SYSTEM_ADRINT)x + 2, c, CHAR); - __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK(c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); + __PUT((SYSTEM_ADRINT)x + 2, (CHAR)(__MASK((SYSTEM_INT16)c, -128) + __ASHL(__MASK(ex, -2), 7)), CHAR); } INTEGER Reals_ExpoL (LONGREAL x) @@ -136,8 +136,8 @@ static void Reals_BytesToHex (SYSTEM_BYTE *b, LONGINT b__len, SYSTEM_BYTE *d, LO l = b__len; while (i < l) { by = __VAL(CHAR, b[__X(i, b__len)]); - d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR(by, 4)); - d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16)); + d[__X(__ASHL(i, 1), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4)); + d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16)); i += 1; } } diff --git a/bootstrap/windows-48/Strings.c b/bootstrap/windows-48/Strings.c index ec6697bf..f1d4f53d 100644 --- a/bootstrap/windows-48/Strings.c +++ b/bootstrap/windows-48/Strings.c @@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n, INTEGER len, destLen, i; __DUP(source, source__len, CHAR); len = Strings_Length(source, source__len); - destLen = dest__len - 1; + destLen = (SYSTEM_INT16)dest__len - 1; if (pos < 0) { pos = 0; } diff --git a/bootstrap/windows-48/Texts.c b/bootstrap/windows-48/Texts.c index 129aa156..bd5d1115 100644 --- a/bootstrap/windows-48/Texts.c +++ b/bootstrap/windows-48/Texts.c @@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void) } } while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) { - *Scan__31_s->e = (*Scan__31_s->e * 10 + *Scan__31_s->ch) - 48; + *Scan__31_s->e = (*Scan__31_s->e * 10 + (SYSTEM_INT16)*Scan__31_s->ch) - 48; Texts_Read((void*)&*Scan__31_s->S, Scan__31_s->S__typ, &*Scan__31_s->ch); } } @@ -818,10 +818,10 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if ('9' < ch) { if (('A' <= ch && ch <= 'F')) { hex = 1; - ch = (CHAR)(ch - 7); + ch = (CHAR)((SYSTEM_INT16)ch - 7); } else if (('a' <= ch && ch <= 'f')) { hex = 1; - ch = (CHAR)(ch - 39); + ch = (CHAR)((SYSTEM_INT16)ch - 39); } else { break; } @@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) if (i - j > 8) { j = i - 8; } - k = d[__X(j, 32)] - 48; + k = (SYSTEM_INT16)d[__X(j, 32)] - 48; j += 1; if ((i - j == 7 && k >= 8)) { k -= 16; } while (j < i) { - k = __ASHL(k, 4) + (d[__X(j, 32)] - 48); + k = __ASHL(k, 4) + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } if (neg) { @@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) y = (LONGREAL)0; g = (LONGREAL)1; do { - y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48); + y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { g = g / (LONGREAL)(LONGREAL)10; - y = (d[__X(j, 32)] - 48) * g + y; + y = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * g + y; j += 1; } ReadScaleFactor__32(); @@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) x = (REAL)0; f = (REAL)1; do { - x = x * (REAL)10 + (d[__X(j, 32)] - 48); + x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == h)); while (j < i) { f = f / (REAL)(REAL)10; - x = (d[__X(j, 32)] - 48) * f + x; + x = ((SYSTEM_INT16)d[__X(j, 32)] - 48) * f + x; j += 1; } if (ch == 'E') { @@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ) (*S).class = 3; k = 0; do { - k = k * 10 + (d[__X(j, 32)] - 48); + k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48); j += 1; } while (!(j == i)); if (neg) { @@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER } else { Texts_Write(&*W, W__typ, ' '); } - e = __ASHR((e - 1023) * 77, 8); + e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8); if (e >= 0) { x = x / (LONGREAL)Reals_TenL(e); } else { diff --git a/bootstrap/windows-88/Files.c b/bootstrap/windows-88/Files.c index 5f7d65a2..4d32ed53 100644 --- a/bootstrap/windows-88/Files.c +++ b/bootstrap/windows-88/Files.c @@ -868,7 +868,7 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x) LONGINT l; Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4); l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24); - *x = __VAL(SET, l); + *x = (SET)l; } void Files_ReadReal (Files_Rider *R, LONGINT *R__typ, REAL *x) @@ -959,7 +959,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x) { CHAR b[4]; LONGINT i; - i = __VAL(LONGINT, x); + i = (LONGINT)x; b[0] = (CHAR)i; b[1] = (CHAR)__ASHR(i, 8); b[2] = (CHAR)__ASHR(i, 16); diff --git a/bootstrap/windows-88/Heap.c b/bootstrap/windows-88/Heap.c index a8a51e7c..a5063871 100644 --- a/bootstrap/windows-88/Heap.c +++ b/bootstrap/windows-88/Heap.c @@ -328,11 +328,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size) Heap_Lock(); blksz = __ASHL(__ASHR(size + 63, 5), 5); new = Heap_NEWREC((SYSTEM_ADRINT)&blksz); - tag = (__VAL(LONGINT, new) + blksz) - 24; + tag = ((LONGINT)(SYSTEM_ADRINT)new + blksz) - 24; __PUT(tag - 8, 0, LONGINT); __PUT(tag, blksz, LONGINT); __PUT(tag + 8, -8, LONGINT); - __PUT(__VAL(LONGINT, new) - 8, tag, LONGINT); + __PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT); Heap_Unlock(); _o_result = new; return _o_result; @@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q) __GET(tag, offset, LONGINT); fld = q + offset; p = Heap_FetchAddress(fld); - __PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR); } else { fld = q + offset; n = Heap_FetchAddress(fld); @@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q) if (!__ODD(tagbits)) { __PUT(n - 8, tagbits + 1, LONGINT); __PUT(q - 8, tag + 1, LONGINT); - __PUT(fld, __VAL(SYSTEM_PTR, p), SYSTEM_PTR); + __PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)p, SYSTEM_PTR); p = q; q = n; tag = tagbits; @@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q) static void Heap_MarkP (SYSTEM_PTR p) { - Heap_Mark(__VAL(LONGINT, p)); + Heap_Mark((LONGINT)(SYSTEM_ADRINT)p); } static void Heap_Scan (void) @@ -554,7 +554,7 @@ static void Heap_Finalize (void) } else { prev->next = n->next; } - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); if (prev == NIL) { n = Heap_fin; } else { @@ -573,7 +573,7 @@ void Heap_FINALL (void) while (Heap_fin != NIL) { n = Heap_fin; Heap_fin = Heap_fin->next; - (*n->finalize)(__VAL(SYSTEM_PTR, n->obj)); + (*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj); } } @@ -700,7 +700,7 @@ void Heap_RegisterFinalizer (SYSTEM_PTR obj, Heap_Finalizer finalize) { Heap_FinNode f; __NEW(f, Heap_FinDesc); - f->obj = __VAL(LONGINT, obj); + f->obj = (LONGINT)(SYSTEM_ADRINT)obj; f->finalize = finalize; f->marked = 1; f->next = Heap_fin; diff --git a/bootstrap/windows-88/OPB.c b/bootstrap/windows-88/OPB.c index c3322a77..fef28dff 100644 --- a/bootstrap/windows-88/OPB.c +++ b/bootstrap/windows-88/OPB.c @@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y) f = y->typ->form; if ((*x)->class >= 7) { OPB_err(79); - } else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) { + } else if (f != 5 || __IN(y->class, 0x0300)) { OPB_err(80); y->typ = OPT_inttyp; } @@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y) f = (*x)->typ->form; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN(f, 0x70) && y->typ->form == 9)) { + } else if ((f == 5 && y->typ->form == 9)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -568,14 +568,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 6: - if (!__IN(f, 0x01f0)) { + if (!__IN(f, 0x01a0)) { OPB_err(96); } break; case 7: - if (__IN(f, 0x03f0)) { + if (__IN(f, 0x03a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 21: - if (__IN(f, 0x01f0)) { + if (__IN(f, 0x01a0)) { if (z->class == 7) { - if (__IN(f, 0x70)) { + if (f == 5) { if (z->conval->intval == (-9223372036854775807-1)) { OPB_err(203); } else { @@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) } break; case 23: - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval)); z->obj = NIL; @@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x) z->typ = OPT_linttyp; break; case 25: - if ((__IN(f, 0x70) && z->class == 7)) { + if ((f == 5 && z->class == 7)) { if ((0 <= z->conval->intval && z->conval->intval <= -1)) { z = NewOp__29(op, typ, z); } else { @@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void) case 0: res = 9; break; - case 1: case 3: case 4: case 5: case 6: + case 1: case 3: case 4: case 5: if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) { res = 11; } else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) { @@ -865,8 +865,8 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) __GUARDEQP(yval, OPT_ConstDesc) = *xval; } break; - case 4: case 5: case 6: - if (__IN(g, 0x70)) { + case 5: + if (g == 5) { if (x->typ->size <= y->typ->size) { x->typ = y->typ; } else { @@ -885,7 +885,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 8) { @@ -897,7 +897,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 8: - if (__IN(g, 0x70)) { + if (g == 5) { y->typ = x->typ; yval->realval = yval->intval; } else if (g == 7) { @@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } switch (op) { case 1: - if (__IN(f, 0x70)) { + if (f == 5) { xv = xval->intval; yv = yval->intval; if (((((xv == 0 || yv == 0) || (((xv > 0 && yv > 0)) && yv <= __DIV(9223372036854775807, xv))) || (((xv > 0 && yv < 0)) && yv >= __DIV((-9223372036854775807-1), xv))) || (((xv < 0 && yv > 0)) && xv >= __DIV((-9223372036854775807-1), yv))) || (((((((xv < 0 && yv < 0)) && xv != (-9223372036854775807-1))) && yv != (-9223372036854775807-1))) && -xv <= __DIV(9223372036854775807, -yv))) { @@ -965,7 +965,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->realval = xval->intval / (REAL)yval->intval; OPB_CheckRealType(7, 205, xval); @@ -989,7 +989,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 3: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __DIV(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (yval->intval != 0) { xval->intval = __MOD(xval->intval, yval->intval); OPB_SetIntType(x); @@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 6: - if (__IN(f, 0x70)) { + if (f == 5) { temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval); if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) { xval->intval += yval->intval; @@ -1043,7 +1043,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y) } break; case 7: - if (__IN(f, 0x70)) { + if (f == 5) { if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) { xval->intval -= yval->intval; OPB_SetIntType(x); @@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ) f = (*x)->typ->form; g = typ->form; if ((*x)->class == 7) { - if (__IN(f, 0x70)) { - if (__IN(g, 0x70)) { + if (f == 5) { + if (g == 5) { if (f > g) { OPB_SetIntType(*x); if ((*x)->typ->size > typ->size) { @@ -1248,17 +1248,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) OPB_err(100); } break; - case 4: case 5: case 6: - if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) { + case 5: + if ((g == 5 && y->typ->size < z->typ->size)) { OPB_Convert(&y, z->typ); - } else if (__IN(g, 0x01f0)) { + } else if (__IN(g, 0x01a0)) { OPB_Convert(&z, y->typ); } else { OPB_err(100); } break; case 7: - if (__IN(g, 0x70)) { + if (g == 5) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&z, y->typ); @@ -1267,7 +1267,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 8: - if (__IN(g, 0x01f0)) { + if (__IN(g, 0x01a0)) { OPB_Convert(&y, z->typ); } else if (__IN(g, 0x0180)) { OPB_Convert(&y, z->typ); @@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) switch (op) { case 1: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (z->class == 7) { val = z->conval->intval; if (val == 1) { @@ -1346,7 +1346,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 2: - if (__IN(f, 0x70)) { + if (f == 5) { if ((y->class == 7 && y->conval->intval == 0)) { OPB_err(205); } @@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) break; case 3: do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { val = y->conval->intval; if (val == 0) { @@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 4: - if (__IN(f, 0x70)) { + if (f == 5) { if (y->class == 7) { if (y->conval->intval == 0) { OPB_err(205); @@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 6: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(105); typ = OPT_undftyp; } do_ = 1; - if (__IN(f, 0x70)) { + if (f == 5) { if ((z->class == 7 && z->conval->intval == 0)) { do_ = 0; z = y; @@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y) } break; case 7: - if (!__IN(f, 0x03f1)) { + if (!__IN(f, 0x03e1)) { OPB_err(106); typ = OPT_undftyp; } - if ((!__IN(f, 0x70) || y->class != 7) || y->conval->intval != 0) { + if ((f != 5 || y->class != 7) || y->conval->intval != 0) { NewOp__39(op, typ, &z, y); } break; @@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y) LONGINT k, l; if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) { OPB_err(126); - } else if ((__IN((*x)->typ->form, 0x70) && __IN(y->typ->form, 0x70))) { + } else if (((*x)->typ->form == 5 && y->typ->form == 5)) { if ((*x)->class == 7) { k = (*x)->conval->intval; if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) { @@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x) LONGINT k; if ((*x)->class == 8 || (*x)->class == 9) { OPB_err(126); - } else if (!__IN((*x)->typ->form, 0x70)) { + } else if ((*x)->typ->form != 5) { OPB_err(93); } else if ((*x)->class == 7) { k = (*x)->conval->intval; @@ -1584,7 +1584,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) case 0: case 10: break; case 1: - if (!((__IN(g, 0x7a) && y->size == 1))) { + if (!((__IN(g, 0x2a) && y->size == 1))) { OPB_err(113); } break; @@ -1593,18 +1593,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPB_err(113); } break; - case 4: case 5: case 6: - if (!__IN(g, 0x70) || x->size < y->size) { + case 5: + if (g != 5 || x->size < y->size) { OPB_err(113); } break; case 7: - if (!__IN(g, 0xf0)) { + if (!__IN(g, 0xe0)) { OPB_err(113); } break; case 8: - if (!__IN(g, 0x01f0)) { + if (!__IN(g, 0x01e0)) { OPB_err(113); } break; @@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode) OPM_LogWLn(); break; } - if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xf0))) && __IN(f, 0x01e0))) { + if ((((((ynode->class == 7 && g < f)) && __IN(g, 0xe0))) && __IN(f, 0x01e0))) { OPB_Convert(&ynode, x); } } @@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) f = x->typ->form; switch (fctno) { case 0: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); } else { @@ -1778,7 +1778,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(0); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size)); break; case 9: @@ -1809,7 +1809,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) x = OPB_NewIntConst(255); x->typ = OPT_chartyp; break; - case 4: case 5: case 6: + case 5: x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size)); break; case 9: @@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 9: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x71)) { + } else if (__IN(f, 0x21)) { OPB_Convert(&x, OPT_chartyp); } else { OPB_err(111); @@ -1843,7 +1843,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 10: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, -1); if (typ == NIL) { OPB_err(111); @@ -1859,7 +1859,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 11: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { typ = OPT_ShorterOrLongerType(x->typ, 1); if (typ == NIL) { OPB_err(111); @@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 13: case 14: if (OPB_NotVar(x)) { OPB_err(112); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else if (x->readonly) { OPB_err(76); @@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) { OPB_Convert(&x, OPT_linttyp); } @@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x027a)) { + } else if (!__IN(f, 0x022a)) { OPB_err(111); } break; 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } break; case 26: case 27: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if (x->conval->intval < 0 || x->conval->intval > -1) { OPB_err(220); } @@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; } else { if (x->typ != p->typ) { - if ((x->class == 7 && __IN(f, 0x70))) { + if ((x->class == 7 && f == 5)) { OPB_Convert(&x, p->typ); } else { OPB_err(111); @@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 15: case 16: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) { OPB_err(202); } @@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) p->typ = OPT_notyp; break; case 17: - if (!__IN(f, 0x70) || x->class != 7) { + if (!(f == 5) || x->class != 7) { OPB_err(69); } else if (x->typ->size == 1) { L = (SYSTEM_INT32)x->conval->intval; @@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 19: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((p->class == 7 && x->class == 7)) { if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) { OPB_err(208); @@ -2138,7 +2138,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) if (x->class == 8 || x->class == 9) { OPB_err(126); } else if (p->typ->comp == 3) { - if (__IN(f, 0x70)) { + if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 22: case 23: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (!__IN(f, 0x70)) { + } else if (f != 5) { OPB_err(111); } else { if (fctno == 22) { @@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 28: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(12, 26, p, x); } else { OPB_err(111); @@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno) case 30: if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { p = NewOp__53(19, 30, p, x); } else { OPB_err(111); @@ -2220,16 +2220,16 @@ 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, 0x70))) && x->typ->size < OPT_linttyp->size)) { + } else if ((((x->class == 7 && f == 5)) && x->typ->size < OPT_linttyp->size)) { OPB_Convert(&x, OPT_linttyp); - } else if (!((__IN(x->typ->form, 0x2070) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { + } else if (!((__IN(x->typ->form, 0x2020) && x->typ->size == (SYSTEM_INT64)OPM_PointerSize))) { OPB_err(111); x->typ = OPT_linttyp; } p->link = x; break; case 32: - if ((__IN(f, 0x70) && x->class == 7)) { + if ((f == 5 && x->class == 7)) { if ((0 <= x->conval->intval && x->conval->intval <= 255)) { OPB_BindNodes(28, OPT_notyp, &x, x); x->conval = OPT_NewConst(); @@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) OPB_err(126); } else if (p->typ->comp != 3) { OPB_err(64); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) { OPB_err(63); } @@ -2288,7 +2288,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n) } else if ((fctno == 31 && n == 2)) { if (x->class == 8 || x->class == 9) { OPB_err(126); - } else if (__IN(f, 0x70)) { + } else if (f == 5) { node = OPT_NewNode(19); node->subcl = 31; node->right = p; @@ -2376,7 +2376,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, 0x7e) && atyp->size == 1))) { + if (!__IN(f, 0x0c) || !((__IN(atyp->form, 0x2e) && atyp->size == 1))) { if (__IN(18, OPM_opt)) { OPB_err(-301); } @@ -2459,7 +2459,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, 0x7e) && ap->typ->size == 1)))))) { + } else if ((ap->typ != fp->typ && !((fp->typ->form == 1 && ((__IN(ap->typ->form, 0x2e) && 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/OPC.c b/bootstrap/windows-88/OPC.c index 57fdcb05..b8a0608e 100644 --- a/bootstrap/windows-88/OPC.c +++ b/bootstrap/windows-88/OPC.c @@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form) case 3: OPC_CharacterLiteral(caseVal); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(caseVal); break; default: @@ -1977,7 +1977,7 @@ void OPC_Constant (OPT_Const con, INTEGER form) case 3: OPC_CharacterLiteral(con->intval); break; - case 4: case 5: case 6: + case 5: OPM_WriteInt(con->intval); break; case 7: diff --git a/bootstrap/windows-88/OPM.c b/bootstrap/windows-88/OPM.c index edc81f01..450ed83d 100644 --- a/bootstrap/windows-88/OPM.c +++ b/bootstrap/windows-88/OPM.c @@ -533,12 +533,12 @@ void OPM_err (INTEGER n) void OPM_FPrint (LONGINT *fp, LONGINT val) { - *fp = __ROTL((LONGINT)(__VAL(SET, *fp) ^ __VAL(SET, val)), 1, LONGINT); + *fp = __ROTL((LONGINT)((SET)*fp ^ (SET)val), 1, LONGINT); } void OPM_FPrintSet (LONGINT *fp, SET set) { - OPM_FPrint(&*fp, __VAL(LONGINT, set)); + OPM_FPrint(&*fp, (LONGINT)set); } void OPM_FPrintReal (LONGINT *fp, REAL real) @@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i) void OPM_SymWSet (SET s) { - Files_WriteNum(&OPM_newSF, Files_Rider__typ, __VAL(LONGINT, s)); + Files_WriteNum(&OPM_newSF, Files_Rider__typ, (LONGINT)s); } void OPM_SymWReal (REAL r) diff --git a/bootstrap/windows-88/OPP.c b/bootstrap/windows-88/OPP.c index c525c696..becc2507 100644 --- a/bootstrap/windows-88/OPP.c +++ b/bootstrap/windows-88/OPP.c @@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_) OPP_err(135); } OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { sf = x->conval->intval; if (sf < 0 || sf > 1) { OPP_err(220); @@ -269,7 +269,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned) *typ = OPT_NewStr(15, 2); (*typ)->sysflag = sysflag; OPP_ConstExpression(&x); - if (__IN(x->typ->form, 0x70)) { + if (x->typ->form == 5) { n = x->conval->intval; if (n <= 0 || n > OPM_MaxIndex) { OPP_err(63); @@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x) OPT_Node y = NIL; SHORTINT m; INTEGER n; - m = (SYSTEM_INT8)(*x)->obj->adr; + m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr); n = 0; if (OPP_sym == 30) { OPS_Get(&OPP_sym); @@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O for (;;) { OPP_ConstExpression(&x); f = x->typ->form; - if (__IN(f, 0x78)) { + if (__IN(f, 0x28)) { xval = x->conval->intval; } else { OPP_err(61); xval = 1; } - if (__IN(f, 0x70)) { - if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) { + if (f == 5) { + if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) { OPP_err(60); } } else if (LabelTyp->form != f) { @@ -1191,7 +1191,7 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O OPS_Get(&OPP_sym); OPP_ConstExpression(&y); yval = y->conval->intval; - if ((y->typ->form != f && !((__IN(f, 0x70) && __IN(y->typ->form, 0x70))))) { + if ((y->typ->form != f && !((f == 5 && y->typ->form == 5)))) { OPP_err(60); } if (yval < xval) { @@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x) *StatSeq__30_s->pos = OPM_errpos; if ((*x)->class == 8 || (*x)->class == 9) { OPP_err(126); - } else if (!__IN((*x)->typ->form, 0x78)) { + } else if (!__IN((*x)->typ->form, 0x38)) { OPP_err(125); } OPP_CheckSym(25); @@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat) OPS_Get(&OPP_sym); if (OPP_sym == 38) { OPP_qualident(&id); - if (!__IN(id->typ->form, 0x70)) { + if (!(id->typ->form == 5)) { OPP_err(68); } OPP_CheckSym(34); @@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat) SetPos__35(z); OPB_Link(&*stat, &last, z); y = OPB_NewLeaf(t); - } else if (!__IN(y->typ->form, 0x70) || y->typ->size > x->left->typ->size) { + } else if (!(y->typ->form == 5) || y->typ->size > x->left->typ->size) { OPP_err(113); } OPB_Link(&*stat, &last, x); diff --git a/bootstrap/windows-88/OPT.c b/bootstrap/windows-88/OPT.c index 5861f882..f8762935 100644 --- a/bootstrap/windows-88/OPT.c +++ b/bootstrap/windows-88/OPT.c @@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir) { OPT_Struct _o_result; INTEGER i; - __ASSERT(__IN(x->form, 0x70), 0); + __ASSERT(x->form == 5, 0); __ASSERT(dir == 1 || dir == -1, 0); __ASSERT(x->BaseTyp == OPT_undftyp, 0); i = 0; @@ -650,7 +650,7 @@ void OPT_FPrintObj (OPT_Object obj) f = obj->typ->form; OPM_FPrint(&fprint, f); switch (f) { - case 2: case 3: case 4: case 5: case 6: + case 2: case 3: case 5: OPM_FPrint(&fprint, obj->conval->intval); break; case 9: @@ -851,7 +851,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval) OPM_SymRCh(&ch); conval->intval = ch; break; - case 4: case 5: case 6: + case 5: conval->intval = OPM_SymRInt(); break; case 9: @@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno) static OPT_Struct OPT_InTyp (LONGINT tag) { OPT_Struct _o_result; - if (__IN(tag, 0x70)) { + if (tag == 5) { _o_result = OPT_IntType(OPM_SymRInt()); return _o_result; } else { @@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ) OPT_Object strobj = NIL; if (typ->ref < OPT_expCtxt.ref) { OPM_SymWInt(-typ->ref); - if (__IN(typ->ref, 0x70)) { + if (typ->ref == 5) { OPM_SymWInt(typ->size); } } else { @@ -1538,7 +1538,7 @@ static void OPT_OutConstant (OPT_Object obj) case 2: case 3: OPM_SymWCh((CHAR)obj->conval->intval); break; - case 4: case 5: case 6: + case 5: OPM_SymWInt(obj->conval->intval); OPM_SymWInt(obj->typ->size); break; @@ -1877,7 +1877,7 @@ export void *OPT__init(void) OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp); OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp); OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp); - OPT_EnterTyp((CHAR*)"SHORTINT", 4, OPM_SIntSize, &OPT_sinttyp); + OPT_EnterTyp((CHAR*)"SHORTINT", 5, OPM_SIntSize, &OPT_sinttyp); OPT_EnterBoolConst((CHAR*)"FALSE", 0); OPT_EnterBoolConst((CHAR*)"TRUE", 1); OPT_EnterProc((CHAR*)"HALT", 0); @@ -1905,9 +1905,7 @@ export void *OPT__init(void) OPT_impCtxt.ref[1] = OPT_bytetyp; OPT_impCtxt.ref[2] = OPT_booltyp; OPT_impCtxt.ref[3] = OPT_chartyp; - OPT_impCtxt.ref[4] = OPT_sinttyp; OPT_impCtxt.ref[5] = OPT_inttyp; - OPT_impCtxt.ref[6] = OPT_linttyp; OPT_impCtxt.ref[7] = OPT_realtyp; OPT_impCtxt.ref[8] = OPT_lrltyp; OPT_impCtxt.ref[9] = OPT_settyp; diff --git a/bootstrap/windows-88/OPV.c b/bootstrap/windows-88/OPV.c index 49956ac6..b5cebda5 100644 --- a/bootstrap/windows-88/OPV.c +++ b/bootstrap/windows-88/OPV.c @@ -475,7 +475,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec) static void OPV_SizeCast (LONGINT from, LONGINT to) { - if ((from != to && (from > 4 || to > 4))) { + if ((from != to && (from > 4 || to != 4))) { switch (to) { case 1: OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14); @@ -507,7 +507,7 @@ static void OPV_Convert (OPT_Node n, OPT_Struct newtype, INTEGER prec) OPM_WriteString((CHAR*)"__SETOF(", 9); OPV_Entier(n, -1); OPM_Write(')'); - } else if (__IN(to, 0x70)) { + } else if (to == 5) { if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) { OPM_WriteString((CHAR*)"__SHORT", 8); if (OPV_SideEffects(n)) { @@ -798,10 +798,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) OPM_WriteString((CHAR*)"(void*)", 8); } } else { - if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) { + if ((__IN(form, 0x0180) && n->typ->form == 5)) { OPM_WriteString((CHAR*)"(double)", 9); prec = 9; - } else if (__IN(form, 0x70)) { + } else if (form == 5) { OPV_SizeCast(n->typ->size, typ->size); } } @@ -812,7 +812,7 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp) } if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) { OPV_expr(n->left, prec); - } else if ((__IN(form, 0x70) && n->class == 7)) { + } else if ((form == 5 && n->class == 7)) { OPV_ParIntLiteral(n->conval->intval, n->typ->size); } else { OPV_expr(n, prec); @@ -966,7 +966,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) } break; case 29: - if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6240) && __IN(l->typ->form, 0x6240))) && n->typ->size == l->typ->size)) { + if (!__IN(l->class, 0x17) || (((__IN(n->typ->form, 0x6220) && __IN(l->typ->form, 0x6220))) && n->typ->size == l->typ->size)) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); @@ -1116,7 +1116,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec) OPM_WriteString((CHAR*)" ^ ", 4); } else { OPM_WriteString((CHAR*)" / ", 4); - if (r->obj == NIL || __IN(r->obj->typ->form, 0x70)) { + if (r->obj == NIL || r->obj->typ->form == 5) { OPM_Write('('); OPC_Ident(n->typ->strobj); OPM_Write(')'); diff --git a/bootstrap/windows-88/Platform.c b/bootstrap/windows-88/Platform.c index f66fdf2c..efbe5376 100644 --- a/bootstrap/windows-88/Platform.c +++ b/bootstrap/windows-88/Platform.c @@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr) Platform_ArgVecPtr av = NIL; Platform_MainStackFrame = argvadr; Platform_ArgCount = argc; - av = __VAL(Platform_ArgVecPtr, argvadr); + av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr; Platform_ArgVector = (*av)[0]; Platform_HaltCode = -128; Platform_HeapInitHeap(); @@ -281,7 +281,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len) { Platform_ArgVec av = NIL; if (n < Platform_ArgCount) { - av = __VAL(Platform_ArgVec, Platform_ArgVector); + av = (Platform_ArgVec)(SYSTEM_ADRINT)Platform_ArgVector; __COPY(*(*av)[__X(n, 1024)], val, val__len); } } diff --git a/src/compiler/OPB.Mod b/src/compiler/OPB.Mod index 000e1aef..9f696edc 100644 --- a/src/compiler/OPB.Mod +++ b/src/compiler/OPB.Mod @@ -178,7 +178,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN f := y^.typ^.form; IF x^.class >= OPT.Nconst THEN err(79) - ELSIF ~(f IN OPT.intSet) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ; + ELSIF (f # OPT.Int) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ; IF x^.typ^.comp = OPT.Array THEN typ := x^.typ^.BaseTyp; IF (y^.class = OPT.Nconst) & ((y^.conval^.intval < 0) OR (y^.conval^.intval >= x^.typ^.n)) THEN err(81) END ELSIF x^.typ^.comp = OPT.DynArr THEN typ := x^.typ^.BaseTyp; @@ -241,7 +241,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR f: INTEGER; k: LONGINT; BEGIN f := x^.typ^.form; IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) - ELSIF (f IN OPT.intSet) & (y^.typ^.form = OPT.Set) THEN + ELSIF (f = OPT.Int) & (y^.typ^.form = OPT.Set) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (k < 0) OR (k > OPM.MaxSet) THEN err(202) @@ -298,10 +298,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(98) END - |OPS.plus: IF ~(f IN OPT.intSet + OPT.realSet) THEN err(96) END - |OPS.minus: IF f IN OPT.intSet + OPT.realSet +{OPT.Set}THEN + |OPS.plus: IF ~(f IN {OPT.Int} + OPT.realSet) THEN err(96) END + |OPS.minus: IF f IN {OPT.Int, OPT.Set} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.conval^.intval = MIN(LONGINT) THEN err(203) ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z) END @@ -313,9 +313,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(97) END - |OPT.abs: IF f IN OPT.intSet + OPT.realSet THEN + |OPT.abs: IF f IN {OPT.Int} + OPT.realSet THEN IF z^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.conval^.intval = MIN(LONGINT) THEN err(203) ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z) END @@ -333,7 +333,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE err(111); z^.typ := OPT.chartyp END - |OPT.odd: IF f IN OPT.intSet THEN + |OPT.odd: IF f = OPT.Int THEN IF z^.class = OPT.Nconst THEN z^.conval^.intval := BoolToInt(ODD(z^.conval^.intval)); z^.obj := NIL ELSE z := NewOp(op, typ, z) @@ -348,7 +348,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSE err(127) END ; z^.typ := OPT.linttyp - |OPT.cc: IF (f IN OPT.intSet) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) + |OPT.cc: IF (f = OPT.Int) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*) IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END ELSE err(69) END ; @@ -426,7 +426,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.Undef: res := OPS.eql |OPT.Byte, OPT.Char - ..OPT.LInt: IF xval^.intval < yval^.intval THEN res := OPS.lss + ..OPT.Int: IF xval^.intval < yval^.intval THEN res := OPS.lss ELSIF xval^.intval > yval^.intval THEN res := OPS.gtr ELSE res := OPS.eql END @@ -463,19 +463,17 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.Char: IF g = OPT.String THEN CharToString(x) ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END ; - |OPT.SInt, - OPT.Int, - OPT.LInt: IF g IN OPT.intSet THEN + |OPT.Int: IF g = OPT.Int THEN IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := OPT.IntType(x.typ.size) END ELSIF g = OPT.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END - |OPT.Real: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval + |OPT.Real: IF g = OPT.Int THEN y^.typ := x^.typ; yval^.realval := yval^.intval ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END - |OPT.LReal: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval + |OPT.LReal: IF g = OPT.Int THEN y^.typ := x^.typ; yval^.realval := yval^.intval ELSIF g = OPT.Real THEN y^.typ := OPT.lrltyp ELSE err(100); y^.typ := x^.typ; yval^ := xval^ END @@ -490,7 +488,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) f := x^.typ^.form END ; (* {x^.typ = y^.typ} *) CASE op OF - |OPS.times: IF f IN OPT.intSet THEN xv := xval^.intval; yv := yval^.intval; + |OPS.times: IF f = OPT.Int THEN xv := xval^.intval; yv := yval^.intval; IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *) (xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR (xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR @@ -509,7 +507,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval * yval^.setval ELSIF f # OPT.Undef THEN err(101) END - |OPS.slash: IF f IN OPT.intSet THEN + |OPS.slash: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.realval := xval^.intval / yval^.intval; CheckRealType(OPT.Real, 205, xval) ELSE err(205); xval^.realval := 1.0 @@ -525,14 +523,14 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval / yval^.setval ELSIF f # OPT.Undef THEN err(102) END - |OPS.div: IF f IN OPT.intSet THEN + |OPS.div: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.intval := xval^.intval DIV yval^.intval; SetIntType(x) ELSE err(205) END ELSIF f # OPT.Undef THEN err(103) END - |OPS.mod: IF f IN OPT.intSet THEN + |OPS.mod: IF f = OPT.Int THEN IF yval^.intval # 0 THEN xval^.intval := xval^.intval MOD yval^.intval; SetIntType(x) ELSE err(205) @@ -543,7 +541,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.intval := BoolToInt(IntToBool(xval^.intval) & IntToBool(yval^.intval)) ELSE err(94) END - |OPS.plus: IF f IN OPT.intSet THEN + |OPS.plus: IF f = OPT.Int THEN temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval); IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN INC(xval^.intval, yval^.intval); SetIntType(x) @@ -559,7 +557,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) xval^.setval := xval^.setval + yval^.setval ELSIF f # OPT.Undef THEN err(105) END - |OPS.minus: IF f IN OPT.intSet THEN + |OPS.minus: IF f = OPT.Int THEN IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR (yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN DEC(xval^.intval, yval^.intval); SetIntType(x) @@ -598,12 +596,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END END ConstOp; - PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); + PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); (* Convert node x to new type typ *) VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL; BEGIN f := x^.typ^.form; g := typ^.form; IF x^.class = OPT.Nconst THEN - IF f IN OPT.intSet THEN - IF g IN OPT.intSet THEN + IF f = OPT.Int THEN + IF g = OPT.Int THEN IF f > g THEN SetIntType(x); IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END END @@ -668,17 +666,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) g := y^.typ^.form; CASE z^.typ^.form OF |OPT.Char: IF z^.class = OPT.Nconst THEN CharToString(z) ELSE err(100) END - |OPT.SInt, - OPT.Int, - OPT.LInt: IF (g IN OPT.intSet) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) - ELSIF g IN OPT.intSet + OPT.realSet THEN Convert(z, y.typ) + |OPT.Int: IF (g = OPT.Int) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ) + ELSIF g IN {OPT.Int} + OPT.realSet THEN Convert(z, y.typ) ELSE err(100) END - |OPT.Real: IF g IN OPT.intSet THEN Convert(y, z^.typ) + |OPT.Real: IF g = OPT.Int THEN Convert(y, z^.typ) ELSIF g IN OPT.realSet THEN Convert(z, y^.typ) ELSE err(100) END - |OPT.LReal: IF g IN OPT.intSet + OPT.realSet THEN Convert(y, z^.typ) + |OPT.LReal: IF g IN {OPT.Int} + OPT.realSet THEN Convert(y, z^.typ) ELSIF g IN OPT.realSet THEN Convert(y, z^.typ) (* DCWB: Surely this line does nothing. *) ELSE err(100) END @@ -693,7 +689,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) typ := z^.typ; f := typ^.form; g := y^.typ^.form; CASE op OF |OPS.times: do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF z^.class = OPT.Nconst THEN val := z^.conval^.intval; IF val = 1 THEN do := FALSE; z := y ELSIF val = 0 THEN do := FALSE @@ -711,7 +707,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF ~(f IN {OPT.Undef, OPT.Real..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.slash: IF f IN OPT.intSet THEN + |OPS.slash: IF f = OPT.Int THEN IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN err(205) END ; Convert(z, OPT.realtyp); Convert(y, OPT.realtyp); typ := OPT.realtyp @@ -721,7 +717,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; NewOp(op, typ, z, y) |OPS.div: do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF y^.class = OPT.Nconst THEN val := y^.conval^.intval; IF val = 0 THEN err(205) ELSIF val = 1 THEN do := FALSE @@ -732,7 +728,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) ELSIF f # OPT.Undef THEN err(103); typ := OPT.undftyp END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.mod: IF f IN OPT.intSet THEN + |OPS.mod: IF f = OPT.Int THEN IF y^.class = OPT.Nconst THEN IF y^.conval^.intval = 0 THEN err(205) ELSIF log(y^.conval^.intval) = 1 THEN @@ -752,15 +748,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSIF f # OPT.Undef THEN err(94); z^.typ := OPT.undftyp END - |OPS.plus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; + |OPS.plus: IF ~(f IN {OPT.Undef, OPT.Int..OPT.Set}) THEN err(105); typ := OPT.undftyp END ; do := TRUE; - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF (z^.class = OPT.Nconst) & (z^.conval^.intval = 0) THEN do := FALSE; z := y END ; IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN do := FALSE END END ; IF do THEN NewOp(op, typ, z, y) END - |OPS.minus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(106); typ := OPT.undftyp END ; - IF ~(f IN OPT.intSet) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END + |OPS.minus: IF ~(f IN {OPT.Undef, OPT.Int..OPT.Set}) THEN err(106); typ := OPT.undftyp END ; + IF (f # OPT.Int) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END |OPS.or: IF f = OPT.Bool THEN IF z^.class = OPT.Nconst THEN IF ~IntToBool(z^.conval^.intval) THEN z := y END @@ -795,7 +791,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR k, l: LONGINT; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.typ^.form IN OPT.intSet) & (y^.typ^.form IN OPT.intSet) THEN + ELSIF (x^.typ^.form = OPT.Int) & (y^.typ^.form = OPT.Int) THEN IF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (0 > k) OR (k > OPM.MaxSet) THEN err(202) END @@ -821,7 +817,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) VAR k: LONGINT; BEGIN IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(x^.typ^.form IN OPT.intSet) THEN err(93) + ELSIF x^.typ^.form # OPT.Int THEN err(93) ELSIF x^.class = OPT.Nconst THEN k := x^.conval^.intval; IF (0 <= k) & (k <= OPM.MaxSet) THEN x^.conval^.setval := {k} @@ -854,15 +850,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Undef, OPT.String: - | OPT.Byte: IF ~((g IN ({OPT.Byte, OPT.Char} + OPT.intSet)) & (y.size = 1)) THEN err(113) END + | OPT.Byte: IF ~((g IN {OPT.Byte, OPT.Char, OPT.Int}) & (y.size = 1)) THEN err(113) END | OPT.Bool, OPT.Char, OPT.Set: IF g # f THEN err(113) END - | OPT.SInt, - OPT.Int, - OPT.LInt: IF ~(g IN OPT.intSet) OR (x.size < y.size) THEN err(113) END - | OPT.Real: IF ~(g IN {OPT.SInt..OPT.Real}) THEN err(113) END - | OPT.LReal: IF ~(g IN {OPT.SInt..OPT.LReal}) THEN err(113) END + | OPT.Int: IF (g # OPT.Int) OR (x.size < y.size) THEN err(113) END + | OPT.Real: IF ~(g IN {OPT.Int..OPT.Real}) THEN err(113) END + | OPT.LReal: IF ~(g IN {OPT.Int..OPT.LReal}) THEN err(113) END | OPT.Pointer: IF (x = y) OR (g = OPT.NilTyp) OR (x = OPT.sysptrtyp) & (g = OPT.Pointer) THEN (* ok *) ELSIF g = OPT.Pointer THEN p := x^.BaseTyp; q := y^.BaseTyp; @@ -909,7 +903,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSE OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn; END ; - IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.SInt..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN + IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.Int..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN Convert(ynode, x) END END CheckAssign; @@ -928,7 +922,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN x := par0; f := x^.typ^.form; CASE fctno OF |OPT.haltfn: (*HALT*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN BindNodes(OPT.Ntrap, OPT.notyp, x, x) ELSE err(218) @@ -974,9 +968,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Bool: x := NewBoolConst(FALSE) | OPT.Char: x := NewIntConst(0); x^.typ := OPT.chartyp - | OPT.SInt, - OPT.Int, - OPT.LInt: x := NewIntConst(OPM.SignedMinimum(x.typ.size)) + | OPT.Int: x := NewIntConst(OPM.SignedMinimum(x.typ.size)) | OPT.Set: x := NewIntConst(0); x^.typ := OPT.inttyp | OPT.Real: x := NewRealConst(OPM.MinReal, OPT.realtyp) | OPT.LReal: x := NewRealConst(OPM.MinLReal, OPT.lrltyp) @@ -989,9 +981,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) CASE f OF OPT.Bool: x := NewBoolConst(TRUE) | OPT.Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp - | OPT.SInt, - OPT.Int, - OPT.LInt: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) + | OPT.Int: x := NewIntConst(OPM.SignedMaximum(x.typ.size)) | OPT.Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp | OPT.Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp) | OPT.LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp) @@ -1001,12 +991,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.chrfn: (*CHR*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN {OPT.Undef} + OPT.intSet THEN Convert(x, OPT.chartyp) + ELSIF f IN {OPT.Undef, OPT.Int} THEN Convert(x, OPT.chartyp) ELSE err(111); x^.typ := OPT.chartyp END |OPT.shortfn: (*SHORT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN typ := OPT.ShorterOrLongerType(x.typ, -1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp) @@ -1014,7 +1004,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.longfn: (*LONG*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN typ := OPT.ShorterOrLongerType(x.typ, 1); IF typ = NIL THEN err(111) ELSE Convert(x, typ) END ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp) @@ -1024,7 +1014,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.incfn, OPT.decfn: (*INC, DEC*) IF NotVar(x) THEN err(112) - ELSIF ~(f IN OPT.intSet) THEN err(111) + ELSIF f # OPT.Int THEN err(111) ELSIF x^.readonly THEN err(76) END |OPT.inclfn, @@ -1043,7 +1033,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END ELSE err(111); x^.typ := OPT.linttyp END @@ -1061,19 +1051,19 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.lshfn, OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(f IN OPT.intSet + {OPT.Byte, OPT.Char, OPT.Set}) THEN err(111) + ELSIF ~(f IN {OPT.Int, OPT.Byte, OPT.Char, OPT.Set}) THEN err(111) END |OPT.getfn, OPT.putfn, OPT.bitfn, OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp END |OPT.getrfn, OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (x^.conval^.intval < OPM.MinRegNr) OR (x^.conval^.intval > OPM.MaxRegNr) THEN err(220) END ELSE err(69) END @@ -1114,7 +1104,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); p^.typ := OPT.notyp ELSE IF x^.typ # p^.typ THEN - IF (x^.class = OPT.Nconst) & (f IN OPT.intSet) THEN Convert(x, p^.typ) + IF (x^.class = OPT.Nconst) & (f = OPT.Int) THEN Convert(x, p^.typ) ELSE err(111) END END ; @@ -1124,7 +1114,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.inclfn, OPT.exclfn: (*INCL, EXCL*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202) END ; p := NewOp(OPT.Nassign, fctno, p, x) @@ -1132,7 +1122,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ; p^.typ := OPT.notyp |OPT.lenfn: (*LEN*) - IF ~(f IN OPT.intSet) OR (x^.class # OPT.Nconst) THEN err(69) + IF ~(f = OPT.Int) OR (x^.class # OPT.Nconst) THEN err(69) ELSIF x.typ.size = 1 THEN (* Hard limit of 127 dimensions *) L := SHORT(x^.conval^.intval); typ := p^.typ; WHILE (L > 0) & (typ^.comp IN {OPT.DynArr, OPT.Array}) DO typ := typ^.BaseTyp; DEC(L) END ; @@ -1156,7 +1146,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) p^.typ := OPT.notyp |OPT.ashfn: (*ASH*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (p^.class = OPT.Nconst) & (x^.class = OPT.Nconst) THEN IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1 ELSIF x^.conval^.intval >= 0 THEN @@ -1174,7 +1164,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.newfn: (*NEW(p, x...)*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF p^.typ^.comp = OPT.DynArr THEN - IF f IN OPT.intSet THEN + IF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ELSE err(111) END ; @@ -1184,7 +1174,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) |OPT.lshfn, OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(f IN OPT.intSet) THEN err(111) + ELSIF f # OPT.Int THEN err(111) ELSE IF fctno = OPT.lshfn THEN p := NewOp(OPT.Ndop, OPT.lsh, p, x) ELSE p := NewOp(OPT.Ndop, OPT.rot, p, x) END ; p^.typ := p^.left^.typ @@ -1205,7 +1195,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) p^.typ := OPT.notyp |OPT.bitfn: (*SYSTEM.BIT*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN p := NewOp(OPT.Ndop, OPT.bit, p, x) ELSE err(111) END ; @@ -1229,19 +1219,19 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) x^.typ := p^.typ; p := x |OPT.sysnewfn: (*SYSTEM.NEW*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN p := NewOp(OPT.Nassign, OPT.sysnewfn, p, x) ELSE err(111) END ; p^.typ := OPT.notyp |OPT.movefn: (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) - ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp + ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp) + ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp END; p^.link := x |OPT.assertfn: (*ASSERT*) - IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN + IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN BindNodes(OPT.Ntrap, OPT.notyp, x, x); x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.errpos; @@ -1266,7 +1256,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) IF fctno = OPT.newfn THEN (*NEW(p, ..., x...*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) ELSIF p^.typ^.comp # OPT.DynArr THEN err(64) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ; node := p^.right; WHILE node^.link # NIL DO node := node^.link END; node^.link := x; p^.typ := p^.typ^.BaseTyp @@ -1274,7 +1264,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) END ELSIF (fctno = OPT.movefn) & (n = 2) THEN (*SYSTEM.MOVE*) IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF f IN OPT.intSet THEN + ELSIF f = OPT.Int THEN node := OPT.NewNode(OPT.Nassign); node^.subcl := OPT.movefn; node^.right := p; node^.left := p^.link; p^.link := x; p := node ELSE err(111) @@ -1333,7 +1323,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *) BEGIN (* ftyp^.comp = OPT.DynArr *) f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp; IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *) - IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (atyp.size = 1)) THEN + IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (atyp.size = 1)) THEN IF OPM.verbose IN OPM.opt THEN err(-301) END END ELSIF f IN {OPT.Array, OPT.DynArr} THEN @@ -1386,7 +1376,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 = OPT.Pointer) THEN (* ok *) - ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (ap.typ.size = 1))) THEN err(123) + ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1))) THEN err(123) ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123) END ELSIF fp^.typ^.comp = OPT.DynArr THEN diff --git a/src/compiler/OPC.Mod b/src/compiler/OPC.Mod index ea629ba1..50ba59a0 100644 --- a/src/compiler/OPC.Mod +++ b/src/compiler/OPC.Mod @@ -1237,9 +1237,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) OPM.WriteString('case '); CASE form OF | OPT.Char: CharacterLiteral(caseVal) - | OPT.SInt, - OPT.Int, - OPT.LInt: OPM.WriteInt(caseVal); + | OPT.Int: OPM.WriteInt(caseVal); ELSE OPM.LogWStr("unhandled case in OPC.Case, form = "); OPM.LogWNum(form, 0); OPM.LogWLn; END; OPM.WriteString(': '); @@ -1295,9 +1293,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *) | OPT.Byte: OPM.WriteInt(con^.intval) | OPT.Bool: OPM.WriteInt(con^.intval) | OPT.Char: CharacterLiteral(con.intval) - | OPT.SInt, - OPT.Int, - OPT.LInt: OPM.WriteInt(con^.intval) + | OPT.Int: OPM.WriteInt(con^.intval) | OPT.Real: OPM.WriteReal(con^.realval, "f") | OPT.LReal: OPM.WriteReal(con^.realval, 0X) | OPT.Set: OPM.WriteString("0x"); diff --git a/src/compiler/OPP.Mod b/src/compiler/OPP.Mod index 4e53ad05..84966442 100644 --- a/src/compiler/OPP.Mod +++ b/src/compiler/OPP.Mod @@ -74,7 +74,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) IF sym = OPS.lbrak THEN OPS.Get(sym); IF ~OPT.SYSimported THEN err(135) END; ConstExpression(x); - IF x^.typ^.form IN OPT.intSet THEN sf := x^.conval^.intval; + IF x^.typ^.form = OPT.Int THEN sf := x^.conval^.intval; IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END ELSE err(51); sf := 0 END ; @@ -152,7 +152,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ELSE typ := OPT.NewStr(OPT.Comp, OPT.Array); typ^.sysflag := sysflag; ConstExpression(x); - IF x^.typ^.form IN OPT.intSet THEN n := x^.conval^.intval; + IF x^.typ^.form = OPT.Int THEN n := x^.conval^.intval; IF (n <= 0) OR (n > OPM.MaxIndex) THEN err(63); n := 1 END ELSE err(51); n := 1 END ; @@ -669,16 +669,16 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT; BEGIN lab := NIL; lastlab := NIL; LOOP ConstExpression(x); f := x^.typ^.form; - IF f IN OPT.intSet + {OPT.Char} THEN xval := x^.conval^.intval + IF f IN {OPT.Int, OPT.Char} THEN xval := x^.conval^.intval ELSE err(61); xval := 1 END; - IF f IN OPT.intSet THEN - IF ~(LabelTyp.form IN OPT.intSet) OR (LabelTyp.size < x.typ.size) THEN err(60) END + IF f = OPT.Int THEN + IF ~(LabelTyp.form = OPT.Int) OR (LabelTyp.size < x.typ.size) THEN err(60) END ELSIF LabelTyp.form # f THEN err(60) END ; IF sym = OPS.upto THEN OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval; - IF (y^.typ^.form # f) & ~((f IN OPT.intSet) & (y^.typ^.form IN OPT.intSet)) THEN err(60) END ; + IF (y^.typ^.form # f) & ~((f = OPT.Int) & (y^.typ^.form = OPT.Int)) THEN err(60) END ; IF yval < xval THEN err(63); yval := xval END ELSE yval := xval END ; @@ -714,7 +714,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) BEGIN Expression(x); pos := OPM.errpos; IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126) - ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.LInt}) THEN err(125) + ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.Int}) THEN err(125) END ; CheckSym(OPS.of); cases := NIL; lastcase := NIL; n := 0; LOOP @@ -802,7 +802,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) ELSIF sym = OPS.for THEN OPS.Get(sym); IF sym = OPS.ident THEN qualident(id); - IF ~(id^.typ^.form IN OPT.intSet) THEN err(68) END ; + IF ~(id^.typ^.form = OPT.Int) THEN err(68) END ; CheckSym(OPS.becomes); Expression(y); pos := OPM.errpos; x := OPB.NewLeaf(id); OPB.Assign(x, y); SetPos(x); CheckSym(OPS.to); Expression(y); pos := OPM.errpos; @@ -817,7 +817,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *) END ; z := OPB.NewLeaf(t); OPB.Assign(z, y); SetPos(z); OPB.Link(stat, last, z); y := OPB.NewLeaf(t) - ELSIF ~(y^.typ^.form IN OPT.intSet) OR (y.typ.size > x.left.typ.size) THEN err(113) + ELSIF ~(y^.typ^.form = OPT.Int) OR (y.typ.size > x.left.typ.size) THEN err(113) END ; OPB.Link(stat, last, x); IF sym = OPS.by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ; diff --git a/src/compiler/OPT.Mod b/src/compiler/OPT.Mod index 4b1eda69..82c1b477 100644 --- a/src/compiler/OPT.Mod +++ b/src/compiler/OPT.Mod @@ -91,12 +91,12 @@ TYPE CONST (* Struct.form values *) Undef* = 0; Byte* = 1; Bool* = 2; Char* = 3; - SInt* = 4; Int* = 5; LInt* = 6; + Int* = 5; Real* = 7; LReal* = 8; Set* = 9; String* = 10; NilTyp* = 11; NoTyp* = 12; Pointer* = 13; ProcTyp* = 14; Comp* = 15; - intSet* = {SInt..LInt}; realSet* = {Real, LReal}; + realSet* = {Real, LReal}; (* Struct.comp - Composite structure forms *) Basic* = 1; Array* = 2; DynArr* = 3; Record* = 4; @@ -224,7 +224,7 @@ END IntType; PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct; VAR i: INTEGER; BEGIN - ASSERT(x.form IN intSet); + ASSERT(x.form = Int); ASSERT((dir = 1) OR (dir = -1)); (* Not sure if StPar0 (which calls this) always gets the baseiest type. This ASSERT will tell me. *) @@ -517,9 +517,7 @@ BEGIN CASE f OF | Bool, Char, - SInt, - Int, - LInt: OPM.FPrint(fprint, obj^.conval^.intval) + Int: OPM.FPrint(fprint, obj^.conval^.intval) | Set: OPM.FPrintSet(fprint, obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.FPrintReal(fprint, rval) | LReal: OPM.FPrintLReal(fprint, obj^.conval^.realval) @@ -632,9 +630,7 @@ BEGIN | Byte, Char, Bool: OPM.SymRCh(ch); conval^.intval := ORD(ch) - | SInt, - Int, - LInt: conval^.intval := OPM.SymRInt() + | Int: conval^.intval := OPM.SymRInt() | Set: OPM.SymRSet(conval^.setval) | Real: OPM.SymRReal(rval); conval^.realval := rval; conval^.intval := OPM.ConstNotAlloc @@ -706,7 +702,7 @@ END InTProc; PROCEDURE InTyp(tag: LONGINT): Struct; BEGIN - IF tag IN intSet THEN + IF tag = Int THEN RETURN IntType(OPM.SymRInt()) ELSE RETURN impCtxt.ref[tag] @@ -1027,7 +1023,7 @@ END Import; VAR strobj: Object; BEGIN IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref); - IF typ.ref IN intSet THEN OPM.SymWInt(typ.size) END + IF typ.ref = Int THEN OPM.SymWInt(typ.size) END ELSE OPM.SymWInt(Sstruct); typ^.ref := expCtxt.ref; INC(expCtxt.ref); @@ -1072,9 +1068,7 @@ END Import; CASE f OF | Bool, Char: OPM.SymWCh(CHR(obj^.conval^.intval)) - | SInt, - Int, - LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) + | Int: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size) | Set: OPM.SymWSet(obj^.conval^.setval) | Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval) | LReal: OPM.SymWLReal(obj^.conval^.realval) @@ -1222,7 +1216,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; (*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*) EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp); EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp); - EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp); +(*EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp);*) + EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp); EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *) EnterBoolConst("TRUE", 1); @@ -1253,9 +1248,9 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0; impCtxt.ref[Byte] := bytetyp; impCtxt.ref[Bool] := booltyp; impCtxt.ref[Char] := chartyp; - impCtxt.ref[SInt] := sinttyp; +(*impCtxt.ref[SInt] := sinttyp;*) impCtxt.ref[Int] := inttyp; - impCtxt.ref[LInt] := linttyp; +(*impCtxt.ref[LInt] := linttyp;*) impCtxt.ref[Real] := realtyp; impCtxt.ref[LReal] := lrltyp; impCtxt.ref[Set] := settyp; diff --git a/src/compiler/OPV.Mod b/src/compiler/OPV.Mod index 997fdccb..6eb2ffb0 100644 --- a/src/compiler/OPV.Mod +++ b/src/compiler/OPV.Mod @@ -297,7 +297,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 PROCEDURE SizeCast(from, to: LONGINT); BEGIN - IF (from # to) & ((from > OPM.CIntSize) OR (to > OPM.CIntSize)) THEN + IF (from # to) & ((from > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN CASE to OF |1: OPM.WriteString("(SYSTEM_INT8)"); |2: OPM.WriteString("(SYSTEM_INT16)"); @@ -312,7 +312,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 VAR from, to: INTEGER; BEGIN from := n^.typ^.form; to := newtype.form; IF to = OPT.Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen) - ELSIF to IN OPT.intSet THEN + ELSIF to = OPT.Int THEN IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END; OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma); @@ -474,13 +474,9 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 OPM.WriteString("(void*)") (* type extension *) END ELSE - IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form IN OPT.intSet) THEN (* real promotion *) + IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form = OPT.Int) THEN (* real promotion *) OPM.WriteString("(double)"); prec := 9 - (* - ELSIF (form IN OPT.intSet) & (typ.size = OPM.LIntSize) & (n.typ.form <= OPT.LInt) & (n.typ.size < OPM.LIntSize) THEN (* integral promotion *) - OPM.WriteString("(LONGINT)"); prec := 9 - *) - ELSIF form IN OPT.intSet THEN + ELSIF form = OPT.Int THEN SizeCast(n.typ.size, typ.size) END END @@ -490,7 +486,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END; IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN expr(n^.left, prec) (* avoid cast in lvalue *) - ELSIF (form IN OPT.intSet) & (n^.class = OPT.Nconst) THEN + ELSIF (form = OPT.Int) & (n^.class = OPT.Nconst) THEN ParIntLiteral(n.conval.intval, n.typ.size) ELSE expr(n, prec) @@ -582,8 +578,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 expr(l, exprPrec) END | OPT.val: IF ~(l^.class IN {OPT.Nvar, OPT.Nvarpar, OPT.Nfield, OPT.Nindex}) (*SYSTEM*) - OR (n^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp}) - & (l^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp}) + OR (n^.typ^.form IN {OPT.Int, OPT.Pointer, OPT.Set, OPT.ProcTyp}) + & (l^.typ^.form IN {OPT.Int, OPT.Pointer, OPT.Set, OPT.ProcTyp}) & (n^.typ^.size = l^.typ^.size) THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen); @@ -670,7 +666,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96 END | OPS.slash: IF form = OPT.Set THEN OPM.WriteString(" ^ ") ELSE OPM.WriteString(" / "); - IF (r^.obj = NIL) OR (r^.obj^.typ^.form IN OPT.intSet) THEN + IF (r^.obj = NIL) OR (r^.obj^.typ^.form = OPT.Int) THEN OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen) END END