Remove all use of forms SInt and LInt and remove intSet using just Int instead.

This commit is contained in:
David Brown 2016-08-31 18:33:53 +01:00
parent 0508097ffe
commit a1fd798f6d
62 changed files with 828 additions and 861 deletions

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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:

View file

@ -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 {

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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(')');

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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 {

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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:

View file

@ -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 {

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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(')');

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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 {

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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:

View file

@ -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)

View file

@ -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);

View file

@ -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;

View file

@ -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(')');

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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:

View file

@ -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 {

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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(')');

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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;
}

View file

@ -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 {

View file

@ -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);

View file

@ -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;

View file

@ -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);

View file

@ -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:

View file

@ -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)

View file

@ -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);

View file

@ -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;

View file

@ -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(')');

View file

@ -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);
}
}