mirror of
https://github.com/vishapoberon/compiler.git
synced 2026-04-06 19:12:25 +00:00
Remove all use of forms SInt and LInt and remove intSet using just Int instead.
This commit is contained in:
parent
0508097ffe
commit
a1fd798f6d
62 changed files with 828 additions and 861 deletions
|
|
@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x)
|
||||||
{
|
{
|
||||||
CHAR b[2];
|
CHAR b[2];
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 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)
|
void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
|
||||||
{
|
{
|
||||||
CHAR b[4];
|
CHAR b[4];
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 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)
|
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];
|
CHAR b[4];
|
||||||
LONGINT l;
|
LONGINT l;
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||||
l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)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)
|
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;
|
s = 0;
|
||||||
n = 0;
|
n = 0;
|
||||||
Files_Read(&*R, R__typ, (void*)&ch);
|
Files_Read(&*R, R__typ, (void*)&ch);
|
||||||
while (ch >= 128) {
|
while ((SYSTEM_INT16)ch >= 128) {
|
||||||
n += __ASH((ch - 128), s);
|
n += __ASH(((SYSTEM_INT16)ch - 128), s);
|
||||||
s += 7;
|
s += 7;
|
||||||
Files_Read(&*R, R__typ, (void*)&ch);
|
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;
|
*x = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x)
|
||||||
{
|
{
|
||||||
CHAR b[4];
|
CHAR b[4];
|
||||||
LONGINT i;
|
LONGINT i;
|
||||||
i = __VAL(LONGINT, x);
|
i = (LONGINT)x;
|
||||||
b[0] = (CHAR)i;
|
b[0] = (CHAR)i;
|
||||||
b[1] = (CHAR)__ASHR(i, 8);
|
b[1] = (CHAR)__ASHR(i, 8);
|
||||||
b[2] = (CHAR)__ASHR(i, 16);
|
b[2] = (CHAR)__ASHR(i, 16);
|
||||||
|
|
|
||||||
|
|
@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
||||||
new = Heap_NEWREC((SYSTEM_ADRINT)&blksz);
|
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 - 4, 0, LONGINT);
|
||||||
__PUT(tag, blksz, LONGINT);
|
__PUT(tag, blksz, LONGINT);
|
||||||
__PUT(tag + 4, -4, LONGINT);
|
__PUT(tag + 4, -4, LONGINT);
|
||||||
__PUT(__VAL(LONGINT, new) - 4, tag, LONGINT);
|
__PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT);
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = new;
|
_o_result = new;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
__GET(tag, offset, LONGINT);
|
__GET(tag, offset, LONGINT);
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
p = Heap_FetchAddress(fld);
|
p = Heap_FetchAddress(fld);
|
||||||
__PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
|
||||||
} else {
|
} else {
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
n = Heap_FetchAddress(fld);
|
n = Heap_FetchAddress(fld);
|
||||||
|
|
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
if (!__ODD(tagbits)) {
|
if (!__ODD(tagbits)) {
|
||||||
__PUT(n - 4, tagbits + 1, LONGINT);
|
__PUT(n - 4, tagbits + 1, LONGINT);
|
||||||
__PUT(q - 4, tag + 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;
|
p = q;
|
||||||
q = n;
|
q = n;
|
||||||
tag = tagbits;
|
tag = tagbits;
|
||||||
|
|
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
|
|
||||||
static void Heap_MarkP (SYSTEM_PTR p)
|
static void Heap_MarkP (SYSTEM_PTR p)
|
||||||
{
|
{
|
||||||
Heap_Mark(__VAL(LONGINT, p));
|
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Heap_Scan (void)
|
static void Heap_Scan (void)
|
||||||
|
|
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
|
||||||
} else {
|
} else {
|
||||||
prev->next = n->next;
|
prev->next = n->next;
|
||||||
}
|
}
|
||||||
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
|
||||||
if (prev == NIL) {
|
if (prev == NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -572,7 +572,7 @@ void Heap_FINALL (void)
|
||||||
while (Heap_fin != NIL) {
|
while (Heap_fin != NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
Heap_fin = Heap_fin->next;
|
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;
|
Heap_FinNode f;
|
||||||
__NEW(f, Heap_FinDesc);
|
__NEW(f, Heap_FinDesc);
|
||||||
f->obj = __VAL(LONGINT, obj);
|
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
|
||||||
f->finalize = finalize;
|
f->finalize = finalize;
|
||||||
f->marked = 1;
|
f->marked = 1;
|
||||||
f->next = Heap_fin;
|
f->next = Heap_fin;
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y)
|
||||||
f = y->typ->form;
|
f = y->typ->form;
|
||||||
if ((*x)->class >= 7) {
|
if ((*x)->class >= 7) {
|
||||||
OPB_err(79);
|
OPB_err(79);
|
||||||
} else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) {
|
} else if (f != 5 || __IN(y->class, 0x0300)) {
|
||||||
OPB_err(80);
|
OPB_err(80);
|
||||||
y->typ = OPT_inttyp;
|
y->typ = OPT_inttyp;
|
||||||
}
|
}
|
||||||
|
|
@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if ((__IN(f, 0x70) && y->typ->form == 9)) {
|
} else if ((f == 5 && y->typ->form == 9)) {
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (k < 0 || k > OPM_MaxSet) {
|
if (k < 0 || k > OPM_MaxSet) {
|
||||||
|
|
@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x01f0)) {
|
if (!__IN(f, 0x01a0)) {
|
||||||
OPB_err(96);
|
OPB_err(96);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(f, 0x03f0)) {
|
if (__IN(f, 0x03a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-2147483647-1)) {
|
if (z->conval->intval == (-2147483647-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
if (__IN(f, 0x01f0)) {
|
if (__IN(f, 0x01a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-2147483647-1)) {
|
if (z->conval->intval == (-2147483647-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
case 22:
|
case 22:
|
||||||
if (f == 3) {
|
if (f == 3) {
|
||||||
if (z->class == 7) {
|
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;
|
z->obj = NIL;
|
||||||
} else {
|
} else {
|
||||||
z = NewOp__29(op, typ, z);
|
z = NewOp__29(op, typ, z);
|
||||||
|
|
@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
||||||
z->obj = NIL;
|
z->obj = NIL;
|
||||||
|
|
@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
z->typ = OPT_linttyp;
|
z->typ = OPT_linttyp;
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
if ((__IN(f, 0x70) && z->class == 7)) {
|
if ((f == 5 && z->class == 7)) {
|
||||||
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
||||||
z = NewOp__29(op, typ, z);
|
z = NewOp__29(op, typ, z);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void)
|
||||||
case 0:
|
case 0:
|
||||||
res = 9;
|
res = 9;
|
||||||
break;
|
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) {
|
if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) {
|
||||||
res = 11;
|
res = 11;
|
||||||
} else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) {
|
} 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;
|
__GUARDEQP(yval, OPT_ConstDesc) = *xval;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (x->typ->size <= y->typ->size) {
|
if (x->typ->size <= y->typ->size) {
|
||||||
x->typ = y->typ;
|
x->typ = y->typ;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 8) {
|
} else if (g == 8) {
|
||||||
|
|
@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 7) {
|
} else if (g == 7) {
|
||||||
|
|
@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
xv = xval->intval;
|
xv = xval->intval;
|
||||||
yv = yval->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))) {
|
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;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->realval = xval->intval / (REAL)yval->intval;
|
xval->realval = xval->intval / (REAL)yval->intval;
|
||||||
OPB_CheckRealType(7, 205, xval);
|
OPB_CheckRealType(7, 205, xval);
|
||||||
|
|
@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = __DIV(xval->intval, yval->intval);
|
xval->intval = __DIV(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = (int)__MOD(xval->intval, yval->intval);
|
xval->intval = (int)__MOD(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval);
|
temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval);
|
||||||
if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) {
|
if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) {
|
||||||
xval->intval += yval->intval;
|
xval->intval += yval->intval;
|
||||||
|
|
@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
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)) {
|
if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) {
|
||||||
xval->intval -= yval->intval;
|
xval->intval -= yval->intval;
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
g = typ->form;
|
g = typ->form;
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (f > g) {
|
if (f > g) {
|
||||||
OPB_SetIntType(*x);
|
OPB_SetIntType(*x);
|
||||||
if ((*x)->typ->size > typ->size) {
|
if ((*x)->typ->size > typ->size) {
|
||||||
|
|
@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(*x)->obj = NIL;
|
(*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) {
|
if ((*x)->left->typ == typ) {
|
||||||
*x = (*x)->left;
|
*x = (*x)->left;
|
||||||
}
|
}
|
||||||
|
|
@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) {
|
if ((g == 5 && y->typ->size < z->typ->size)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x01f0)) {
|
} else if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
|
|
@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x01f0)) {
|
if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
|
|
@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
val = z->conval->intval;
|
val = z->conval->intval;
|
||||||
if (val == 1) {
|
if (val == 1) {
|
||||||
|
|
@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((y->class == 7 && y->conval->intval == 0)) {
|
if ((y->class == 7 && y->conval->intval == 0)) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
}
|
}
|
||||||
|
|
@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
val = y->conval->intval;
|
val = y->conval->intval;
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
|
|
@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
if (y->conval->intval == 0) {
|
if (y->conval->intval == 0) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
|
|
@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(105);
|
OPB_err(105);
|
||||||
typ = OPT_undftyp;
|
typ = OPT_undftyp;
|
||||||
}
|
}
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((z->class == 7 && z->conval->intval == 0)) {
|
if ((z->class == 7 && z->conval->intval == 0)) {
|
||||||
do_ = 0;
|
do_ = 0;
|
||||||
z = y;
|
z = y;
|
||||||
|
|
@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(106);
|
OPB_err(106);
|
||||||
typ = OPT_undftyp;
|
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);
|
NewOp__39(op, typ, &z, y);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
|
||||||
LONGINT k, l;
|
LONGINT k, l;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
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) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (0 > k || k > OPM_MaxSet) {
|
if (0 > k || k > OPM_MaxSet) {
|
||||||
|
|
@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x)
|
||||||
LONGINT k;
|
LONGINT k;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x70)) {
|
} else if ((*x)->typ->form != 5) {
|
||||||
OPB_err(93);
|
OPB_err(93);
|
||||||
} else if ((*x)->class == 7) {
|
} else if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
|
|
@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
case 0: case 10:
|
case 0: case 10:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (!((__IN(g, 0x7a) && y->size == 1))) {
|
if (!((__IN(g, 0x2a) && y->size == 1))) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (!__IN(g, 0x70) || x->size < y->size) {
|
if (g != 5 || x->size < y->size) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(g, 0xf0)) {
|
if (!__IN(g, 0xe0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (!__IN(g, 0x01f0)) {
|
if (!__IN(g, 0x01e0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
break;
|
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);
|
OPB_Convert(&ynode, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
switch (fctno) {
|
switch (fctno) {
|
||||||
case 0:
|
case 0:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(0);
|
x = OPB_NewIntConst(0);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(255);
|
x = OPB_NewIntConst(255);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 9:
|
case 9:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x71)) {
|
} else if (__IN(f, 0x21)) {
|
||||||
OPB_Convert(&x, OPT_chartyp);
|
OPB_Convert(&x, OPT_chartyp);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 10:
|
case 10:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 11:
|
case 11:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 13: case 14:
|
case 13: case 14:
|
||||||
if (OPB_NotVar(x)) {
|
if (OPB_NotVar(x)) {
|
||||||
OPB_err(112);
|
OPB_err(112);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else if (x->readonly) {
|
} else if (x->readonly) {
|
||||||
OPB_err(76);
|
OPB_err(76);
|
||||||
|
|
@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if (x->typ->size != OPM_LIntSize) {
|
if (x->typ->size != OPM_LIntSize) {
|
||||||
OPB_Convert(&x, OPT_linttyp);
|
OPB_Convert(&x, OPT_linttyp);
|
||||||
}
|
}
|
||||||
|
|
@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x027a)) {
|
} else if (!__IN(f, 0x022a)) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 24: case 25: case 28: case 31:
|
case 24: case 25: case 28: case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 26: case 27:
|
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) {
|
if (x->conval->intval < 0 || x->conval->intval > -1) {
|
||||||
OPB_err(220);
|
OPB_err(220);
|
||||||
}
|
}
|
||||||
|
|
@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
} else {
|
} else {
|
||||||
if (x->typ != p->typ) {
|
if (x->typ != p->typ) {
|
||||||
if ((x->class == 7 && __IN(f, 0x70))) {
|
if ((x->class == 7 && f == 5)) {
|
||||||
OPB_Convert(&x, p->typ);
|
OPB_Convert(&x, p->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 15: case 16:
|
case 15: case 16:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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))) {
|
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) {
|
||||||
OPB_err(202);
|
OPB_err(202);
|
||||||
}
|
}
|
||||||
|
|
@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
if (!__IN(f, 0x70) || x->class != 7) {
|
if (!(f == 5) || x->class != 7) {
|
||||||
OPB_err(69);
|
OPB_err(69);
|
||||||
} else if (x->typ->size == 1) {
|
} else if (x->typ->size == 1) {
|
||||||
L = x->conval->intval;
|
L = (SYSTEM_INT16)x->conval->intval;
|
||||||
typ = p->typ;
|
typ = p->typ;
|
||||||
while ((L > 0 && __IN(typ->comp, 0x0c))) {
|
while ((L > 0 && __IN(typ->comp, 0x0c))) {
|
||||||
typ = typ->BaseTyp;
|
typ = typ->BaseTyp;
|
||||||
|
|
@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if ((p->class == 7 && x->class == 7)) {
|
if ((p->class == 7 && x->class == 7)) {
|
||||||
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
||||||
OPB_err(208);
|
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) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp == 3) {
|
} 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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
OPB_err(63);
|
||||||
}
|
}
|
||||||
|
|
@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else {
|
} else {
|
||||||
if (fctno == 22) {
|
if (fctno == 22) {
|
||||||
|
|
@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 28:
|
case 28:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(12, 26, p, x);
|
p = NewOp__53(12, 26, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 30:
|
case 30:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(19, 30, p, x);
|
p = NewOp__53(19, 30, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 31:
|
case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
p->link = x;
|
p->link = x;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
x->conval = OPT_NewConst();
|
x->conval = OPT_NewConst();
|
||||||
|
|
@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n)
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp != 3) {
|
} else if (p->typ->comp != 3) {
|
||||||
OPB_err(64);
|
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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
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)) {
|
} else if ((fctno == 31 && n == 2)) {
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
node = OPT_NewNode(19);
|
node = OPT_NewNode(19);
|
||||||
node->subcl = 31;
|
node->subcl = 31;
|
||||||
node->right = p;
|
node->right = p;
|
||||||
|
|
@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa
|
||||||
ftyp = ftyp->BaseTyp;
|
ftyp = ftyp->BaseTyp;
|
||||||
atyp = atyp->BaseTyp;
|
atyp = atyp->BaseTyp;
|
||||||
if ((fvarpar && ftyp == OPT_bytetyp)) {
|
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)) {
|
if (__IN(18, OPM_opt)) {
|
||||||
OPB_err(-301);
|
OPB_err(-301);
|
||||||
}
|
}
|
||||||
|
|
@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) {
|
} 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);
|
OPB_err(123);
|
||||||
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
||||||
OPB_err(123);
|
OPB_err(123);
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len)
|
||||||
i = 0;
|
i = 0;
|
||||||
h = 0;
|
h = 0;
|
||||||
while ((s[__X(i, s__len)] != 0x00 && i < 5)) {
|
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;
|
i += 1;
|
||||||
}
|
}
|
||||||
_o_result = (int)__MOD(h, 105);
|
_o_result = (int)__MOD(h, 105);
|
||||||
|
|
@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis)
|
||||||
INTEGER _for__9;
|
INTEGER _for__9;
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_CProcDefs(obj->left, vis);
|
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;
|
ext = obj->conval->ext;
|
||||||
i = 1;
|
i = 1;
|
||||||
if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) {
|
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);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(0x09);
|
OPM_Write(0x09);
|
||||||
}
|
}
|
||||||
_for__9 = (*obj->conval->ext)[0];
|
_for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0];
|
||||||
i = i;
|
i = i;
|
||||||
while (i <= _for__9) {
|
while (i <= _for__9) {
|
||||||
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
|
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
|
||||||
|
|
@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis)
|
||||||
first = 1;
|
first = 1;
|
||||||
while ((obj != NIL && obj->mode != 13)) {
|
while ((obj != NIL && obj->mode != 13)) {
|
||||||
if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) {
|
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) {
|
if (!first) {
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
}
|
}
|
||||||
|
|
@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis)
|
||||||
{
|
{
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_IncludeImports(obj->left, vis);
|
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_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256);
|
||||||
}
|
}
|
||||||
OPC_IncludeImports(obj->right, vis);
|
OPC_IncludeImports(obj->right, vis);
|
||||||
|
|
@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap)
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__ASSERT(ap->typ->comp == 4, 0);
|
__ASSERT(ap->typ->comp == 4, 0);
|
||||||
if (ap->mode == 2) {
|
if (ap->mode == 2) {
|
||||||
if (ap->mnolev != OPM_level) {
|
if ((SYSTEM_INT16)ap->mnolev != OPM_level) {
|
||||||
OPM_WriteStringVar((void*)ap->scope->name, 256);
|
OPM_WriteStringVar((void*)ap->scope->name, 256);
|
||||||
OPM_WriteString((CHAR*)"_s->", 5);
|
OPM_WriteString((CHAR*)"_s->", 5);
|
||||||
OPC_Ident(ap);
|
OPC_Ident(ap);
|
||||||
|
|
@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l)
|
||||||
OPM_Write('"');
|
OPM_Write('"');
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < l) {
|
while (i < l) {
|
||||||
c = s[__X(i, s__len)];
|
c = (SYSTEM_INT16)s[__X(i, s__len)];
|
||||||
if (c < 32 || c > 126) {
|
if (c < 32 || c > 126) {
|
||||||
OPM_Write('\\');
|
OPM_Write('\\');
|
||||||
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
|
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
|
||||||
|
|
@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(caseVal);
|
OPC_CharacterLiteral(caseVal);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(caseVal);
|
OPM_WriteInt(caseVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(con->intval);
|
OPC_CharacterLiteral(con->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(con->intval);
|
OPM_WriteInt(con->intval);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
|
|
|
||||||
|
|
@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
case 'B':
|
case 'B':
|
||||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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_IntSize == 2 || OPM_IntSize == 4, 0);
|
||||||
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
|
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
|
||||||
|
|
@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos)
|
||||||
if (pos >= OPM_ErrorLineLimitPos) {
|
if (pos >= OPM_ErrorLineLimitPos) {
|
||||||
pos = OPM_ErrorLineLimitPos - 1;
|
pos = OPM_ErrorLineLimitPos - 1;
|
||||||
}
|
}
|
||||||
i = (pos - OPM_ErrorLineStartPos);
|
i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos);
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
OPM_LogW(' ');
|
OPM_LogW(' ');
|
||||||
i -= 1;
|
i -= 1;
|
||||||
|
|
@ -532,12 +532,12 @@ void OPM_err (INTEGER n)
|
||||||
|
|
||||||
void OPM_FPrint (LONGINT *fp, LONGINT val)
|
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)
|
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)
|
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)) {
|
if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) {
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
if ((*S).class == 3) {
|
if ((*S).class == 3) {
|
||||||
*size = (*S).i;
|
*size = (SYSTEM_INT16)(*S).i;
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
} else {
|
} else {
|
||||||
OPM_Mark(-157, -1);
|
OPM_Mark(-157, -1);
|
||||||
}
|
}
|
||||||
if ((*S).class == 3) {
|
if ((*S).class == 3) {
|
||||||
*align = (*S).i;
|
*align = (SYSTEM_INT16)(*S).i;
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
} else {
|
} else {
|
||||||
OPM_Mark(-157, -1);
|
OPM_Mark(-157, -1);
|
||||||
|
|
@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i)
|
||||||
|
|
||||||
void OPM_SymWSet (SET s)
|
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)
|
void OPM_SymWReal (REAL r)
|
||||||
|
|
@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i)
|
||||||
{
|
{
|
||||||
CHAR s[3];
|
CHAR s[3];
|
||||||
INTEGER digit;
|
INTEGER digit;
|
||||||
digit = __ASHR(i, 4);
|
digit = __ASHR((SYSTEM_INT16)i, 4);
|
||||||
if (digit < 10) {
|
if (digit < 10) {
|
||||||
s[0] = (CHAR)(48 + digit);
|
s[0] = (CHAR)(48 + digit);
|
||||||
} else {
|
} else {
|
||||||
s[0] = (CHAR)(87 + digit);
|
s[0] = (CHAR)(87 + digit);
|
||||||
}
|
}
|
||||||
digit = __MASK(i, -16);
|
digit = __MASK((SYSTEM_INT16)i, -16);
|
||||||
if (digit < 10) {
|
if (digit < 10) {
|
||||||
s[1] = (CHAR)(48 + digit);
|
s[1] = (CHAR)(48 + digit);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ static void OPP_err (INTEGER n)
|
||||||
|
|
||||||
static void OPP_CheckSym (INTEGER s)
|
static void OPP_CheckSym (INTEGER s)
|
||||||
{
|
{
|
||||||
if (OPP_sym == s) {
|
if ((SYSTEM_INT16)OPP_sym == s) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
} else {
|
} else {
|
||||||
OPM_err(s);
|
OPM_err(s);
|
||||||
|
|
@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
|
||||||
OPP_err(135);
|
OPP_err(135);
|
||||||
}
|
}
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
sf = x->conval->intval;
|
sf = x->conval->intval;
|
||||||
if (sf < 0 || sf > 1) {
|
if (sf < 0 || sf > 1) {
|
||||||
OPP_err(220);
|
OPP_err(220);
|
||||||
|
|
@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
|
||||||
OPP_err(51);
|
OPP_err(51);
|
||||||
sf = 0;
|
sf = 0;
|
||||||
}
|
}
|
||||||
*sysflag = sf;
|
*sysflag = (SYSTEM_INT16)sf;
|
||||||
OPP_CheckSym(23);
|
OPP_CheckSym(23);
|
||||||
} else {
|
} else {
|
||||||
*sysflag = default_;
|
*sysflag = default_;
|
||||||
|
|
@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned)
|
||||||
*typ = OPT_NewStr(15, 2);
|
*typ = OPT_NewStr(15, 2);
|
||||||
(*typ)->sysflag = sysflag;
|
(*typ)->sysflag = sysflag;
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
n = x->conval->intval;
|
n = x->conval->intval;
|
||||||
if (n <= 0 || n > OPM_MaxIndex) {
|
if (n <= 0 || n > OPM_MaxIndex) {
|
||||||
OPP_err(63);
|
OPP_err(63);
|
||||||
|
|
@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x)
|
||||||
OPT_Node y = NIL;
|
OPT_Node y = NIL;
|
||||||
SHORTINT m;
|
SHORTINT m;
|
||||||
INTEGER n;
|
INTEGER n;
|
||||||
m = (*x)->obj->adr;
|
m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr);
|
||||||
n = 0;
|
n = 0;
|
||||||
if (OPP_sym == 30) {
|
if (OPP_sym == 30) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
|
|
@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
|
||||||
for (;;) {
|
for (;;) {
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
if (__IN(f, 0x78)) {
|
if (__IN(f, 0x28)) {
|
||||||
xval = x->conval->intval;
|
xval = x->conval->intval;
|
||||||
} else {
|
} else {
|
||||||
OPP_err(61);
|
OPP_err(61);
|
||||||
xval = 1;
|
xval = 1;
|
||||||
}
|
}
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) {
|
if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) {
|
||||||
OPP_err(60);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
} else if (LabelTyp->form != f) {
|
} else if ((SYSTEM_INT16)LabelTyp->form != f) {
|
||||||
OPP_err(60);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
if (OPP_sym == 21) {
|
if (OPP_sym == 21) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
OPP_ConstExpression(&y);
|
OPP_ConstExpression(&y);
|
||||||
yval = y->conval->intval;
|
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);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
if (yval < xval) {
|
if (yval < xval) {
|
||||||
|
|
@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x)
|
||||||
*StatSeq__30_s->pos = OPM_errpos;
|
*StatSeq__30_s->pos = OPM_errpos;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPP_err(126);
|
OPP_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x78)) {
|
} else if (!__IN((*x)->typ->form, 0x38)) {
|
||||||
OPP_err(125);
|
OPP_err(125);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(25);
|
OPP_CheckSym(25);
|
||||||
|
|
@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
if (OPP_sym == 38) {
|
if (OPP_sym == 38) {
|
||||||
OPP_qualident(&id);
|
OPP_qualident(&id);
|
||||||
if (!__IN(id->typ->form, 0x70)) {
|
if (!(id->typ->form == 5)) {
|
||||||
OPP_err(68);
|
OPP_err(68);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(34);
|
OPP_CheckSym(34);
|
||||||
|
|
@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
SetPos__35(z);
|
SetPos__35(z);
|
||||||
OPB_Link(&*stat, &last, z);
|
OPB_Link(&*stat, &last, z);
|
||||||
y = OPB_NewLeaf(t);
|
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);
|
OPP_err(113);
|
||||||
}
|
}
|
||||||
OPB_Link(&*stat, &last, x);
|
OPB_Link(&*stat, &last, x);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym)
|
||||||
if (OPS_intval == 2) {
|
if (OPS_intval == 2) {
|
||||||
*sym = 35;
|
*sym = 35;
|
||||||
OPS_numtyp = 1;
|
OPS_numtyp = 1;
|
||||||
OPS_intval = OPS_str[0];
|
OPS_intval = (SYSTEM_INT16)OPS_str[0];
|
||||||
} else {
|
} else {
|
||||||
*sym = 37;
|
*sym = 37;
|
||||||
}
|
}
|
||||||
|
|
@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
if (ch <= '9') {
|
if (ch <= '9') {
|
||||||
_o_result = ch - 48;
|
_o_result = (SYSTEM_INT16)ch - 48;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else if (hex) {
|
} else if (hex) {
|
||||||
_o_result = (ch - 65) + 10;
|
_o_result = ((SYSTEM_INT16)ch - 65) + 10;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else {
|
} else {
|
||||||
OPS_err(2);
|
OPS_err(2);
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__ASSERT(__IN(x->form, 0x70), 0);
|
__ASSERT(x->form == 5, 0);
|
||||||
__ASSERT(dir == 1 || dir == -1, 0);
|
__ASSERT(dir == 1 || dir == -1, 0);
|
||||||
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len)
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
ch = name[__X(i, name__len)];
|
ch = name[__X(i, name__len)];
|
||||||
OPM_FPrint(&*fp, ch);
|
OPM_FPrint(&*fp, (SYSTEM_INT16)ch);
|
||||||
i += 1;
|
i += 1;
|
||||||
} while (!(ch == 0x00));
|
} while (!(ch == 0x00));
|
||||||
}
|
}
|
||||||
|
|
@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj)
|
||||||
f = obj->typ->form;
|
f = obj->typ->form;
|
||||||
OPM_FPrint(&fprint, f);
|
OPM_FPrint(&fprint, f);
|
||||||
switch (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);
|
OPM_FPrint(&fprint, obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj)
|
||||||
} else if (obj->mode == 9) {
|
} else if (obj->mode == 9) {
|
||||||
OPT_FPrintSign(&fprint, obj->typ, obj->link);
|
OPT_FPrintSign(&fprint, obj->typ, obj->link);
|
||||||
ext = obj->conval->ext;
|
ext = obj->conval->ext;
|
||||||
m = (*ext)[0];
|
m = (SYSTEM_INT16)(*ext)[0];
|
||||||
f = 1;
|
f = 1;
|
||||||
OPM_FPrint(&fprint, m);
|
OPM_FPrint(&fprint, m);
|
||||||
while (f <= m) {
|
while (f <= m) {
|
||||||
OPM_FPrint(&fprint, (*ext)[__X(f, 256)]);
|
OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]);
|
||||||
f += 1;
|
f += 1;
|
||||||
}
|
}
|
||||||
} else if (obj->mode == 5) {
|
} else if (obj->mode == 5) {
|
||||||
|
|
@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case 1: case 3: case 2:
|
case 1: case 3: case 2:
|
||||||
OPM_SymRCh(&ch);
|
OPM_SymRCh(&ch);
|
||||||
conval->intval = ch;
|
conval->intval = (SYSTEM_INT16)ch;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
conval->intval = OPM_SymRInt();
|
conval->intval = OPM_SymRInt();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
|
||||||
static OPT_Struct OPT_InTyp (LONGINT tag)
|
static OPT_Struct OPT_InTyp (LONGINT tag)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
if (__IN(tag, 0x70)) {
|
if (tag == 5) {
|
||||||
_o_result = OPT_IntType(OPM_SymRInt());
|
_o_result = OPT_IntType(OPM_SymRInt());
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ)
|
||||||
obj->vis = 0;
|
obj->vis = 0;
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
if (tag == 35) {
|
if (tag == 35) {
|
||||||
(*typ)->sysflag = OPM_SymRInt();
|
(*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt();
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
}
|
}
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
|
|
@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno)
|
||||||
obj->mode = 9;
|
obj->mode = 9;
|
||||||
ext = OPT_NewExt();
|
ext = OPT_NewExt();
|
||||||
obj->conval->ext = ext;
|
obj->conval->ext = ext;
|
||||||
s = OPM_SymRInt();
|
s = (SYSTEM_INT16)OPM_SymRInt();
|
||||||
(*ext)[0] = (CHAR)s;
|
(*ext)[0] = (CHAR)s;
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i <= s) {
|
while (i <= s) {
|
||||||
|
|
@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ)
|
||||||
OPT_Object strobj = NIL;
|
OPT_Object strobj = NIL;
|
||||||
if (typ->ref < OPT_expCtxt.ref) {
|
if (typ->ref < OPT_expCtxt.ref) {
|
||||||
OPM_SymWInt(-typ->ref);
|
OPM_SymWInt(-typ->ref);
|
||||||
if (__IN(typ->ref, 0x70)) {
|
if (typ->ref == 5) {
|
||||||
OPM_SymWInt(typ->size);
|
OPM_SymWInt(typ->size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj)
|
||||||
case 2: case 3:
|
case 2: case 3:
|
||||||
OPM_SymWCh((CHAR)obj->conval->intval);
|
OPM_SymWCh((CHAR)obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_SymWInt(obj->conval->intval);
|
OPM_SymWInt(obj->conval->intval);
|
||||||
OPM_SymWInt(obj->typ->size);
|
OPM_SymWInt(obj->typ->size);
|
||||||
break;
|
break;
|
||||||
|
|
@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj)
|
||||||
OPM_SymWInt(33);
|
OPM_SymWInt(33);
|
||||||
OPT_OutSign(obj->typ, obj->link);
|
OPT_OutSign(obj->typ, obj->link);
|
||||||
ext = obj->conval->ext;
|
ext = obj->conval->ext;
|
||||||
j = (*ext)[0];
|
j = (SYSTEM_INT16)(*ext)[0];
|
||||||
i = 1;
|
i = 1;
|
||||||
OPM_SymWInt(j);
|
OPM_SymWInt(j);
|
||||||
while (i <= 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*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
|
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*)"FALSE", 0);
|
||||||
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
||||||
OPT_EnterProc((CHAR*)"HALT", 0);
|
OPT_EnterProc((CHAR*)"HALT", 0);
|
||||||
|
|
@ -1904,9 +1904,7 @@ export void *OPT__init(void)
|
||||||
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
||||||
OPT_impCtxt.ref[2] = OPT_booltyp;
|
OPT_impCtxt.ref[2] = OPT_booltyp;
|
||||||
OPT_impCtxt.ref[3] = OPT_chartyp;
|
OPT_impCtxt.ref[3] = OPT_chartyp;
|
||||||
OPT_impCtxt.ref[4] = OPT_sinttyp;
|
|
||||||
OPT_impCtxt.ref[5] = OPT_inttyp;
|
OPT_impCtxt.ref[5] = OPT_inttyp;
|
||||||
OPT_impCtxt.ref[6] = OPT_linttyp;
|
|
||||||
OPT_impCtxt.ref[7] = OPT_realtyp;
|
OPT_impCtxt.ref[7] = OPT_realtyp;
|
||||||
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
||||||
OPT_impCtxt.ref[9] = OPT_settyp;
|
OPT_impCtxt.ref[9] = OPT_settyp;
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ)
|
||||||
}
|
}
|
||||||
typ->size = offset;
|
typ->size = offset;
|
||||||
typ->align = base;
|
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) {
|
} else if (c == 2) {
|
||||||
OPV_TypSize(typ->BaseTyp);
|
OPV_TypSize(typ->BaseTyp);
|
||||||
typ->size = typ->n * typ->BaseTyp->size;
|
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)
|
static void OPV_SizeCast (LONGINT from, LONGINT to)
|
||||||
{
|
{
|
||||||
if ((from != to && (from > 4 || to > 4))) {
|
if ((from != to && (from > 4 || to != 4))) {
|
||||||
switch (to) {
|
switch (to) {
|
||||||
case 1:
|
case 1:
|
||||||
OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14);
|
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);
|
OPM_WriteString((CHAR*)"__SETOF(", 9);
|
||||||
OPV_Entier(n, -1);
|
OPV_Entier(n, -1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
} else if (__IN(to, 0x70)) {
|
} else if (to == 5) {
|
||||||
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
||||||
OPM_WriteString((CHAR*)"__SHORT", 8);
|
OPM_WriteString((CHAR*)"__SHORT", 8);
|
||||||
if (OPV_SideEffects(n)) {
|
if (OPV_SideEffects(n)) {
|
||||||
|
|
@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec)
|
||||||
obj = n->obj;
|
obj = n->obj;
|
||||||
class = n->class;
|
class = n->class;
|
||||||
designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp);
|
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;
|
designPrec = 9;
|
||||||
}
|
}
|
||||||
if (prec > designPrec) {
|
if (prec > designPrec) {
|
||||||
|
|
@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec)
|
||||||
if (__IN(3, OPM_opt)) {
|
if (__IN(3, OPM_opt)) {
|
||||||
if (typ->comp == 4) {
|
if (typ->comp == 4) {
|
||||||
OPM_WriteString((CHAR*)"__GUARDR(", 10);
|
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_WriteStringVar((void*)obj->scope->name, 256);
|
||||||
OPM_WriteString((CHAR*)"__curr->", 9);
|
OPM_WriteString((CHAR*)"__curr->", 9);
|
||||||
OPC_Ident(obj);
|
OPC_Ident(obj);
|
||||||
|
|
@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) {
|
if ((__IN(form, 0x0180) && n->typ->form == 5)) {
|
||||||
OPM_WriteString((CHAR*)"(double)", 9);
|
OPM_WriteString((CHAR*)"(double)", 9);
|
||||||
prec = 9;
|
prec = 9;
|
||||||
} else if (__IN(form, 0x70)) {
|
} else if (form == 5) {
|
||||||
OPV_SizeCast(n->typ->size, typ->size);
|
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)) {
|
if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) {
|
||||||
OPV_expr(n->left, prec);
|
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);
|
OPV_ParIntLiteral(n->conval->intval, n->typ->size);
|
||||||
} else {
|
} else {
|
||||||
OPV_expr(n, prec);
|
OPV_expr(n, prec);
|
||||||
|
|
@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 29:
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPM_WriteString((CHAR*)" ^ ", 4);
|
OPM_WriteString((CHAR*)" ^ ", 4);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)" / ", 4);
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
|
||||||
Platform_ArgVecPtr av = NIL;
|
Platform_ArgVecPtr av = NIL;
|
||||||
Platform_MainStackFrame = argvadr;
|
Platform_MainStackFrame = argvadr;
|
||||||
Platform_ArgCount = argc;
|
Platform_ArgCount = argc;
|
||||||
av = __VAL(Platform_ArgVecPtr, argvadr);
|
av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr;
|
||||||
Platform_ArgVector = (*av)[0];
|
Platform_ArgVector = (*av)[0];
|
||||||
Platform_HaltCode = -128;
|
Platform_HaltCode = -128;
|
||||||
Platform_HeapInitHeap();
|
Platform_HeapInitHeap();
|
||||||
|
|
@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
|
||||||
{
|
{
|
||||||
Platform_ArgVec av = NIL;
|
Platform_ArgVec av = NIL;
|
||||||
if (n < Platform_ArgCount) {
|
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);
|
__COPY(*(*av)[__X(n, 1024)], val, val__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val)
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
k = 0;
|
k = 0;
|
||||||
d = s[__X(i, 64)] - 48;
|
d = (SYSTEM_INT16)s[__X(i, 64)] - 48;
|
||||||
while ((d >= 0 && d <= 9)) {
|
while ((d >= 0 && d <= 9)) {
|
||||||
k = k * 10 + d;
|
k = k * 10 + d;
|
||||||
i += 1;
|
i += 1;
|
||||||
d = s[__X(i, 64)] - 48;
|
d = (SYSTEM_INT16)s[__X(i, 64)] - 48;
|
||||||
}
|
}
|
||||||
if (s[0] == '-') {
|
if (s[0] == '-') {
|
||||||
k = -k;
|
k = -k;
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex)
|
||||||
{
|
{
|
||||||
CHAR c;
|
CHAR c;
|
||||||
__GET((SYSTEM_ADRINT)x + 3, c, CHAR);
|
__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);
|
__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)
|
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;
|
l = b__len;
|
||||||
while (i < l) {
|
while (i < l) {
|
||||||
by = __VAL(CHAR, b[__X(i, b__len)]);
|
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), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4));
|
||||||
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16));
|
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16));
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n,
|
||||||
INTEGER len, destLen, i;
|
INTEGER len, destLen, i;
|
||||||
__DUP(source, source__len, CHAR);
|
__DUP(source, source__len, CHAR);
|
||||||
len = Strings_Length(source, source__len);
|
len = Strings_Length(source, source__len);
|
||||||
destLen = dest__len - 1;
|
destLen = (SYSTEM_INT16)dest__len - 1;
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
pos = 0;
|
pos = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) {
|
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);
|
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 ('9' < ch) {
|
||||||
if (('A' <= ch && ch <= 'F')) {
|
if (('A' <= ch && ch <= 'F')) {
|
||||||
hex = 1;
|
hex = 1;
|
||||||
ch = (CHAR)(ch - 7);
|
ch = (CHAR)((SYSTEM_INT16)ch - 7);
|
||||||
} else if (('a' <= ch && ch <= 'f')) {
|
} else if (('a' <= ch && ch <= 'f')) {
|
||||||
hex = 1;
|
hex = 1;
|
||||||
ch = (CHAR)(ch - 39);
|
ch = (CHAR)((SYSTEM_INT16)ch - 39);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
if (i - j > 8) {
|
if (i - j > 8) {
|
||||||
j = i - 8;
|
j = i - 8;
|
||||||
}
|
}
|
||||||
k = d[__X(j, 32)] - 48;
|
k = (SYSTEM_INT16)d[__X(j, 32)] - 48;
|
||||||
j += 1;
|
j += 1;
|
||||||
if ((i - j == 7 && k >= 8)) {
|
if ((i - j == 7 && k >= 8)) {
|
||||||
k -= 16;
|
k -= 16;
|
||||||
}
|
}
|
||||||
while (j < i) {
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
if (neg) {
|
if (neg) {
|
||||||
|
|
@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
y = (LONGREAL)0;
|
y = (LONGREAL)0;
|
||||||
g = (LONGREAL)1;
|
g = (LONGREAL)1;
|
||||||
do {
|
do {
|
||||||
y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48);
|
y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == h));
|
} while (!(j == h));
|
||||||
while (j < i) {
|
while (j < i) {
|
||||||
g = g / (LONGREAL)(LONGREAL)10;
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
ReadScaleFactor__32();
|
ReadScaleFactor__32();
|
||||||
|
|
@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
x = (REAL)0;
|
x = (REAL)0;
|
||||||
f = (REAL)1;
|
f = (REAL)1;
|
||||||
do {
|
do {
|
||||||
x = x * (REAL)10 + (d[__X(j, 32)] - 48);
|
x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == h));
|
} while (!(j == h));
|
||||||
while (j < i) {
|
while (j < i) {
|
||||||
f = f / (REAL)(REAL)10;
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
if (ch == 'E') {
|
if (ch == 'E') {
|
||||||
|
|
@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
(*S).class = 3;
|
(*S).class = 3;
|
||||||
k = 0;
|
k = 0;
|
||||||
do {
|
do {
|
||||||
k = k * 10 + (d[__X(j, 32)] - 48);
|
k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == i));
|
} while (!(j == i));
|
||||||
if (neg) {
|
if (neg) {
|
||||||
|
|
@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
|
||||||
} else {
|
} else {
|
||||||
Texts_Write(&*W, W__typ, ' ');
|
Texts_Write(&*W, W__typ, ' ');
|
||||||
}
|
}
|
||||||
e = __ASHR((e - 1023) * 77, 8);
|
e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8);
|
||||||
if (e >= 0) {
|
if (e >= 0) {
|
||||||
x = x / (LONGREAL)Reals_TenL(e);
|
x = x / (LONGREAL)Reals_TenL(e);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x)
|
||||||
{
|
{
|
||||||
CHAR b[2];
|
CHAR b[2];
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 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)
|
void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
|
||||||
{
|
{
|
||||||
CHAR b[4];
|
CHAR b[4];
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 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)
|
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];
|
CHAR b[4];
|
||||||
LONGINT l;
|
LONGINT l;
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||||
l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)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)
|
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;
|
s = 0;
|
||||||
n = 0;
|
n = 0;
|
||||||
Files_Read(&*R, R__typ, (void*)&ch);
|
Files_Read(&*R, R__typ, (void*)&ch);
|
||||||
while (ch >= 128) {
|
while ((SYSTEM_INT16)ch >= 128) {
|
||||||
n += __ASH((ch - 128), s);
|
n += __ASH(((SYSTEM_INT16)ch - 128), s);
|
||||||
s += 7;
|
s += 7;
|
||||||
Files_Read(&*R, R__typ, (void*)&ch);
|
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;
|
*x = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x)
|
||||||
{
|
{
|
||||||
CHAR b[4];
|
CHAR b[4];
|
||||||
LONGINT i;
|
LONGINT i;
|
||||||
i = __VAL(LONGINT, x);
|
i = (LONGINT)x;
|
||||||
b[0] = (CHAR)i;
|
b[0] = (CHAR)i;
|
||||||
b[1] = (CHAR)__ASHR(i, 8);
|
b[1] = (CHAR)__ASHR(i, 8);
|
||||||
b[2] = (CHAR)__ASHR(i, 16);
|
b[2] = (CHAR)__ASHR(i, 16);
|
||||||
|
|
|
||||||
|
|
@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
||||||
new = Heap_NEWREC((SYSTEM_ADRINT)&blksz);
|
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 - 4, 0, LONGINT);
|
||||||
__PUT(tag, blksz, LONGINT);
|
__PUT(tag, blksz, LONGINT);
|
||||||
__PUT(tag + 4, -4, LONGINT);
|
__PUT(tag + 4, -4, LONGINT);
|
||||||
__PUT(__VAL(LONGINT, new) - 4, tag, LONGINT);
|
__PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT);
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = new;
|
_o_result = new;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
__GET(tag, offset, LONGINT);
|
__GET(tag, offset, LONGINT);
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
p = Heap_FetchAddress(fld);
|
p = Heap_FetchAddress(fld);
|
||||||
__PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
|
||||||
} else {
|
} else {
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
n = Heap_FetchAddress(fld);
|
n = Heap_FetchAddress(fld);
|
||||||
|
|
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
if (!__ODD(tagbits)) {
|
if (!__ODD(tagbits)) {
|
||||||
__PUT(n - 4, tagbits + 1, LONGINT);
|
__PUT(n - 4, tagbits + 1, LONGINT);
|
||||||
__PUT(q - 4, tag + 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;
|
p = q;
|
||||||
q = n;
|
q = n;
|
||||||
tag = tagbits;
|
tag = tagbits;
|
||||||
|
|
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
|
|
||||||
static void Heap_MarkP (SYSTEM_PTR p)
|
static void Heap_MarkP (SYSTEM_PTR p)
|
||||||
{
|
{
|
||||||
Heap_Mark(__VAL(LONGINT, p));
|
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Heap_Scan (void)
|
static void Heap_Scan (void)
|
||||||
|
|
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
|
||||||
} else {
|
} else {
|
||||||
prev->next = n->next;
|
prev->next = n->next;
|
||||||
}
|
}
|
||||||
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
|
||||||
if (prev == NIL) {
|
if (prev == NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -572,7 +572,7 @@ void Heap_FINALL (void)
|
||||||
while (Heap_fin != NIL) {
|
while (Heap_fin != NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
Heap_fin = Heap_fin->next;
|
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;
|
Heap_FinNode f;
|
||||||
__NEW(f, Heap_FinDesc);
|
__NEW(f, Heap_FinDesc);
|
||||||
f->obj = __VAL(LONGINT, obj);
|
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
|
||||||
f->finalize = finalize;
|
f->finalize = finalize;
|
||||||
f->marked = 1;
|
f->marked = 1;
|
||||||
f->next = Heap_fin;
|
f->next = Heap_fin;
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y)
|
||||||
f = y->typ->form;
|
f = y->typ->form;
|
||||||
if ((*x)->class >= 7) {
|
if ((*x)->class >= 7) {
|
||||||
OPB_err(79);
|
OPB_err(79);
|
||||||
} else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) {
|
} else if (f != 5 || __IN(y->class, 0x0300)) {
|
||||||
OPB_err(80);
|
OPB_err(80);
|
||||||
y->typ = OPT_inttyp;
|
y->typ = OPT_inttyp;
|
||||||
}
|
}
|
||||||
|
|
@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if ((__IN(f, 0x70) && y->typ->form == 9)) {
|
} else if ((f == 5 && y->typ->form == 9)) {
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (k < 0 || k > OPM_MaxSet) {
|
if (k < 0 || k > OPM_MaxSet) {
|
||||||
|
|
@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x01f0)) {
|
if (!__IN(f, 0x01a0)) {
|
||||||
OPB_err(96);
|
OPB_err(96);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(f, 0x03f0)) {
|
if (__IN(f, 0x03a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-2147483647-1)) {
|
if (z->conval->intval == (-2147483647-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
if (__IN(f, 0x01f0)) {
|
if (__IN(f, 0x01a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-2147483647-1)) {
|
if (z->conval->intval == (-2147483647-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
case 22:
|
case 22:
|
||||||
if (f == 3) {
|
if (f == 3) {
|
||||||
if (z->class == 7) {
|
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;
|
z->obj = NIL;
|
||||||
} else {
|
} else {
|
||||||
z = NewOp__29(op, typ, z);
|
z = NewOp__29(op, typ, z);
|
||||||
|
|
@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
||||||
z->obj = NIL;
|
z->obj = NIL;
|
||||||
|
|
@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
z->typ = OPT_linttyp;
|
z->typ = OPT_linttyp;
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
if ((__IN(f, 0x70) && z->class == 7)) {
|
if ((f == 5 && z->class == 7)) {
|
||||||
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
||||||
z = NewOp__29(op, typ, z);
|
z = NewOp__29(op, typ, z);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void)
|
||||||
case 0:
|
case 0:
|
||||||
res = 9;
|
res = 9;
|
||||||
break;
|
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) {
|
if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) {
|
||||||
res = 11;
|
res = 11;
|
||||||
} else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) {
|
} 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;
|
__GUARDEQP(yval, OPT_ConstDesc) = *xval;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (x->typ->size <= y->typ->size) {
|
if (x->typ->size <= y->typ->size) {
|
||||||
x->typ = y->typ;
|
x->typ = y->typ;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 8) {
|
} else if (g == 8) {
|
||||||
|
|
@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 7) {
|
} else if (g == 7) {
|
||||||
|
|
@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
xv = xval->intval;
|
xv = xval->intval;
|
||||||
yv = yval->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))) {
|
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;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->realval = xval->intval / (REAL)yval->intval;
|
xval->realval = xval->intval / (REAL)yval->intval;
|
||||||
OPB_CheckRealType(7, 205, xval);
|
OPB_CheckRealType(7, 205, xval);
|
||||||
|
|
@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = __DIV(xval->intval, yval->intval);
|
xval->intval = __DIV(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = (int)__MOD(xval->intval, yval->intval);
|
xval->intval = (int)__MOD(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval);
|
temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval);
|
||||||
if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) {
|
if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) {
|
||||||
xval->intval += yval->intval;
|
xval->intval += yval->intval;
|
||||||
|
|
@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
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)) {
|
if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) {
|
||||||
xval->intval -= yval->intval;
|
xval->intval -= yval->intval;
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
g = typ->form;
|
g = typ->form;
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (f > g) {
|
if (f > g) {
|
||||||
OPB_SetIntType(*x);
|
OPB_SetIntType(*x);
|
||||||
if ((*x)->typ->size > typ->size) {
|
if ((*x)->typ->size > typ->size) {
|
||||||
|
|
@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(*x)->obj = NIL;
|
(*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) {
|
if ((*x)->left->typ == typ) {
|
||||||
*x = (*x)->left;
|
*x = (*x)->left;
|
||||||
}
|
}
|
||||||
|
|
@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) {
|
if ((g == 5 && y->typ->size < z->typ->size)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x01f0)) {
|
} else if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
|
|
@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x01f0)) {
|
if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
|
|
@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
val = z->conval->intval;
|
val = z->conval->intval;
|
||||||
if (val == 1) {
|
if (val == 1) {
|
||||||
|
|
@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((y->class == 7 && y->conval->intval == 0)) {
|
if ((y->class == 7 && y->conval->intval == 0)) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
}
|
}
|
||||||
|
|
@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
val = y->conval->intval;
|
val = y->conval->intval;
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
|
|
@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
if (y->conval->intval == 0) {
|
if (y->conval->intval == 0) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
|
|
@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(105);
|
OPB_err(105);
|
||||||
typ = OPT_undftyp;
|
typ = OPT_undftyp;
|
||||||
}
|
}
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((z->class == 7 && z->conval->intval == 0)) {
|
if ((z->class == 7 && z->conval->intval == 0)) {
|
||||||
do_ = 0;
|
do_ = 0;
|
||||||
z = y;
|
z = y;
|
||||||
|
|
@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(106);
|
OPB_err(106);
|
||||||
typ = OPT_undftyp;
|
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);
|
NewOp__39(op, typ, &z, y);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
|
||||||
LONGINT k, l;
|
LONGINT k, l;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
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) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (0 > k || k > OPM_MaxSet) {
|
if (0 > k || k > OPM_MaxSet) {
|
||||||
|
|
@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x)
|
||||||
LONGINT k;
|
LONGINT k;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x70)) {
|
} else if ((*x)->typ->form != 5) {
|
||||||
OPB_err(93);
|
OPB_err(93);
|
||||||
} else if ((*x)->class == 7) {
|
} else if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
|
|
@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
case 0: case 10:
|
case 0: case 10:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (!((__IN(g, 0x7a) && y->size == 1))) {
|
if (!((__IN(g, 0x2a) && y->size == 1))) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (!__IN(g, 0x70) || x->size < y->size) {
|
if (g != 5 || x->size < y->size) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(g, 0xf0)) {
|
if (!__IN(g, 0xe0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (!__IN(g, 0x01f0)) {
|
if (!__IN(g, 0x01e0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
break;
|
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);
|
OPB_Convert(&ynode, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
switch (fctno) {
|
switch (fctno) {
|
||||||
case 0:
|
case 0:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(0);
|
x = OPB_NewIntConst(0);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(255);
|
x = OPB_NewIntConst(255);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 9:
|
case 9:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x71)) {
|
} else if (__IN(f, 0x21)) {
|
||||||
OPB_Convert(&x, OPT_chartyp);
|
OPB_Convert(&x, OPT_chartyp);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 10:
|
case 10:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 11:
|
case 11:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 13: case 14:
|
case 13: case 14:
|
||||||
if (OPB_NotVar(x)) {
|
if (OPB_NotVar(x)) {
|
||||||
OPB_err(112);
|
OPB_err(112);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else if (x->readonly) {
|
} else if (x->readonly) {
|
||||||
OPB_err(76);
|
OPB_err(76);
|
||||||
|
|
@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if (x->typ->size != OPM_LIntSize) {
|
if (x->typ->size != OPM_LIntSize) {
|
||||||
OPB_Convert(&x, OPT_linttyp);
|
OPB_Convert(&x, OPT_linttyp);
|
||||||
}
|
}
|
||||||
|
|
@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x027a)) {
|
} else if (!__IN(f, 0x022a)) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 24: case 25: case 28: case 31:
|
case 24: case 25: case 28: case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 26: case 27:
|
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) {
|
if (x->conval->intval < 0 || x->conval->intval > -1) {
|
||||||
OPB_err(220);
|
OPB_err(220);
|
||||||
}
|
}
|
||||||
|
|
@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
} else {
|
} else {
|
||||||
if (x->typ != p->typ) {
|
if (x->typ != p->typ) {
|
||||||
if ((x->class == 7 && __IN(f, 0x70))) {
|
if ((x->class == 7 && f == 5)) {
|
||||||
OPB_Convert(&x, p->typ);
|
OPB_Convert(&x, p->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 15: case 16:
|
case 15: case 16:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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))) {
|
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) {
|
||||||
OPB_err(202);
|
OPB_err(202);
|
||||||
}
|
}
|
||||||
|
|
@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
if (!__IN(f, 0x70) || x->class != 7) {
|
if (!(f == 5) || x->class != 7) {
|
||||||
OPB_err(69);
|
OPB_err(69);
|
||||||
} else if (x->typ->size == 1) {
|
} else if (x->typ->size == 1) {
|
||||||
L = x->conval->intval;
|
L = (SYSTEM_INT16)x->conval->intval;
|
||||||
typ = p->typ;
|
typ = p->typ;
|
||||||
while ((L > 0 && __IN(typ->comp, 0x0c))) {
|
while ((L > 0 && __IN(typ->comp, 0x0c))) {
|
||||||
typ = typ->BaseTyp;
|
typ = typ->BaseTyp;
|
||||||
|
|
@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if ((p->class == 7 && x->class == 7)) {
|
if ((p->class == 7 && x->class == 7)) {
|
||||||
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
||||||
OPB_err(208);
|
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) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp == 3) {
|
} 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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
OPB_err(63);
|
||||||
}
|
}
|
||||||
|
|
@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else {
|
} else {
|
||||||
if (fctno == 22) {
|
if (fctno == 22) {
|
||||||
|
|
@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 28:
|
case 28:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(12, 26, p, x);
|
p = NewOp__53(12, 26, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 30:
|
case 30:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(19, 30, p, x);
|
p = NewOp__53(19, 30, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 31:
|
case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
p->link = x;
|
p->link = x;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
x->conval = OPT_NewConst();
|
x->conval = OPT_NewConst();
|
||||||
|
|
@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n)
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp != 3) {
|
} else if (p->typ->comp != 3) {
|
||||||
OPB_err(64);
|
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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
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)) {
|
} else if ((fctno == 31 && n == 2)) {
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
node = OPT_NewNode(19);
|
node = OPT_NewNode(19);
|
||||||
node->subcl = 31;
|
node->subcl = 31;
|
||||||
node->right = p;
|
node->right = p;
|
||||||
|
|
@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa
|
||||||
ftyp = ftyp->BaseTyp;
|
ftyp = ftyp->BaseTyp;
|
||||||
atyp = atyp->BaseTyp;
|
atyp = atyp->BaseTyp;
|
||||||
if ((fvarpar && ftyp == OPT_bytetyp)) {
|
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)) {
|
if (__IN(18, OPM_opt)) {
|
||||||
OPB_err(-301);
|
OPB_err(-301);
|
||||||
}
|
}
|
||||||
|
|
@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) {
|
} 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);
|
OPB_err(123);
|
||||||
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
||||||
OPB_err(123);
|
OPB_err(123);
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len)
|
||||||
i = 0;
|
i = 0;
|
||||||
h = 0;
|
h = 0;
|
||||||
while ((s[__X(i, s__len)] != 0x00 && i < 5)) {
|
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;
|
i += 1;
|
||||||
}
|
}
|
||||||
_o_result = (int)__MOD(h, 105);
|
_o_result = (int)__MOD(h, 105);
|
||||||
|
|
@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis)
|
||||||
INTEGER _for__9;
|
INTEGER _for__9;
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_CProcDefs(obj->left, vis);
|
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;
|
ext = obj->conval->ext;
|
||||||
i = 1;
|
i = 1;
|
||||||
if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) {
|
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);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(0x09);
|
OPM_Write(0x09);
|
||||||
}
|
}
|
||||||
_for__9 = (*obj->conval->ext)[0];
|
_for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0];
|
||||||
i = i;
|
i = i;
|
||||||
while (i <= _for__9) {
|
while (i <= _for__9) {
|
||||||
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
|
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
|
||||||
|
|
@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis)
|
||||||
first = 1;
|
first = 1;
|
||||||
while ((obj != NIL && obj->mode != 13)) {
|
while ((obj != NIL && obj->mode != 13)) {
|
||||||
if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) {
|
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) {
|
if (!first) {
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
}
|
}
|
||||||
|
|
@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis)
|
||||||
{
|
{
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_IncludeImports(obj->left, vis);
|
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_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256);
|
||||||
}
|
}
|
||||||
OPC_IncludeImports(obj->right, vis);
|
OPC_IncludeImports(obj->right, vis);
|
||||||
|
|
@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap)
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__ASSERT(ap->typ->comp == 4, 0);
|
__ASSERT(ap->typ->comp == 4, 0);
|
||||||
if (ap->mode == 2) {
|
if (ap->mode == 2) {
|
||||||
if (ap->mnolev != OPM_level) {
|
if ((SYSTEM_INT16)ap->mnolev != OPM_level) {
|
||||||
OPM_WriteStringVar((void*)ap->scope->name, 256);
|
OPM_WriteStringVar((void*)ap->scope->name, 256);
|
||||||
OPM_WriteString((CHAR*)"_s->", 5);
|
OPM_WriteString((CHAR*)"_s->", 5);
|
||||||
OPC_Ident(ap);
|
OPC_Ident(ap);
|
||||||
|
|
@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l)
|
||||||
OPM_Write('"');
|
OPM_Write('"');
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < l) {
|
while (i < l) {
|
||||||
c = s[__X(i, s__len)];
|
c = (SYSTEM_INT16)s[__X(i, s__len)];
|
||||||
if (c < 32 || c > 126) {
|
if (c < 32 || c > 126) {
|
||||||
OPM_Write('\\');
|
OPM_Write('\\');
|
||||||
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
|
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
|
||||||
|
|
@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(caseVal);
|
OPC_CharacterLiteral(caseVal);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(caseVal);
|
OPM_WriteInt(caseVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(con->intval);
|
OPC_CharacterLiteral(con->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(con->intval);
|
OPM_WriteInt(con->intval);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
|
|
|
||||||
|
|
@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
case 'B':
|
case 'B':
|
||||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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_IntSize == 2 || OPM_IntSize == 4, 0);
|
||||||
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
|
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
|
||||||
|
|
@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos)
|
||||||
if (pos >= OPM_ErrorLineLimitPos) {
|
if (pos >= OPM_ErrorLineLimitPos) {
|
||||||
pos = OPM_ErrorLineLimitPos - 1;
|
pos = OPM_ErrorLineLimitPos - 1;
|
||||||
}
|
}
|
||||||
i = (pos - OPM_ErrorLineStartPos);
|
i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos);
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
OPM_LogW(' ');
|
OPM_LogW(' ');
|
||||||
i -= 1;
|
i -= 1;
|
||||||
|
|
@ -532,12 +532,12 @@ void OPM_err (INTEGER n)
|
||||||
|
|
||||||
void OPM_FPrint (LONGINT *fp, LONGINT val)
|
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)
|
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)
|
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)) {
|
if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) {
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
if ((*S).class == 3) {
|
if ((*S).class == 3) {
|
||||||
*size = (*S).i;
|
*size = (SYSTEM_INT16)(*S).i;
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
} else {
|
} else {
|
||||||
OPM_Mark(-157, -1);
|
OPM_Mark(-157, -1);
|
||||||
}
|
}
|
||||||
if ((*S).class == 3) {
|
if ((*S).class == 3) {
|
||||||
*align = (*S).i;
|
*align = (SYSTEM_INT16)(*S).i;
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
} else {
|
} else {
|
||||||
OPM_Mark(-157, -1);
|
OPM_Mark(-157, -1);
|
||||||
|
|
@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i)
|
||||||
|
|
||||||
void OPM_SymWSet (SET s)
|
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)
|
void OPM_SymWReal (REAL r)
|
||||||
|
|
@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i)
|
||||||
{
|
{
|
||||||
CHAR s[3];
|
CHAR s[3];
|
||||||
INTEGER digit;
|
INTEGER digit;
|
||||||
digit = __ASHR(i, 4);
|
digit = __ASHR((SYSTEM_INT16)i, 4);
|
||||||
if (digit < 10) {
|
if (digit < 10) {
|
||||||
s[0] = (CHAR)(48 + digit);
|
s[0] = (CHAR)(48 + digit);
|
||||||
} else {
|
} else {
|
||||||
s[0] = (CHAR)(87 + digit);
|
s[0] = (CHAR)(87 + digit);
|
||||||
}
|
}
|
||||||
digit = __MASK(i, -16);
|
digit = __MASK((SYSTEM_INT16)i, -16);
|
||||||
if (digit < 10) {
|
if (digit < 10) {
|
||||||
s[1] = (CHAR)(48 + digit);
|
s[1] = (CHAR)(48 + digit);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ static void OPP_err (INTEGER n)
|
||||||
|
|
||||||
static void OPP_CheckSym (INTEGER s)
|
static void OPP_CheckSym (INTEGER s)
|
||||||
{
|
{
|
||||||
if (OPP_sym == s) {
|
if ((SYSTEM_INT16)OPP_sym == s) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
} else {
|
} else {
|
||||||
OPM_err(s);
|
OPM_err(s);
|
||||||
|
|
@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
|
||||||
OPP_err(135);
|
OPP_err(135);
|
||||||
}
|
}
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
sf = x->conval->intval;
|
sf = x->conval->intval;
|
||||||
if (sf < 0 || sf > 1) {
|
if (sf < 0 || sf > 1) {
|
||||||
OPP_err(220);
|
OPP_err(220);
|
||||||
|
|
@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
|
||||||
OPP_err(51);
|
OPP_err(51);
|
||||||
sf = 0;
|
sf = 0;
|
||||||
}
|
}
|
||||||
*sysflag = sf;
|
*sysflag = (SYSTEM_INT16)sf;
|
||||||
OPP_CheckSym(23);
|
OPP_CheckSym(23);
|
||||||
} else {
|
} else {
|
||||||
*sysflag = default_;
|
*sysflag = default_;
|
||||||
|
|
@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned)
|
||||||
*typ = OPT_NewStr(15, 2);
|
*typ = OPT_NewStr(15, 2);
|
||||||
(*typ)->sysflag = sysflag;
|
(*typ)->sysflag = sysflag;
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
n = x->conval->intval;
|
n = x->conval->intval;
|
||||||
if (n <= 0 || n > OPM_MaxIndex) {
|
if (n <= 0 || n > OPM_MaxIndex) {
|
||||||
OPP_err(63);
|
OPP_err(63);
|
||||||
|
|
@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x)
|
||||||
OPT_Node y = NIL;
|
OPT_Node y = NIL;
|
||||||
SHORTINT m;
|
SHORTINT m;
|
||||||
INTEGER n;
|
INTEGER n;
|
||||||
m = (*x)->obj->adr;
|
m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr);
|
||||||
n = 0;
|
n = 0;
|
||||||
if (OPP_sym == 30) {
|
if (OPP_sym == 30) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
|
|
@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
|
||||||
for (;;) {
|
for (;;) {
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
if (__IN(f, 0x78)) {
|
if (__IN(f, 0x28)) {
|
||||||
xval = x->conval->intval;
|
xval = x->conval->intval;
|
||||||
} else {
|
} else {
|
||||||
OPP_err(61);
|
OPP_err(61);
|
||||||
xval = 1;
|
xval = 1;
|
||||||
}
|
}
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) {
|
if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) {
|
||||||
OPP_err(60);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
} else if (LabelTyp->form != f) {
|
} else if ((SYSTEM_INT16)LabelTyp->form != f) {
|
||||||
OPP_err(60);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
if (OPP_sym == 21) {
|
if (OPP_sym == 21) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
OPP_ConstExpression(&y);
|
OPP_ConstExpression(&y);
|
||||||
yval = y->conval->intval;
|
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);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
if (yval < xval) {
|
if (yval < xval) {
|
||||||
|
|
@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x)
|
||||||
*StatSeq__30_s->pos = OPM_errpos;
|
*StatSeq__30_s->pos = OPM_errpos;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPP_err(126);
|
OPP_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x78)) {
|
} else if (!__IN((*x)->typ->form, 0x38)) {
|
||||||
OPP_err(125);
|
OPP_err(125);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(25);
|
OPP_CheckSym(25);
|
||||||
|
|
@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
if (OPP_sym == 38) {
|
if (OPP_sym == 38) {
|
||||||
OPP_qualident(&id);
|
OPP_qualident(&id);
|
||||||
if (!__IN(id->typ->form, 0x70)) {
|
if (!(id->typ->form == 5)) {
|
||||||
OPP_err(68);
|
OPP_err(68);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(34);
|
OPP_CheckSym(34);
|
||||||
|
|
@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
SetPos__35(z);
|
SetPos__35(z);
|
||||||
OPB_Link(&*stat, &last, z);
|
OPB_Link(&*stat, &last, z);
|
||||||
y = OPB_NewLeaf(t);
|
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);
|
OPP_err(113);
|
||||||
}
|
}
|
||||||
OPB_Link(&*stat, &last, x);
|
OPB_Link(&*stat, &last, x);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym)
|
||||||
if (OPS_intval == 2) {
|
if (OPS_intval == 2) {
|
||||||
*sym = 35;
|
*sym = 35;
|
||||||
OPS_numtyp = 1;
|
OPS_numtyp = 1;
|
||||||
OPS_intval = OPS_str[0];
|
OPS_intval = (SYSTEM_INT16)OPS_str[0];
|
||||||
} else {
|
} else {
|
||||||
*sym = 37;
|
*sym = 37;
|
||||||
}
|
}
|
||||||
|
|
@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
if (ch <= '9') {
|
if (ch <= '9') {
|
||||||
_o_result = ch - 48;
|
_o_result = (SYSTEM_INT16)ch - 48;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else if (hex) {
|
} else if (hex) {
|
||||||
_o_result = (ch - 65) + 10;
|
_o_result = ((SYSTEM_INT16)ch - 65) + 10;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else {
|
} else {
|
||||||
OPS_err(2);
|
OPS_err(2);
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__ASSERT(__IN(x->form, 0x70), 0);
|
__ASSERT(x->form == 5, 0);
|
||||||
__ASSERT(dir == 1 || dir == -1, 0);
|
__ASSERT(dir == 1 || dir == -1, 0);
|
||||||
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len)
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
ch = name[__X(i, name__len)];
|
ch = name[__X(i, name__len)];
|
||||||
OPM_FPrint(&*fp, ch);
|
OPM_FPrint(&*fp, (SYSTEM_INT16)ch);
|
||||||
i += 1;
|
i += 1;
|
||||||
} while (!(ch == 0x00));
|
} while (!(ch == 0x00));
|
||||||
}
|
}
|
||||||
|
|
@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj)
|
||||||
f = obj->typ->form;
|
f = obj->typ->form;
|
||||||
OPM_FPrint(&fprint, f);
|
OPM_FPrint(&fprint, f);
|
||||||
switch (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);
|
OPM_FPrint(&fprint, obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj)
|
||||||
} else if (obj->mode == 9) {
|
} else if (obj->mode == 9) {
|
||||||
OPT_FPrintSign(&fprint, obj->typ, obj->link);
|
OPT_FPrintSign(&fprint, obj->typ, obj->link);
|
||||||
ext = obj->conval->ext;
|
ext = obj->conval->ext;
|
||||||
m = (*ext)[0];
|
m = (SYSTEM_INT16)(*ext)[0];
|
||||||
f = 1;
|
f = 1;
|
||||||
OPM_FPrint(&fprint, m);
|
OPM_FPrint(&fprint, m);
|
||||||
while (f <= m) {
|
while (f <= m) {
|
||||||
OPM_FPrint(&fprint, (*ext)[__X(f, 256)]);
|
OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]);
|
||||||
f += 1;
|
f += 1;
|
||||||
}
|
}
|
||||||
} else if (obj->mode == 5) {
|
} else if (obj->mode == 5) {
|
||||||
|
|
@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case 1: case 3: case 2:
|
case 1: case 3: case 2:
|
||||||
OPM_SymRCh(&ch);
|
OPM_SymRCh(&ch);
|
||||||
conval->intval = ch;
|
conval->intval = (SYSTEM_INT16)ch;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
conval->intval = OPM_SymRInt();
|
conval->intval = OPM_SymRInt();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
|
||||||
static OPT_Struct OPT_InTyp (LONGINT tag)
|
static OPT_Struct OPT_InTyp (LONGINT tag)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
if (__IN(tag, 0x70)) {
|
if (tag == 5) {
|
||||||
_o_result = OPT_IntType(OPM_SymRInt());
|
_o_result = OPT_IntType(OPM_SymRInt());
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ)
|
||||||
obj->vis = 0;
|
obj->vis = 0;
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
if (tag == 35) {
|
if (tag == 35) {
|
||||||
(*typ)->sysflag = OPM_SymRInt();
|
(*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt();
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
}
|
}
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
|
|
@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno)
|
||||||
obj->mode = 9;
|
obj->mode = 9;
|
||||||
ext = OPT_NewExt();
|
ext = OPT_NewExt();
|
||||||
obj->conval->ext = ext;
|
obj->conval->ext = ext;
|
||||||
s = OPM_SymRInt();
|
s = (SYSTEM_INT16)OPM_SymRInt();
|
||||||
(*ext)[0] = (CHAR)s;
|
(*ext)[0] = (CHAR)s;
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i <= s) {
|
while (i <= s) {
|
||||||
|
|
@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ)
|
||||||
OPT_Object strobj = NIL;
|
OPT_Object strobj = NIL;
|
||||||
if (typ->ref < OPT_expCtxt.ref) {
|
if (typ->ref < OPT_expCtxt.ref) {
|
||||||
OPM_SymWInt(-typ->ref);
|
OPM_SymWInt(-typ->ref);
|
||||||
if (__IN(typ->ref, 0x70)) {
|
if (typ->ref == 5) {
|
||||||
OPM_SymWInt(typ->size);
|
OPM_SymWInt(typ->size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj)
|
||||||
case 2: case 3:
|
case 2: case 3:
|
||||||
OPM_SymWCh((CHAR)obj->conval->intval);
|
OPM_SymWCh((CHAR)obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_SymWInt(obj->conval->intval);
|
OPM_SymWInt(obj->conval->intval);
|
||||||
OPM_SymWInt(obj->typ->size);
|
OPM_SymWInt(obj->typ->size);
|
||||||
break;
|
break;
|
||||||
|
|
@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj)
|
||||||
OPM_SymWInt(33);
|
OPM_SymWInt(33);
|
||||||
OPT_OutSign(obj->typ, obj->link);
|
OPT_OutSign(obj->typ, obj->link);
|
||||||
ext = obj->conval->ext;
|
ext = obj->conval->ext;
|
||||||
j = (*ext)[0];
|
j = (SYSTEM_INT16)(*ext)[0];
|
||||||
i = 1;
|
i = 1;
|
||||||
OPM_SymWInt(j);
|
OPM_SymWInt(j);
|
||||||
while (i <= 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*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
|
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*)"FALSE", 0);
|
||||||
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
||||||
OPT_EnterProc((CHAR*)"HALT", 0);
|
OPT_EnterProc((CHAR*)"HALT", 0);
|
||||||
|
|
@ -1904,9 +1904,7 @@ export void *OPT__init(void)
|
||||||
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
||||||
OPT_impCtxt.ref[2] = OPT_booltyp;
|
OPT_impCtxt.ref[2] = OPT_booltyp;
|
||||||
OPT_impCtxt.ref[3] = OPT_chartyp;
|
OPT_impCtxt.ref[3] = OPT_chartyp;
|
||||||
OPT_impCtxt.ref[4] = OPT_sinttyp;
|
|
||||||
OPT_impCtxt.ref[5] = OPT_inttyp;
|
OPT_impCtxt.ref[5] = OPT_inttyp;
|
||||||
OPT_impCtxt.ref[6] = OPT_linttyp;
|
|
||||||
OPT_impCtxt.ref[7] = OPT_realtyp;
|
OPT_impCtxt.ref[7] = OPT_realtyp;
|
||||||
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
||||||
OPT_impCtxt.ref[9] = OPT_settyp;
|
OPT_impCtxt.ref[9] = OPT_settyp;
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ)
|
||||||
}
|
}
|
||||||
typ->size = offset;
|
typ->size = offset;
|
||||||
typ->align = base;
|
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) {
|
} else if (c == 2) {
|
||||||
OPV_TypSize(typ->BaseTyp);
|
OPV_TypSize(typ->BaseTyp);
|
||||||
typ->size = typ->n * typ->BaseTyp->size;
|
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)
|
static void OPV_SizeCast (LONGINT from, LONGINT to)
|
||||||
{
|
{
|
||||||
if ((from != to && (from > 4 || to > 4))) {
|
if ((from != to && (from > 4 || to != 4))) {
|
||||||
switch (to) {
|
switch (to) {
|
||||||
case 1:
|
case 1:
|
||||||
OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14);
|
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);
|
OPM_WriteString((CHAR*)"__SETOF(", 9);
|
||||||
OPV_Entier(n, -1);
|
OPV_Entier(n, -1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
} else if (__IN(to, 0x70)) {
|
} else if (to == 5) {
|
||||||
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
||||||
OPM_WriteString((CHAR*)"__SHORT", 8);
|
OPM_WriteString((CHAR*)"__SHORT", 8);
|
||||||
if (OPV_SideEffects(n)) {
|
if (OPV_SideEffects(n)) {
|
||||||
|
|
@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec)
|
||||||
obj = n->obj;
|
obj = n->obj;
|
||||||
class = n->class;
|
class = n->class;
|
||||||
designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp);
|
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;
|
designPrec = 9;
|
||||||
}
|
}
|
||||||
if (prec > designPrec) {
|
if (prec > designPrec) {
|
||||||
|
|
@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec)
|
||||||
if (__IN(3, OPM_opt)) {
|
if (__IN(3, OPM_opt)) {
|
||||||
if (typ->comp == 4) {
|
if (typ->comp == 4) {
|
||||||
OPM_WriteString((CHAR*)"__GUARDR(", 10);
|
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_WriteStringVar((void*)obj->scope->name, 256);
|
||||||
OPM_WriteString((CHAR*)"__curr->", 9);
|
OPM_WriteString((CHAR*)"__curr->", 9);
|
||||||
OPC_Ident(obj);
|
OPC_Ident(obj);
|
||||||
|
|
@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) {
|
if ((__IN(form, 0x0180) && n->typ->form == 5)) {
|
||||||
OPM_WriteString((CHAR*)"(double)", 9);
|
OPM_WriteString((CHAR*)"(double)", 9);
|
||||||
prec = 9;
|
prec = 9;
|
||||||
} else if (__IN(form, 0x70)) {
|
} else if (form == 5) {
|
||||||
OPV_SizeCast(n->typ->size, typ->size);
|
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)) {
|
if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) {
|
||||||
OPV_expr(n->left, prec);
|
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);
|
OPV_ParIntLiteral(n->conval->intval, n->typ->size);
|
||||||
} else {
|
} else {
|
||||||
OPV_expr(n, prec);
|
OPV_expr(n, prec);
|
||||||
|
|
@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 29:
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPM_WriteString((CHAR*)" ^ ", 4);
|
OPM_WriteString((CHAR*)" ^ ", 4);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)" / ", 4);
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
|
||||||
Platform_ArgVecPtr av = NIL;
|
Platform_ArgVecPtr av = NIL;
|
||||||
Platform_MainStackFrame = argvadr;
|
Platform_MainStackFrame = argvadr;
|
||||||
Platform_ArgCount = argc;
|
Platform_ArgCount = argc;
|
||||||
av = __VAL(Platform_ArgVecPtr, argvadr);
|
av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr;
|
||||||
Platform_ArgVector = (*av)[0];
|
Platform_ArgVector = (*av)[0];
|
||||||
Platform_HaltCode = -128;
|
Platform_HaltCode = -128;
|
||||||
Platform_HeapInitHeap();
|
Platform_HeapInitHeap();
|
||||||
|
|
@ -262,7 +262,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
|
||||||
{
|
{
|
||||||
Platform_ArgVec av = NIL;
|
Platform_ArgVec av = NIL;
|
||||||
if (n < Platform_ArgCount) {
|
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);
|
__COPY(*(*av)[__X(n, 1024)], val, val__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -278,11 +278,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val)
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
k = 0;
|
k = 0;
|
||||||
d = s[__X(i, 64)] - 48;
|
d = (SYSTEM_INT16)s[__X(i, 64)] - 48;
|
||||||
while ((d >= 0 && d <= 9)) {
|
while ((d >= 0 && d <= 9)) {
|
||||||
k = k * 10 + d;
|
k = k * 10 + d;
|
||||||
i += 1;
|
i += 1;
|
||||||
d = s[__X(i, 64)] - 48;
|
d = (SYSTEM_INT16)s[__X(i, 64)] - 48;
|
||||||
}
|
}
|
||||||
if (s[0] == '-') {
|
if (s[0] == '-') {
|
||||||
k = -k;
|
k = -k;
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex)
|
||||||
{
|
{
|
||||||
CHAR c;
|
CHAR c;
|
||||||
__GET((SYSTEM_ADRINT)x + 3, c, CHAR);
|
__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);
|
__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)
|
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;
|
l = b__len;
|
||||||
while (i < l) {
|
while (i < l) {
|
||||||
by = __VAL(CHAR, b[__X(i, b__len)]);
|
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), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4));
|
||||||
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16));
|
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16));
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n,
|
||||||
INTEGER len, destLen, i;
|
INTEGER len, destLen, i;
|
||||||
__DUP(source, source__len, CHAR);
|
__DUP(source, source__len, CHAR);
|
||||||
len = Strings_Length(source, source__len);
|
len = Strings_Length(source, source__len);
|
||||||
destLen = dest__len - 1;
|
destLen = (SYSTEM_INT16)dest__len - 1;
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
pos = 0;
|
pos = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) {
|
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);
|
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 ('9' < ch) {
|
||||||
if (('A' <= ch && ch <= 'F')) {
|
if (('A' <= ch && ch <= 'F')) {
|
||||||
hex = 1;
|
hex = 1;
|
||||||
ch = (CHAR)(ch - 7);
|
ch = (CHAR)((SYSTEM_INT16)ch - 7);
|
||||||
} else if (('a' <= ch && ch <= 'f')) {
|
} else if (('a' <= ch && ch <= 'f')) {
|
||||||
hex = 1;
|
hex = 1;
|
||||||
ch = (CHAR)(ch - 39);
|
ch = (CHAR)((SYSTEM_INT16)ch - 39);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
if (i - j > 8) {
|
if (i - j > 8) {
|
||||||
j = i - 8;
|
j = i - 8;
|
||||||
}
|
}
|
||||||
k = d[__X(j, 32)] - 48;
|
k = (SYSTEM_INT16)d[__X(j, 32)] - 48;
|
||||||
j += 1;
|
j += 1;
|
||||||
if ((i - j == 7 && k >= 8)) {
|
if ((i - j == 7 && k >= 8)) {
|
||||||
k -= 16;
|
k -= 16;
|
||||||
}
|
}
|
||||||
while (j < i) {
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
if (neg) {
|
if (neg) {
|
||||||
|
|
@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
y = (LONGREAL)0;
|
y = (LONGREAL)0;
|
||||||
g = (LONGREAL)1;
|
g = (LONGREAL)1;
|
||||||
do {
|
do {
|
||||||
y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48);
|
y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == h));
|
} while (!(j == h));
|
||||||
while (j < i) {
|
while (j < i) {
|
||||||
g = g / (LONGREAL)(LONGREAL)10;
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
ReadScaleFactor__32();
|
ReadScaleFactor__32();
|
||||||
|
|
@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
x = (REAL)0;
|
x = (REAL)0;
|
||||||
f = (REAL)1;
|
f = (REAL)1;
|
||||||
do {
|
do {
|
||||||
x = x * (REAL)10 + (d[__X(j, 32)] - 48);
|
x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == h));
|
} while (!(j == h));
|
||||||
while (j < i) {
|
while (j < i) {
|
||||||
f = f / (REAL)(REAL)10;
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
if (ch == 'E') {
|
if (ch == 'E') {
|
||||||
|
|
@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
(*S).class = 3;
|
(*S).class = 3;
|
||||||
k = 0;
|
k = 0;
|
||||||
do {
|
do {
|
||||||
k = k * 10 + (d[__X(j, 32)] - 48);
|
k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == i));
|
} while (!(j == i));
|
||||||
if (neg) {
|
if (neg) {
|
||||||
|
|
@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
|
||||||
} else {
|
} else {
|
||||||
Texts_Write(&*W, W__typ, ' ');
|
Texts_Write(&*W, W__typ, ' ');
|
||||||
}
|
}
|
||||||
e = __ASHR((e - 1023) * 77, 8);
|
e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8);
|
||||||
if (e >= 0) {
|
if (e >= 0) {
|
||||||
x = x / (LONGREAL)Reals_TenL(e);
|
x = x / (LONGREAL)Reals_TenL(e);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -868,7 +868,7 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x)
|
||||||
LONGINT l;
|
LONGINT l;
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||||
l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
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)
|
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];
|
CHAR b[4];
|
||||||
LONGINT i;
|
LONGINT i;
|
||||||
i = __VAL(LONGINT, x);
|
i = (LONGINT)x;
|
||||||
b[0] = (CHAR)i;
|
b[0] = (CHAR)i;
|
||||||
b[1] = (CHAR)__ASHR(i, 8);
|
b[1] = (CHAR)__ASHR(i, 8);
|
||||||
b[2] = (CHAR)__ASHR(i, 16);
|
b[2] = (CHAR)__ASHR(i, 16);
|
||||||
|
|
|
||||||
|
|
@ -328,11 +328,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
blksz = __ASHL(__ASHR(size + 63, 5), 5);
|
blksz = __ASHL(__ASHR(size + 63, 5), 5);
|
||||||
new = Heap_NEWREC((SYSTEM_ADRINT)&blksz);
|
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 - 8, 0, LONGINT);
|
||||||
__PUT(tag, blksz, LONGINT);
|
__PUT(tag, blksz, LONGINT);
|
||||||
__PUT(tag + 8, -8, LONGINT);
|
__PUT(tag + 8, -8, LONGINT);
|
||||||
__PUT(__VAL(LONGINT, new) - 8, tag, LONGINT);
|
__PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT);
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = new;
|
_o_result = new;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
__GET(tag, offset, LONGINT);
|
__GET(tag, offset, LONGINT);
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
p = Heap_FetchAddress(fld);
|
p = Heap_FetchAddress(fld);
|
||||||
__PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
|
||||||
} else {
|
} else {
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
n = Heap_FetchAddress(fld);
|
n = Heap_FetchAddress(fld);
|
||||||
|
|
@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
if (!__ODD(tagbits)) {
|
if (!__ODD(tagbits)) {
|
||||||
__PUT(n - 8, tagbits + 1, LONGINT);
|
__PUT(n - 8, tagbits + 1, LONGINT);
|
||||||
__PUT(q - 8, tag + 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;
|
p = q;
|
||||||
q = n;
|
q = n;
|
||||||
tag = tagbits;
|
tag = tagbits;
|
||||||
|
|
@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
|
|
||||||
static void Heap_MarkP (SYSTEM_PTR p)
|
static void Heap_MarkP (SYSTEM_PTR p)
|
||||||
{
|
{
|
||||||
Heap_Mark(__VAL(LONGINT, p));
|
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Heap_Scan (void)
|
static void Heap_Scan (void)
|
||||||
|
|
@ -554,7 +554,7 @@ static void Heap_Finalize (void)
|
||||||
} else {
|
} else {
|
||||||
prev->next = n->next;
|
prev->next = n->next;
|
||||||
}
|
}
|
||||||
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
|
||||||
if (prev == NIL) {
|
if (prev == NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -573,7 +573,7 @@ void Heap_FINALL (void)
|
||||||
while (Heap_fin != NIL) {
|
while (Heap_fin != NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
Heap_fin = Heap_fin->next;
|
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;
|
Heap_FinNode f;
|
||||||
__NEW(f, Heap_FinDesc);
|
__NEW(f, Heap_FinDesc);
|
||||||
f->obj = __VAL(LONGINT, obj);
|
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
|
||||||
f->finalize = finalize;
|
f->finalize = finalize;
|
||||||
f->marked = 1;
|
f->marked = 1;
|
||||||
f->next = Heap_fin;
|
f->next = Heap_fin;
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y)
|
||||||
f = y->typ->form;
|
f = y->typ->form;
|
||||||
if ((*x)->class >= 7) {
|
if ((*x)->class >= 7) {
|
||||||
OPB_err(79);
|
OPB_err(79);
|
||||||
} else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) {
|
} else if (f != 5 || __IN(y->class, 0x0300)) {
|
||||||
OPB_err(80);
|
OPB_err(80);
|
||||||
y->typ = OPT_inttyp;
|
y->typ = OPT_inttyp;
|
||||||
}
|
}
|
||||||
|
|
@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if ((__IN(f, 0x70) && y->typ->form == 9)) {
|
} else if ((f == 5 && y->typ->form == 9)) {
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) {
|
if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) {
|
||||||
|
|
@ -568,14 +568,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x01f0)) {
|
if (!__IN(f, 0x01a0)) {
|
||||||
OPB_err(96);
|
OPB_err(96);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(f, 0x03f0)) {
|
if (__IN(f, 0x03a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-9223372036854775807-1)) {
|
if (z->conval->intval == (-9223372036854775807-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
if (__IN(f, 0x01f0)) {
|
if (__IN(f, 0x01a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-9223372036854775807-1)) {
|
if (z->conval->intval == (-9223372036854775807-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
||||||
z->obj = NIL;
|
z->obj = NIL;
|
||||||
|
|
@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
z->typ = OPT_linttyp;
|
z->typ = OPT_linttyp;
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
if ((__IN(f, 0x70) && z->class == 7)) {
|
if ((f == 5 && z->class == 7)) {
|
||||||
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
||||||
z = NewOp__29(op, typ, z);
|
z = NewOp__29(op, typ, z);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void)
|
||||||
case 0:
|
case 0:
|
||||||
res = 9;
|
res = 9;
|
||||||
break;
|
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) {
|
if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) {
|
||||||
res = 11;
|
res = 11;
|
||||||
} else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) {
|
} 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;
|
__GUARDEQP(yval, OPT_ConstDesc) = *xval;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (x->typ->size <= y->typ->size) {
|
if (x->typ->size <= y->typ->size) {
|
||||||
x->typ = y->typ;
|
x->typ = y->typ;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -885,7 +885,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 8) {
|
} else if (g == 8) {
|
||||||
|
|
@ -897,7 +897,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 7) {
|
} else if (g == 7) {
|
||||||
|
|
@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
xv = xval->intval;
|
xv = xval->intval;
|
||||||
yv = yval->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))) {
|
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;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->realval = xval->intval / (REAL)yval->intval;
|
xval->realval = xval->intval / (REAL)yval->intval;
|
||||||
OPB_CheckRealType(7, 205, xval);
|
OPB_CheckRealType(7, 205, xval);
|
||||||
|
|
@ -989,7 +989,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = __DIV(xval->intval, yval->intval);
|
xval->intval = __DIV(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = __MOD(xval->intval, yval->intval);
|
xval->intval = __MOD(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval);
|
temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval);
|
||||||
if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) {
|
if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) {
|
||||||
xval->intval += yval->intval;
|
xval->intval += yval->intval;
|
||||||
|
|
@ -1043,7 +1043,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
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)) {
|
if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) {
|
||||||
xval->intval -= yval->intval;
|
xval->intval -= yval->intval;
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
g = typ->form;
|
g = typ->form;
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (f > g) {
|
if (f > g) {
|
||||||
OPB_SetIntType(*x);
|
OPB_SetIntType(*x);
|
||||||
if ((*x)->typ->size > typ->size) {
|
if ((*x)->typ->size > typ->size) {
|
||||||
|
|
@ -1248,17 +1248,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) {
|
if ((g == 5 && y->typ->size < z->typ->size)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x01f0)) {
|
} else if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
|
|
@ -1267,7 +1267,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x01f0)) {
|
if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
|
|
@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
val = z->conval->intval;
|
val = z->conval->intval;
|
||||||
if (val == 1) {
|
if (val == 1) {
|
||||||
|
|
@ -1346,7 +1346,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((y->class == 7 && y->conval->intval == 0)) {
|
if ((y->class == 7 && y->conval->intval == 0)) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
}
|
}
|
||||||
|
|
@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
val = y->conval->intval;
|
val = y->conval->intval;
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
|
|
@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
if (y->conval->intval == 0) {
|
if (y->conval->intval == 0) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
|
|
@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(105);
|
OPB_err(105);
|
||||||
typ = OPT_undftyp;
|
typ = OPT_undftyp;
|
||||||
}
|
}
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((z->class == 7 && z->conval->intval == 0)) {
|
if ((z->class == 7 && z->conval->intval == 0)) {
|
||||||
do_ = 0;
|
do_ = 0;
|
||||||
z = y;
|
z = y;
|
||||||
|
|
@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(106);
|
OPB_err(106);
|
||||||
typ = OPT_undftyp;
|
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);
|
NewOp__39(op, typ, &z, y);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
|
||||||
LONGINT k, l;
|
LONGINT k, l;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
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) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) {
|
if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) {
|
||||||
|
|
@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x)
|
||||||
LONGINT k;
|
LONGINT k;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x70)) {
|
} else if ((*x)->typ->form != 5) {
|
||||||
OPB_err(93);
|
OPB_err(93);
|
||||||
} else if ((*x)->class == 7) {
|
} else if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
|
|
@ -1584,7 +1584,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
case 0: case 10:
|
case 0: case 10:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (!((__IN(g, 0x7a) && y->size == 1))) {
|
if (!((__IN(g, 0x2a) && y->size == 1))) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1593,18 +1593,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (!__IN(g, 0x70) || x->size < y->size) {
|
if (g != 5 || x->size < y->size) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(g, 0xf0)) {
|
if (!__IN(g, 0xe0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (!__IN(g, 0x01f0)) {
|
if (!__IN(g, 0x01e0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
break;
|
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);
|
OPB_Convert(&ynode, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
switch (fctno) {
|
switch (fctno) {
|
||||||
case 0:
|
case 0:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1778,7 +1778,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(0);
|
x = OPB_NewIntConst(0);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1809,7 +1809,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(255);
|
x = OPB_NewIntConst(255);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 9:
|
case 9:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x71)) {
|
} else if (__IN(f, 0x21)) {
|
||||||
OPB_Convert(&x, OPT_chartyp);
|
OPB_Convert(&x, OPT_chartyp);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1843,7 +1843,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 10:
|
case 10:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1859,7 +1859,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 11:
|
case 11:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 13: case 14:
|
case 13: case 14:
|
||||||
if (OPB_NotVar(x)) {
|
if (OPB_NotVar(x)) {
|
||||||
OPB_err(112);
|
OPB_err(112);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else if (x->readonly) {
|
} else if (x->readonly) {
|
||||||
OPB_err(76);
|
OPB_err(76);
|
||||||
|
|
@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) {
|
if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) {
|
||||||
OPB_Convert(&x, OPT_linttyp);
|
OPB_Convert(&x, OPT_linttyp);
|
||||||
}
|
}
|
||||||
|
|
@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x027a)) {
|
} else if (!__IN(f, 0x022a)) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 24: case 25: case 28: case 31:
|
case 24: case 25: case 28: case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 26: case 27:
|
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) {
|
if (x->conval->intval < 0 || x->conval->intval > -1) {
|
||||||
OPB_err(220);
|
OPB_err(220);
|
||||||
}
|
}
|
||||||
|
|
@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
} else {
|
} else {
|
||||||
if (x->typ != p->typ) {
|
if (x->typ != p->typ) {
|
||||||
if ((x->class == 7 && __IN(f, 0x70))) {
|
if ((x->class == 7 && f == 5)) {
|
||||||
OPB_Convert(&x, p->typ);
|
OPB_Convert(&x, p->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 15: case 16:
|
case 15: case 16:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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))) {
|
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) {
|
||||||
OPB_err(202);
|
OPB_err(202);
|
||||||
}
|
}
|
||||||
|
|
@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
if (!__IN(f, 0x70) || x->class != 7) {
|
if (!(f == 5) || x->class != 7) {
|
||||||
OPB_err(69);
|
OPB_err(69);
|
||||||
} else if (x->typ->size == 1) {
|
} else if (x->typ->size == 1) {
|
||||||
L = (SYSTEM_INT32)x->conval->intval;
|
L = (SYSTEM_INT32)x->conval->intval;
|
||||||
|
|
@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if ((p->class == 7 && x->class == 7)) {
|
if ((p->class == 7 && x->class == 7)) {
|
||||||
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
||||||
OPB_err(208);
|
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) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp == 3) {
|
} 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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
OPB_err(63);
|
||||||
}
|
}
|
||||||
|
|
@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else {
|
} else {
|
||||||
if (fctno == 22) {
|
if (fctno == 22) {
|
||||||
|
|
@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 28:
|
case 28:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(12, 26, p, x);
|
p = NewOp__53(12, 26, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 30:
|
case 30:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(19, 30, p, x);
|
p = NewOp__53(19, 30, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 31:
|
case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
p->link = x;
|
p->link = x;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
x->conval = OPT_NewConst();
|
x->conval = OPT_NewConst();
|
||||||
|
|
@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n)
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp != 3) {
|
} else if (p->typ->comp != 3) {
|
||||||
OPB_err(64);
|
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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
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)) {
|
} else if ((fctno == 31 && n == 2)) {
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
node = OPT_NewNode(19);
|
node = OPT_NewNode(19);
|
||||||
node->subcl = 31;
|
node->subcl = 31;
|
||||||
node->right = p;
|
node->right = p;
|
||||||
|
|
@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa
|
||||||
ftyp = ftyp->BaseTyp;
|
ftyp = ftyp->BaseTyp;
|
||||||
atyp = atyp->BaseTyp;
|
atyp = atyp->BaseTyp;
|
||||||
if ((fvarpar && ftyp == OPT_bytetyp)) {
|
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)) {
|
if (__IN(18, OPM_opt)) {
|
||||||
OPB_err(-301);
|
OPB_err(-301);
|
||||||
}
|
}
|
||||||
|
|
@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) {
|
} 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);
|
OPB_err(123);
|
||||||
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
||||||
OPB_err(123);
|
OPB_err(123);
|
||||||
|
|
|
||||||
|
|
@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(caseVal);
|
OPC_CharacterLiteral(caseVal);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(caseVal);
|
OPM_WriteInt(caseVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -1977,7 +1977,7 @@ void OPC_Constant (OPT_Const con, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(con->intval);
|
OPC_CharacterLiteral(con->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(con->intval);
|
OPM_WriteInt(con->intval);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
|
|
|
||||||
|
|
@ -533,12 +533,12 @@ void OPM_err (INTEGER n)
|
||||||
|
|
||||||
void OPM_FPrint (LONGINT *fp, LONGINT val)
|
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)
|
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)
|
void OPM_FPrintReal (LONGINT *fp, REAL real)
|
||||||
|
|
@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i)
|
||||||
|
|
||||||
void OPM_SymWSet (SET s)
|
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)
|
void OPM_SymWReal (REAL r)
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
|
||||||
OPP_err(135);
|
OPP_err(135);
|
||||||
}
|
}
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
sf = x->conval->intval;
|
sf = x->conval->intval;
|
||||||
if (sf < 0 || sf > 1) {
|
if (sf < 0 || sf > 1) {
|
||||||
OPP_err(220);
|
OPP_err(220);
|
||||||
|
|
@ -269,7 +269,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned)
|
||||||
*typ = OPT_NewStr(15, 2);
|
*typ = OPT_NewStr(15, 2);
|
||||||
(*typ)->sysflag = sysflag;
|
(*typ)->sysflag = sysflag;
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
n = x->conval->intval;
|
n = x->conval->intval;
|
||||||
if (n <= 0 || n > OPM_MaxIndex) {
|
if (n <= 0 || n > OPM_MaxIndex) {
|
||||||
OPP_err(63);
|
OPP_err(63);
|
||||||
|
|
@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x)
|
||||||
OPT_Node y = NIL;
|
OPT_Node y = NIL;
|
||||||
SHORTINT m;
|
SHORTINT m;
|
||||||
INTEGER n;
|
INTEGER n;
|
||||||
m = (SYSTEM_INT8)(*x)->obj->adr;
|
m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr);
|
||||||
n = 0;
|
n = 0;
|
||||||
if (OPP_sym == 30) {
|
if (OPP_sym == 30) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
|
|
@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
|
||||||
for (;;) {
|
for (;;) {
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
if (__IN(f, 0x78)) {
|
if (__IN(f, 0x28)) {
|
||||||
xval = x->conval->intval;
|
xval = x->conval->intval;
|
||||||
} else {
|
} else {
|
||||||
OPP_err(61);
|
OPP_err(61);
|
||||||
xval = 1;
|
xval = 1;
|
||||||
}
|
}
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) {
|
if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) {
|
||||||
OPP_err(60);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
} else if (LabelTyp->form != f) {
|
} 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);
|
OPS_Get(&OPP_sym);
|
||||||
OPP_ConstExpression(&y);
|
OPP_ConstExpression(&y);
|
||||||
yval = y->conval->intval;
|
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);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
if (yval < xval) {
|
if (yval < xval) {
|
||||||
|
|
@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x)
|
||||||
*StatSeq__30_s->pos = OPM_errpos;
|
*StatSeq__30_s->pos = OPM_errpos;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPP_err(126);
|
OPP_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x78)) {
|
} else if (!__IN((*x)->typ->form, 0x38)) {
|
||||||
OPP_err(125);
|
OPP_err(125);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(25);
|
OPP_CheckSym(25);
|
||||||
|
|
@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
if (OPP_sym == 38) {
|
if (OPP_sym == 38) {
|
||||||
OPP_qualident(&id);
|
OPP_qualident(&id);
|
||||||
if (!__IN(id->typ->form, 0x70)) {
|
if (!(id->typ->form == 5)) {
|
||||||
OPP_err(68);
|
OPP_err(68);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(34);
|
OPP_CheckSym(34);
|
||||||
|
|
@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
SetPos__35(z);
|
SetPos__35(z);
|
||||||
OPB_Link(&*stat, &last, z);
|
OPB_Link(&*stat, &last, z);
|
||||||
y = OPB_NewLeaf(t);
|
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);
|
OPP_err(113);
|
||||||
}
|
}
|
||||||
OPB_Link(&*stat, &last, x);
|
OPB_Link(&*stat, &last, x);
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__ASSERT(__IN(x->form, 0x70), 0);
|
__ASSERT(x->form == 5, 0);
|
||||||
__ASSERT(dir == 1 || dir == -1, 0);
|
__ASSERT(dir == 1 || dir == -1, 0);
|
||||||
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
@ -650,7 +650,7 @@ void OPT_FPrintObj (OPT_Object obj)
|
||||||
f = obj->typ->form;
|
f = obj->typ->form;
|
||||||
OPM_FPrint(&fprint, f);
|
OPM_FPrint(&fprint, f);
|
||||||
switch (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);
|
OPM_FPrint(&fprint, obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -851,7 +851,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
|
||||||
OPM_SymRCh(&ch);
|
OPM_SymRCh(&ch);
|
||||||
conval->intval = ch;
|
conval->intval = ch;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
conval->intval = OPM_SymRInt();
|
conval->intval = OPM_SymRInt();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
|
||||||
static OPT_Struct OPT_InTyp (LONGINT tag)
|
static OPT_Struct OPT_InTyp (LONGINT tag)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
if (__IN(tag, 0x70)) {
|
if (tag == 5) {
|
||||||
_o_result = OPT_IntType(OPM_SymRInt());
|
_o_result = OPT_IntType(OPM_SymRInt());
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ)
|
||||||
OPT_Object strobj = NIL;
|
OPT_Object strobj = NIL;
|
||||||
if (typ->ref < OPT_expCtxt.ref) {
|
if (typ->ref < OPT_expCtxt.ref) {
|
||||||
OPM_SymWInt(-typ->ref);
|
OPM_SymWInt(-typ->ref);
|
||||||
if (__IN(typ->ref, 0x70)) {
|
if (typ->ref == 5) {
|
||||||
OPM_SymWInt(typ->size);
|
OPM_SymWInt(typ->size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1538,7 +1538,7 @@ static void OPT_OutConstant (OPT_Object obj)
|
||||||
case 2: case 3:
|
case 2: case 3:
|
||||||
OPM_SymWCh((CHAR)obj->conval->intval);
|
OPM_SymWCh((CHAR)obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_SymWInt(obj->conval->intval);
|
OPM_SymWInt(obj->conval->intval);
|
||||||
OPM_SymWInt(obj->typ->size);
|
OPM_SymWInt(obj->typ->size);
|
||||||
break;
|
break;
|
||||||
|
|
@ -1877,7 +1877,7 @@ export void *OPT__init(void)
|
||||||
OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
|
OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
|
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*)"FALSE", 0);
|
||||||
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
||||||
OPT_EnterProc((CHAR*)"HALT", 0);
|
OPT_EnterProc((CHAR*)"HALT", 0);
|
||||||
|
|
@ -1905,9 +1905,7 @@ export void *OPT__init(void)
|
||||||
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
||||||
OPT_impCtxt.ref[2] = OPT_booltyp;
|
OPT_impCtxt.ref[2] = OPT_booltyp;
|
||||||
OPT_impCtxt.ref[3] = OPT_chartyp;
|
OPT_impCtxt.ref[3] = OPT_chartyp;
|
||||||
OPT_impCtxt.ref[4] = OPT_sinttyp;
|
|
||||||
OPT_impCtxt.ref[5] = OPT_inttyp;
|
OPT_impCtxt.ref[5] = OPT_inttyp;
|
||||||
OPT_impCtxt.ref[6] = OPT_linttyp;
|
|
||||||
OPT_impCtxt.ref[7] = OPT_realtyp;
|
OPT_impCtxt.ref[7] = OPT_realtyp;
|
||||||
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
||||||
OPT_impCtxt.ref[9] = OPT_settyp;
|
OPT_impCtxt.ref[9] = OPT_settyp;
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec)
|
||||||
|
|
||||||
static void OPV_SizeCast (LONGINT from, LONGINT to)
|
static void OPV_SizeCast (LONGINT from, LONGINT to)
|
||||||
{
|
{
|
||||||
if ((from != to && (from > 4 || to > 4))) {
|
if ((from != to && (from > 4 || to != 4))) {
|
||||||
switch (to) {
|
switch (to) {
|
||||||
case 1:
|
case 1:
|
||||||
OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14);
|
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);
|
OPM_WriteString((CHAR*)"__SETOF(", 9);
|
||||||
OPV_Entier(n, -1);
|
OPV_Entier(n, -1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
} else if (__IN(to, 0x70)) {
|
} else if (to == 5) {
|
||||||
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
||||||
OPM_WriteString((CHAR*)"__SHORT", 8);
|
OPM_WriteString((CHAR*)"__SHORT", 8);
|
||||||
if (OPV_SideEffects(n)) {
|
if (OPV_SideEffects(n)) {
|
||||||
|
|
@ -798,10 +798,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) {
|
if ((__IN(form, 0x0180) && n->typ->form == 5)) {
|
||||||
OPM_WriteString((CHAR*)"(double)", 9);
|
OPM_WriteString((CHAR*)"(double)", 9);
|
||||||
prec = 9;
|
prec = 9;
|
||||||
} else if (__IN(form, 0x70)) {
|
} else if (form == 5) {
|
||||||
OPV_SizeCast(n->typ->size, typ->size);
|
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)) {
|
if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) {
|
||||||
OPV_expr(n->left, prec);
|
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);
|
OPV_ParIntLiteral(n->conval->intval, n->typ->size);
|
||||||
} else {
|
} else {
|
||||||
OPV_expr(n, prec);
|
OPV_expr(n, prec);
|
||||||
|
|
@ -966,7 +966,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 29:
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
@ -1116,7 +1116,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPM_WriteString((CHAR*)" ^ ", 4);
|
OPM_WriteString((CHAR*)" ^ ", 4);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)" / ", 4);
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
|
||||||
|
|
@ -230,7 +230,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
|
||||||
Platform_ArgVecPtr av = NIL;
|
Platform_ArgVecPtr av = NIL;
|
||||||
Platform_MainStackFrame = argvadr;
|
Platform_MainStackFrame = argvadr;
|
||||||
Platform_ArgCount = argc;
|
Platform_ArgCount = argc;
|
||||||
av = __VAL(Platform_ArgVecPtr, argvadr);
|
av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr;
|
||||||
Platform_ArgVector = (*av)[0];
|
Platform_ArgVector = (*av)[0];
|
||||||
Platform_HaltCode = -128;
|
Platform_HaltCode = -128;
|
||||||
Platform_HeapInitHeap();
|
Platform_HeapInitHeap();
|
||||||
|
|
@ -263,7 +263,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
|
||||||
{
|
{
|
||||||
Platform_ArgVec av = NIL;
|
Platform_ArgVec av = NIL;
|
||||||
if (n < Platform_ArgCount) {
|
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);
|
__COPY(*(*av)[__X(n, 1024)], val, val__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -851,14 +851,14 @@ void Files_ReadInt (Files_Rider *R, LONGINT *R__typ, INTEGER *x)
|
||||||
{
|
{
|
||||||
CHAR b[2];
|
CHAR b[2];
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 2, 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)
|
void Files_ReadLInt (Files_Rider *R, LONGINT *R__typ, LONGINT *x)
|
||||||
{
|
{
|
||||||
CHAR b[4];
|
CHAR b[4];
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 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)
|
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];
|
CHAR b[4];
|
||||||
LONGINT l;
|
LONGINT l;
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||||
l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
l = (((SYSTEM_INT16)b[0] + __ASHL((SYSTEM_INT16)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)
|
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;
|
s = 0;
|
||||||
n = 0;
|
n = 0;
|
||||||
Files_Read(&*R, R__typ, (void*)&ch);
|
Files_Read(&*R, R__typ, (void*)&ch);
|
||||||
while (ch >= 128) {
|
while ((SYSTEM_INT16)ch >= 128) {
|
||||||
n += __ASH((ch - 128), s);
|
n += __ASH(((SYSTEM_INT16)ch - 128), s);
|
||||||
s += 7;
|
s += 7;
|
||||||
Files_Read(&*R, R__typ, (void*)&ch);
|
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;
|
*x = n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -958,7 +958,7 @@ void Files_WriteSet (Files_Rider *R, LONGINT *R__typ, SET x)
|
||||||
{
|
{
|
||||||
CHAR b[4];
|
CHAR b[4];
|
||||||
LONGINT i;
|
LONGINT i;
|
||||||
i = __VAL(LONGINT, x);
|
i = (LONGINT)x;
|
||||||
b[0] = (CHAR)i;
|
b[0] = (CHAR)i;
|
||||||
b[1] = (CHAR)__ASHR(i, 8);
|
b[1] = (CHAR)__ASHR(i, 8);
|
||||||
b[2] = (CHAR)__ASHR(i, 16);
|
b[2] = (CHAR)__ASHR(i, 16);
|
||||||
|
|
|
||||||
|
|
@ -327,11 +327,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
blksz = __ASHL(__ASHR(size + 31, 4), 4);
|
||||||
new = Heap_NEWREC((SYSTEM_ADRINT)&blksz);
|
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 - 4, 0, LONGINT);
|
||||||
__PUT(tag, blksz, LONGINT);
|
__PUT(tag, blksz, LONGINT);
|
||||||
__PUT(tag + 4, -4, LONGINT);
|
__PUT(tag + 4, -4, LONGINT);
|
||||||
__PUT(__VAL(LONGINT, new) - 4, tag, LONGINT);
|
__PUT((LONGINT)(SYSTEM_ADRINT)new - 4, tag, LONGINT);
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = new;
|
_o_result = new;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -360,7 +360,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
__GET(tag, offset, LONGINT);
|
__GET(tag, offset, LONGINT);
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
p = Heap_FetchAddress(fld);
|
p = Heap_FetchAddress(fld);
|
||||||
__PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
|
||||||
} else {
|
} else {
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
n = Heap_FetchAddress(fld);
|
n = Heap_FetchAddress(fld);
|
||||||
|
|
@ -369,7 +369,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
if (!__ODD(tagbits)) {
|
if (!__ODD(tagbits)) {
|
||||||
__PUT(n - 4, tagbits + 1, LONGINT);
|
__PUT(n - 4, tagbits + 1, LONGINT);
|
||||||
__PUT(q - 4, tag + 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;
|
p = q;
|
||||||
q = n;
|
q = n;
|
||||||
tag = tagbits;
|
tag = tagbits;
|
||||||
|
|
@ -384,7 +384,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
|
|
||||||
static void Heap_MarkP (SYSTEM_PTR p)
|
static void Heap_MarkP (SYSTEM_PTR p)
|
||||||
{
|
{
|
||||||
Heap_Mark(__VAL(LONGINT, p));
|
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Heap_Scan (void)
|
static void Heap_Scan (void)
|
||||||
|
|
@ -553,7 +553,7 @@ static void Heap_Finalize (void)
|
||||||
} else {
|
} else {
|
||||||
prev->next = n->next;
|
prev->next = n->next;
|
||||||
}
|
}
|
||||||
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
|
||||||
if (prev == NIL) {
|
if (prev == NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -572,7 +572,7 @@ void Heap_FINALL (void)
|
||||||
while (Heap_fin != NIL) {
|
while (Heap_fin != NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
Heap_fin = Heap_fin->next;
|
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;
|
Heap_FinNode f;
|
||||||
__NEW(f, Heap_FinDesc);
|
__NEW(f, Heap_FinDesc);
|
||||||
f->obj = __VAL(LONGINT, obj);
|
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
|
||||||
f->finalize = finalize;
|
f->finalize = finalize;
|
||||||
f->marked = 1;
|
f->marked = 1;
|
||||||
f->next = Heap_fin;
|
f->next = Heap_fin;
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y)
|
||||||
f = y->typ->form;
|
f = y->typ->form;
|
||||||
if ((*x)->class >= 7) {
|
if ((*x)->class >= 7) {
|
||||||
OPB_err(79);
|
OPB_err(79);
|
||||||
} else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) {
|
} else if (f != 5 || __IN(y->class, 0x0300)) {
|
||||||
OPB_err(80);
|
OPB_err(80);
|
||||||
y->typ = OPT_inttyp;
|
y->typ = OPT_inttyp;
|
||||||
}
|
}
|
||||||
|
|
@ -465,7 +465,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if ((__IN(f, 0x70) && y->typ->form == 9)) {
|
} else if ((f == 5 && y->typ->form == 9)) {
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (k < 0 || k > OPM_MaxSet) {
|
if (k < 0 || k > OPM_MaxSet) {
|
||||||
|
|
@ -567,14 +567,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x01f0)) {
|
if (!__IN(f, 0x01a0)) {
|
||||||
OPB_err(96);
|
OPB_err(96);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(f, 0x03f0)) {
|
if (__IN(f, 0x03a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-2147483647-1)) {
|
if (z->conval->intval == (-2147483647-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -595,9 +595,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
if (__IN(f, 0x01f0)) {
|
if (__IN(f, 0x01a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-2147483647-1)) {
|
if (z->conval->intval == (-2147483647-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -618,7 +618,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
case 22:
|
case 22:
|
||||||
if (f == 3) {
|
if (f == 3) {
|
||||||
if (z->class == 7) {
|
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;
|
z->obj = NIL;
|
||||||
} else {
|
} else {
|
||||||
z = NewOp__29(op, typ, z);
|
z = NewOp__29(op, typ, z);
|
||||||
|
|
@ -629,7 +629,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
||||||
z->obj = NIL;
|
z->obj = NIL;
|
||||||
|
|
@ -654,7 +654,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
z->typ = OPT_linttyp;
|
z->typ = OPT_linttyp;
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
if ((__IN(f, 0x70) && z->class == 7)) {
|
if ((f == 5 && z->class == 7)) {
|
||||||
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
||||||
z = NewOp__29(op, typ, z);
|
z = NewOp__29(op, typ, z);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -777,7 +777,7 @@ static INTEGER ConstCmp__14 (void)
|
||||||
case 0:
|
case 0:
|
||||||
res = 9;
|
res = 9;
|
||||||
break;
|
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) {
|
if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) {
|
||||||
res = 11;
|
res = 11;
|
||||||
} else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) {
|
} 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;
|
__GUARDEQP(yval, OPT_ConstDesc) = *xval;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (x->typ->size <= y->typ->size) {
|
if (x->typ->size <= y->typ->size) {
|
||||||
x->typ = y->typ;
|
x->typ = y->typ;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -884,7 +884,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 8) {
|
} else if (g == 8) {
|
||||||
|
|
@ -896,7 +896,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 7) {
|
} else if (g == 7) {
|
||||||
|
|
@ -940,7 +940,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
xv = xval->intval;
|
xv = xval->intval;
|
||||||
yv = yval->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))) {
|
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;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->realval = xval->intval / (REAL)yval->intval;
|
xval->realval = xval->intval / (REAL)yval->intval;
|
||||||
OPB_CheckRealType(7, 205, xval);
|
OPB_CheckRealType(7, 205, xval);
|
||||||
|
|
@ -988,7 +988,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = __DIV(xval->intval, yval->intval);
|
xval->intval = __DIV(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1000,7 +1000,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = (int)__MOD(xval->intval, yval->intval);
|
xval->intval = (int)__MOD(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1019,7 +1019,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval);
|
temp = (yval->intval >= 0 && xval->intval <= 2147483647 - yval->intval);
|
||||||
if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) {
|
if (temp || (yval->intval < 0 && xval->intval >= (-2147483647-1) - yval->intval)) {
|
||||||
xval->intval += yval->intval;
|
xval->intval += yval->intval;
|
||||||
|
|
@ -1042,7 +1042,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
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)) {
|
if ((yval->intval >= 0 && xval->intval >= (-2147483647-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 2147483647 + yval->intval)) {
|
||||||
xval->intval -= yval->intval;
|
xval->intval -= yval->intval;
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1122,8 +1122,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
g = typ->form;
|
g = typ->form;
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (f > g) {
|
if (f > g) {
|
||||||
OPB_SetIntType(*x);
|
OPB_SetIntType(*x);
|
||||||
if ((*x)->typ->size > typ->size) {
|
if ((*x)->typ->size > typ->size) {
|
||||||
|
|
@ -1154,7 +1154,7 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(*x)->obj = NIL;
|
(*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) {
|
if ((*x)->left->typ == typ) {
|
||||||
*x = (*x)->left;
|
*x = (*x)->left;
|
||||||
}
|
}
|
||||||
|
|
@ -1247,17 +1247,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) {
|
if ((g == 5 && y->typ->size < z->typ->size)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x01f0)) {
|
} else if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
|
|
@ -1266,7 +1266,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x01f0)) {
|
if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
|
|
@ -1305,7 +1305,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
val = z->conval->intval;
|
val = z->conval->intval;
|
||||||
if (val == 1) {
|
if (val == 1) {
|
||||||
|
|
@ -1345,7 +1345,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((y->class == 7 && y->conval->intval == 0)) {
|
if ((y->class == 7 && y->conval->intval == 0)) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
}
|
}
|
||||||
|
|
@ -1364,7 +1364,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
val = y->conval->intval;
|
val = y->conval->intval;
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
|
|
@ -1387,7 +1387,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
if (y->conval->intval == 0) {
|
if (y->conval->intval == 0) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
|
|
@ -1419,12 +1419,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(105);
|
OPB_err(105);
|
||||||
typ = OPT_undftyp;
|
typ = OPT_undftyp;
|
||||||
}
|
}
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((z->class == 7 && z->conval->intval == 0)) {
|
if ((z->class == 7 && z->conval->intval == 0)) {
|
||||||
do_ = 0;
|
do_ = 0;
|
||||||
z = y;
|
z = y;
|
||||||
|
|
@ -1438,11 +1438,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(106);
|
OPB_err(106);
|
||||||
typ = OPT_undftyp;
|
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);
|
NewOp__39(op, typ, &z, y);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1498,7 +1498,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
|
||||||
LONGINT k, l;
|
LONGINT k, l;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
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) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (0 > k || k > OPM_MaxSet) {
|
if (0 > k || k > OPM_MaxSet) {
|
||||||
|
|
@ -1533,7 +1533,7 @@ void OPB_SetElem (OPT_Node *x)
|
||||||
LONGINT k;
|
LONGINT k;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x70)) {
|
} else if ((*x)->typ->form != 5) {
|
||||||
OPB_err(93);
|
OPB_err(93);
|
||||||
} else if ((*x)->class == 7) {
|
} else if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
|
|
@ -1583,7 +1583,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
case 0: case 10:
|
case 0: case 10:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (!((__IN(g, 0x7a) && y->size == 1))) {
|
if (!((__IN(g, 0x2a) && y->size == 1))) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1592,18 +1592,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (!__IN(g, 0x70) || x->size < y->size) {
|
if (g != 5 || x->size < y->size) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(g, 0xf0)) {
|
if (!__IN(g, 0xe0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (!__IN(g, 0x01f0)) {
|
if (!__IN(g, 0x01e0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1686,7 +1686,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
break;
|
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);
|
OPB_Convert(&ynode, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1704,7 +1704,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
switch (fctno) {
|
switch (fctno) {
|
||||||
case 0:
|
case 0:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1777,7 +1777,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(0);
|
x = OPB_NewIntConst(0);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1808,7 +1808,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(255);
|
x = OPB_NewIntConst(255);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1832,7 +1832,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 9:
|
case 9:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x71)) {
|
} else if (__IN(f, 0x21)) {
|
||||||
OPB_Convert(&x, OPT_chartyp);
|
OPB_Convert(&x, OPT_chartyp);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1842,7 +1842,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 10:
|
case 10:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1858,7 +1858,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 11:
|
case 11:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1876,7 +1876,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 13: case 14:
|
case 13: case 14:
|
||||||
if (OPB_NotVar(x)) {
|
if (OPB_NotVar(x)) {
|
||||||
OPB_err(112);
|
OPB_err(112);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else if (x->readonly) {
|
} else if (x->readonly) {
|
||||||
OPB_err(76);
|
OPB_err(76);
|
||||||
|
|
@ -1911,7 +1911,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if (x->typ->size != OPM_LIntSize) {
|
if (x->typ->size != OPM_LIntSize) {
|
||||||
OPB_Convert(&x, OPT_linttyp);
|
OPB_Convert(&x, OPT_linttyp);
|
||||||
}
|
}
|
||||||
|
|
@ -1943,22 +1943,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x027a)) {
|
} else if (!__IN(f, 0x022a)) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 24: case 25: case 28: case 31:
|
case 24: case 25: case 28: case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 26: case 27:
|
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) {
|
if (x->conval->intval < 0 || x->conval->intval > -1) {
|
||||||
OPB_err(220);
|
OPB_err(220);
|
||||||
}
|
}
|
||||||
|
|
@ -2036,7 +2036,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
} else {
|
} else {
|
||||||
if (x->typ != p->typ) {
|
if (x->typ != p->typ) {
|
||||||
if ((x->class == 7 && __IN(f, 0x70))) {
|
if ((x->class == 7 && f == 5)) {
|
||||||
OPB_Convert(&x, p->typ);
|
OPB_Convert(&x, p->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2049,7 +2049,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 15: case 16:
|
case 15: case 16:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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))) {
|
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > OPM_MaxSet))) {
|
||||||
OPB_err(202);
|
OPB_err(202);
|
||||||
}
|
}
|
||||||
|
|
@ -2060,10 +2060,10 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
if (!__IN(f, 0x70) || x->class != 7) {
|
if (!(f == 5) || x->class != 7) {
|
||||||
OPB_err(69);
|
OPB_err(69);
|
||||||
} else if (x->typ->size == 1) {
|
} else if (x->typ->size == 1) {
|
||||||
L = x->conval->intval;
|
L = (SYSTEM_INT16)x->conval->intval;
|
||||||
typ = p->typ;
|
typ = p->typ;
|
||||||
while ((L > 0 && __IN(typ->comp, 0x0c))) {
|
while ((L > 0 && __IN(typ->comp, 0x0c))) {
|
||||||
typ = typ->BaseTyp;
|
typ = typ->BaseTyp;
|
||||||
|
|
@ -2109,7 +2109,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if ((p->class == 7 && x->class == 7)) {
|
if ((p->class == 7 && x->class == 7)) {
|
||||||
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
||||||
OPB_err(208);
|
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) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp == 3) {
|
} 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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
OPB_err(63);
|
||||||
}
|
}
|
||||||
|
|
@ -2153,7 +2153,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else {
|
} else {
|
||||||
if (fctno == 22) {
|
if (fctno == 22) {
|
||||||
|
|
@ -2185,7 +2185,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 28:
|
case 28:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(12, 26, p, x);
|
p = NewOp__53(12, 26, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2209,7 +2209,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 30:
|
case 30:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(19, 30, p, x);
|
p = NewOp__53(19, 30, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2219,16 +2219,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 31:
|
case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
p->link = x;
|
p->link = x;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
x->conval = OPT_NewConst();
|
x->conval = OPT_NewConst();
|
||||||
|
|
@ -2271,7 +2271,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n)
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp != 3) {
|
} else if (p->typ->comp != 3) {
|
||||||
OPB_err(64);
|
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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
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)) {
|
} else if ((fctno == 31 && n == 2)) {
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
node = OPT_NewNode(19);
|
node = OPT_NewNode(19);
|
||||||
node->subcl = 31;
|
node->subcl = 31;
|
||||||
node->right = p;
|
node->right = p;
|
||||||
|
|
@ -2375,7 +2375,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa
|
||||||
ftyp = ftyp->BaseTyp;
|
ftyp = ftyp->BaseTyp;
|
||||||
atyp = atyp->BaseTyp;
|
atyp = atyp->BaseTyp;
|
||||||
if ((fvarpar && ftyp == OPT_bytetyp)) {
|
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)) {
|
if (__IN(18, OPM_opt)) {
|
||||||
OPB_err(-301);
|
OPB_err(-301);
|
||||||
}
|
}
|
||||||
|
|
@ -2458,7 +2458,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) {
|
} 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);
|
OPB_err(123);
|
||||||
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
||||||
OPB_err(123);
|
OPB_err(123);
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ static INTEGER OPC_PerfectHash (CHAR *s, LONGINT s__len)
|
||||||
i = 0;
|
i = 0;
|
||||||
h = 0;
|
h = 0;
|
||||||
while ((s[__X(i, s__len)] != 0x00 && i < 5)) {
|
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;
|
i += 1;
|
||||||
}
|
}
|
||||||
_o_result = (int)__MOD(h, 105);
|
_o_result = (int)__MOD(h, 105);
|
||||||
|
|
@ -759,7 +759,7 @@ static void OPC_CProcDefs (OPT_Object obj, INTEGER vis)
|
||||||
INTEGER _for__9;
|
INTEGER _for__9;
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_CProcDefs(obj->left, vis);
|
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;
|
ext = obj->conval->ext;
|
||||||
i = 1;
|
i = 1;
|
||||||
if (((*ext)[1] != '#' && !(OPC_Prefixed(ext, (CHAR*)"extern ", 8) || OPC_Prefixed(ext, (CHAR*)"import ", 8)))) {
|
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);
|
OPC_DeclareParams(obj->link, 1);
|
||||||
OPM_Write(0x09);
|
OPM_Write(0x09);
|
||||||
}
|
}
|
||||||
_for__9 = (*obj->conval->ext)[0];
|
_for__9 = (SYSTEM_INT16)(*obj->conval->ext)[0];
|
||||||
i = i;
|
i = i;
|
||||||
while (i <= _for__9) {
|
while (i <= _for__9) {
|
||||||
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
|
OPM_Write((*obj->conval->ext)[__X(i, 256)]);
|
||||||
|
|
@ -1000,7 +1000,7 @@ static void OPC_IdentList (OPT_Object obj, INTEGER vis)
|
||||||
first = 1;
|
first = 1;
|
||||||
while ((obj != NIL && obj->mode != 13)) {
|
while ((obj != NIL && obj->mode != 13)) {
|
||||||
if ((__IN(vis, 0x05) || (vis == 1 && obj->vis != 0)) || (vis == 3 && !obj->leaf)) {
|
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) {
|
if (!first) {
|
||||||
OPC_EndStat();
|
OPC_EndStat();
|
||||||
}
|
}
|
||||||
|
|
@ -1154,7 +1154,7 @@ static void OPC_IncludeImports (OPT_Object obj, INTEGER vis)
|
||||||
{
|
{
|
||||||
if (obj != NIL) {
|
if (obj != NIL) {
|
||||||
OPC_IncludeImports(obj->left, vis);
|
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_Include(OPT_GlbMod[__X(-obj->mnolev, 64)]->name, 256);
|
||||||
}
|
}
|
||||||
OPC_IncludeImports(obj->right, vis);
|
OPC_IncludeImports(obj->right, vis);
|
||||||
|
|
@ -1782,7 +1782,7 @@ void OPC_TypeOf (OPT_Object ap)
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__ASSERT(ap->typ->comp == 4, 0);
|
__ASSERT(ap->typ->comp == 4, 0);
|
||||||
if (ap->mode == 2) {
|
if (ap->mode == 2) {
|
||||||
if (ap->mnolev != OPM_level) {
|
if ((SYSTEM_INT16)ap->mnolev != OPM_level) {
|
||||||
OPM_WriteStringVar((void*)ap->scope->name, 256);
|
OPM_WriteStringVar((void*)ap->scope->name, 256);
|
||||||
OPM_WriteString((CHAR*)"_s->", 5);
|
OPM_WriteString((CHAR*)"_s->", 5);
|
||||||
OPC_Ident(ap);
|
OPC_Ident(ap);
|
||||||
|
|
@ -1850,7 +1850,7 @@ static void OPC_StringLiteral (CHAR *s, LONGINT s__len, LONGINT l)
|
||||||
OPM_Write('"');
|
OPM_Write('"');
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < l) {
|
while (i < l) {
|
||||||
c = s[__X(i, s__len)];
|
c = (SYSTEM_INT16)s[__X(i, s__len)];
|
||||||
if (c < 32 || c > 126) {
|
if (c < 32 || c > 126) {
|
||||||
OPM_Write('\\');
|
OPM_Write('\\');
|
||||||
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
|
OPM_Write((CHAR)(48 + __ASHR(c, 6)));
|
||||||
|
|
@ -1878,7 +1878,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(caseVal);
|
OPC_CharacterLiteral(caseVal);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(caseVal);
|
OPM_WriteInt(caseVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -1976,7 +1976,7 @@ void OPC_Constant (OPT_Const con, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(con->intval);
|
OPC_CharacterLiteral(con->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(con->intval);
|
OPM_WriteInt(con->intval);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
|
|
|
||||||
|
|
@ -154,15 +154,15 @@ static void OPM_ScanOptions (CHAR *s, LONGINT s__len, SET *opt)
|
||||||
case 'B':
|
case 'B':
|
||||||
if (s[__X(i + 1, s__len)] != 0x00) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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) {
|
if (s[__X(i + 1, s__len)] != 0x00) {
|
||||||
i += 1;
|
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_IntSize == 2 || OPM_IntSize == 4, 0);
|
||||||
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
|
__ASSERT(OPM_PointerSize == 4 || OPM_PointerSize == 8, 0);
|
||||||
|
|
@ -458,7 +458,7 @@ static void OPM_ShowLine (LONGINT pos)
|
||||||
if (pos >= OPM_ErrorLineLimitPos) {
|
if (pos >= OPM_ErrorLineLimitPos) {
|
||||||
pos = OPM_ErrorLineLimitPos - 1;
|
pos = OPM_ErrorLineLimitPos - 1;
|
||||||
}
|
}
|
||||||
i = (pos - OPM_ErrorLineStartPos);
|
i = (SYSTEM_INT16)(pos - OPM_ErrorLineStartPos);
|
||||||
while (i > 0) {
|
while (i > 0) {
|
||||||
OPM_LogW(' ');
|
OPM_LogW(' ');
|
||||||
i -= 1;
|
i -= 1;
|
||||||
|
|
@ -532,12 +532,12 @@ void OPM_err (INTEGER n)
|
||||||
|
|
||||||
void OPM_FPrint (LONGINT *fp, LONGINT val)
|
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)
|
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)
|
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)) {
|
if (((*S).class == 1 && __STRCMP((*S).s, name) == 0)) {
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
if ((*S).class == 3) {
|
if ((*S).class == 3) {
|
||||||
*size = (*S).i;
|
*size = (SYSTEM_INT16)(*S).i;
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
} else {
|
} else {
|
||||||
OPM_Mark(-157, -1);
|
OPM_Mark(-157, -1);
|
||||||
}
|
}
|
||||||
if ((*S).class == 3) {
|
if ((*S).class == 3) {
|
||||||
*align = (*S).i;
|
*align = (SYSTEM_INT16)(*S).i;
|
||||||
Texts_Scan(&*S, S__typ);
|
Texts_Scan(&*S, S__typ);
|
||||||
} else {
|
} else {
|
||||||
OPM_Mark(-157, -1);
|
OPM_Mark(-157, -1);
|
||||||
|
|
@ -753,7 +753,7 @@ void OPM_SymWInt (LONGINT i)
|
||||||
|
|
||||||
void OPM_SymWSet (SET s)
|
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)
|
void OPM_SymWReal (REAL r)
|
||||||
|
|
@ -819,13 +819,13 @@ void OPM_WriteHex (LONGINT i)
|
||||||
{
|
{
|
||||||
CHAR s[3];
|
CHAR s[3];
|
||||||
INTEGER digit;
|
INTEGER digit;
|
||||||
digit = __ASHR(i, 4);
|
digit = __ASHR((SYSTEM_INT16)i, 4);
|
||||||
if (digit < 10) {
|
if (digit < 10) {
|
||||||
s[0] = (CHAR)(48 + digit);
|
s[0] = (CHAR)(48 + digit);
|
||||||
} else {
|
} else {
|
||||||
s[0] = (CHAR)(87 + digit);
|
s[0] = (CHAR)(87 + digit);
|
||||||
}
|
}
|
||||||
digit = __MASK(i, -16);
|
digit = __MASK((SYSTEM_INT16)i, -16);
|
||||||
if (digit < 10) {
|
if (digit < 10) {
|
||||||
s[1] = (CHAR)(48 + digit);
|
s[1] = (CHAR)(48 + digit);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ static void OPP_err (INTEGER n)
|
||||||
|
|
||||||
static void OPP_CheckSym (INTEGER s)
|
static void OPP_CheckSym (INTEGER s)
|
||||||
{
|
{
|
||||||
if (OPP_sym == s) {
|
if ((SYSTEM_INT16)OPP_sym == s) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
} else {
|
} else {
|
||||||
OPM_err(s);
|
OPM_err(s);
|
||||||
|
|
@ -136,7 +136,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
|
||||||
OPP_err(135);
|
OPP_err(135);
|
||||||
}
|
}
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
sf = x->conval->intval;
|
sf = x->conval->intval;
|
||||||
if (sf < 0 || sf > 1) {
|
if (sf < 0 || sf > 1) {
|
||||||
OPP_err(220);
|
OPP_err(220);
|
||||||
|
|
@ -146,7 +146,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
|
||||||
OPP_err(51);
|
OPP_err(51);
|
||||||
sf = 0;
|
sf = 0;
|
||||||
}
|
}
|
||||||
*sysflag = sf;
|
*sysflag = (SYSTEM_INT16)sf;
|
||||||
OPP_CheckSym(23);
|
OPP_CheckSym(23);
|
||||||
} else {
|
} else {
|
||||||
*sysflag = default_;
|
*sysflag = default_;
|
||||||
|
|
@ -268,7 +268,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned)
|
||||||
*typ = OPT_NewStr(15, 2);
|
*typ = OPT_NewStr(15, 2);
|
||||||
(*typ)->sysflag = sysflag;
|
(*typ)->sysflag = sysflag;
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
n = x->conval->intval;
|
n = x->conval->intval;
|
||||||
if (n <= 0 || n > OPM_MaxIndex) {
|
if (n <= 0 || n > OPM_MaxIndex) {
|
||||||
OPP_err(63);
|
OPP_err(63);
|
||||||
|
|
@ -625,7 +625,7 @@ static void OPP_StandProcCall (OPT_Node *x)
|
||||||
OPT_Node y = NIL;
|
OPT_Node y = NIL;
|
||||||
SHORTINT m;
|
SHORTINT m;
|
||||||
INTEGER n;
|
INTEGER n;
|
||||||
m = (*x)->obj->adr;
|
m = (SYSTEM_INT8)((SYSTEM_INT16)(*x)->obj->adr);
|
||||||
n = 0;
|
n = 0;
|
||||||
if (OPP_sym == 30) {
|
if (OPP_sym == 30) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
|
|
@ -1173,24 +1173,24 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
|
||||||
for (;;) {
|
for (;;) {
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
if (__IN(f, 0x78)) {
|
if (__IN(f, 0x28)) {
|
||||||
xval = x->conval->intval;
|
xval = x->conval->intval;
|
||||||
} else {
|
} else {
|
||||||
OPP_err(61);
|
OPP_err(61);
|
||||||
xval = 1;
|
xval = 1;
|
||||||
}
|
}
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) {
|
if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) {
|
||||||
OPP_err(60);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
} else if (LabelTyp->form != f) {
|
} else if ((SYSTEM_INT16)LabelTyp->form != f) {
|
||||||
OPP_err(60);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
if (OPP_sym == 21) {
|
if (OPP_sym == 21) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
OPP_ConstExpression(&y);
|
OPP_ConstExpression(&y);
|
||||||
yval = y->conval->intval;
|
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);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
if (yval < xval) {
|
if (yval < xval) {
|
||||||
|
|
@ -1253,7 +1253,7 @@ static void CasePart__31 (OPT_Node *x)
|
||||||
*StatSeq__30_s->pos = OPM_errpos;
|
*StatSeq__30_s->pos = OPM_errpos;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPP_err(126);
|
OPP_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x78)) {
|
} else if (!__IN((*x)->typ->form, 0x38)) {
|
||||||
OPP_err(125);
|
OPP_err(125);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(25);
|
OPP_CheckSym(25);
|
||||||
|
|
@ -1439,7 +1439,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
if (OPP_sym == 38) {
|
if (OPP_sym == 38) {
|
||||||
OPP_qualident(&id);
|
OPP_qualident(&id);
|
||||||
if (!__IN(id->typ->form, 0x70)) {
|
if (!(id->typ->form == 5)) {
|
||||||
OPP_err(68);
|
OPP_err(68);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(34);
|
OPP_CheckSym(34);
|
||||||
|
|
@ -1471,7 +1471,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
SetPos__35(z);
|
SetPos__35(z);
|
||||||
OPB_Link(&*stat, &last, z);
|
OPB_Link(&*stat, &last, z);
|
||||||
y = OPB_NewLeaf(t);
|
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);
|
OPP_err(113);
|
||||||
}
|
}
|
||||||
OPB_Link(&*stat, &last, x);
|
OPB_Link(&*stat, &last, x);
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ static void OPS_Str (SHORTINT *sym)
|
||||||
if (OPS_intval == 2) {
|
if (OPS_intval == 2) {
|
||||||
*sym = 35;
|
*sym = 35;
|
||||||
OPS_numtyp = 1;
|
OPS_numtyp = 1;
|
||||||
OPS_intval = OPS_str[0];
|
OPS_intval = (SYSTEM_INT16)OPS_str[0];
|
||||||
} else {
|
} else {
|
||||||
*sym = 37;
|
*sym = 37;
|
||||||
}
|
}
|
||||||
|
|
@ -112,10 +112,10 @@ static INTEGER Ord__7 (CHAR ch, BOOLEAN hex)
|
||||||
{
|
{
|
||||||
INTEGER _o_result;
|
INTEGER _o_result;
|
||||||
if (ch <= '9') {
|
if (ch <= '9') {
|
||||||
_o_result = ch - 48;
|
_o_result = (SYSTEM_INT16)ch - 48;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else if (hex) {
|
} else if (hex) {
|
||||||
_o_result = (ch - 65) + 10;
|
_o_result = ((SYSTEM_INT16)ch - 65) + 10;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else {
|
} else {
|
||||||
OPS_err(2);
|
OPS_err(2);
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__ASSERT(__IN(x->form, 0x70), 0);
|
__ASSERT(x->form == 5, 0);
|
||||||
__ASSERT(dir == 1 || dir == -1, 0);
|
__ASSERT(dir == 1 || dir == -1, 0);
|
||||||
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
@ -414,7 +414,7 @@ static void OPT_FPrintName (LONGINT *fp, CHAR *name, LONGINT name__len)
|
||||||
i = 0;
|
i = 0;
|
||||||
do {
|
do {
|
||||||
ch = name[__X(i, name__len)];
|
ch = name[__X(i, name__len)];
|
||||||
OPM_FPrint(&*fp, ch);
|
OPM_FPrint(&*fp, (SYSTEM_INT16)ch);
|
||||||
i += 1;
|
i += 1;
|
||||||
} while (!(ch == 0x00));
|
} while (!(ch == 0x00));
|
||||||
}
|
}
|
||||||
|
|
@ -649,7 +649,7 @@ void OPT_FPrintObj (OPT_Object obj)
|
||||||
f = obj->typ->form;
|
f = obj->typ->form;
|
||||||
OPM_FPrint(&fprint, f);
|
OPM_FPrint(&fprint, f);
|
||||||
switch (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);
|
OPM_FPrint(&fprint, obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -680,11 +680,11 @@ void OPT_FPrintObj (OPT_Object obj)
|
||||||
} else if (obj->mode == 9) {
|
} else if (obj->mode == 9) {
|
||||||
OPT_FPrintSign(&fprint, obj->typ, obj->link);
|
OPT_FPrintSign(&fprint, obj->typ, obj->link);
|
||||||
ext = obj->conval->ext;
|
ext = obj->conval->ext;
|
||||||
m = (*ext)[0];
|
m = (SYSTEM_INT16)(*ext)[0];
|
||||||
f = 1;
|
f = 1;
|
||||||
OPM_FPrint(&fprint, m);
|
OPM_FPrint(&fprint, m);
|
||||||
while (f <= m) {
|
while (f <= m) {
|
||||||
OPM_FPrint(&fprint, (*ext)[__X(f, 256)]);
|
OPM_FPrint(&fprint, (SYSTEM_INT16)(*ext)[__X(f, 256)]);
|
||||||
f += 1;
|
f += 1;
|
||||||
}
|
}
|
||||||
} else if (obj->mode == 5) {
|
} else if (obj->mode == 5) {
|
||||||
|
|
@ -848,9 +848,9 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case 1: case 3: case 2:
|
case 1: case 3: case 2:
|
||||||
OPM_SymRCh(&ch);
|
OPM_SymRCh(&ch);
|
||||||
conval->intval = ch;
|
conval->intval = (SYSTEM_INT16)ch;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
conval->intval = OPM_SymRInt();
|
conval->intval = OPM_SymRInt();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -979,7 +979,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
|
||||||
static OPT_Struct OPT_InTyp (LONGINT tag)
|
static OPT_Struct OPT_InTyp (LONGINT tag)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
if (__IN(tag, 0x70)) {
|
if (tag == 5) {
|
||||||
_o_result = OPT_IntType(OPM_SymRInt());
|
_o_result = OPT_IntType(OPM_SymRInt());
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1049,7 +1049,7 @@ static void OPT_InStruct (OPT_Struct *typ)
|
||||||
obj->vis = 0;
|
obj->vis = 0;
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
if (tag == 35) {
|
if (tag == 35) {
|
||||||
(*typ)->sysflag = OPM_SymRInt();
|
(*typ)->sysflag = (SYSTEM_INT16)OPM_SymRInt();
|
||||||
tag = OPM_SymRInt();
|
tag = OPM_SymRInt();
|
||||||
}
|
}
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
|
|
@ -1211,7 +1211,7 @@ static OPT_Object OPT_InObj (SHORTINT mno)
|
||||||
obj->mode = 9;
|
obj->mode = 9;
|
||||||
ext = OPT_NewExt();
|
ext = OPT_NewExt();
|
||||||
obj->conval->ext = ext;
|
obj->conval->ext = ext;
|
||||||
s = OPM_SymRInt();
|
s = (SYSTEM_INT16)OPM_SymRInt();
|
||||||
(*ext)[0] = (CHAR)s;
|
(*ext)[0] = (CHAR)s;
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i <= s) {
|
while (i <= s) {
|
||||||
|
|
@ -1439,7 +1439,7 @@ static void OPT_OutStr (OPT_Struct typ)
|
||||||
OPT_Object strobj = NIL;
|
OPT_Object strobj = NIL;
|
||||||
if (typ->ref < OPT_expCtxt.ref) {
|
if (typ->ref < OPT_expCtxt.ref) {
|
||||||
OPM_SymWInt(-typ->ref);
|
OPM_SymWInt(-typ->ref);
|
||||||
if (__IN(typ->ref, 0x70)) {
|
if (typ->ref == 5) {
|
||||||
OPM_SymWInt(typ->size);
|
OPM_SymWInt(typ->size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1537,7 +1537,7 @@ static void OPT_OutConstant (OPT_Object obj)
|
||||||
case 2: case 3:
|
case 2: case 3:
|
||||||
OPM_SymWCh((CHAR)obj->conval->intval);
|
OPM_SymWCh((CHAR)obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_SymWInt(obj->conval->intval);
|
OPM_SymWInt(obj->conval->intval);
|
||||||
OPM_SymWInt(obj->typ->size);
|
OPM_SymWInt(obj->typ->size);
|
||||||
break;
|
break;
|
||||||
|
|
@ -1631,7 +1631,7 @@ static void OPT_OutObj (OPT_Object obj)
|
||||||
OPM_SymWInt(33);
|
OPM_SymWInt(33);
|
||||||
OPT_OutSign(obj->typ, obj->link);
|
OPT_OutSign(obj->typ, obj->link);
|
||||||
ext = obj->conval->ext;
|
ext = obj->conval->ext;
|
||||||
j = (*ext)[0];
|
j = (SYSTEM_INT16)(*ext)[0];
|
||||||
i = 1;
|
i = 1;
|
||||||
OPM_SymWInt(j);
|
OPM_SymWInt(j);
|
||||||
while (i <= 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*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
|
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*)"FALSE", 0);
|
||||||
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
||||||
OPT_EnterProc((CHAR*)"HALT", 0);
|
OPT_EnterProc((CHAR*)"HALT", 0);
|
||||||
|
|
@ -1904,9 +1904,7 @@ export void *OPT__init(void)
|
||||||
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
||||||
OPT_impCtxt.ref[2] = OPT_booltyp;
|
OPT_impCtxt.ref[2] = OPT_booltyp;
|
||||||
OPT_impCtxt.ref[3] = OPT_chartyp;
|
OPT_impCtxt.ref[3] = OPT_chartyp;
|
||||||
OPT_impCtxt.ref[4] = OPT_sinttyp;
|
|
||||||
OPT_impCtxt.ref[5] = OPT_inttyp;
|
OPT_impCtxt.ref[5] = OPT_inttyp;
|
||||||
OPT_impCtxt.ref[6] = OPT_linttyp;
|
|
||||||
OPT_impCtxt.ref[7] = OPT_realtyp;
|
OPT_impCtxt.ref[7] = OPT_realtyp;
|
||||||
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
||||||
OPT_impCtxt.ref[9] = OPT_settyp;
|
OPT_impCtxt.ref[9] = OPT_settyp;
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ void OPV_TypSize (OPT_Struct typ)
|
||||||
}
|
}
|
||||||
typ->size = offset;
|
typ->size = offset;
|
||||||
typ->align = base;
|
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) {
|
} else if (c == 2) {
|
||||||
OPV_TypSize(typ->BaseTyp);
|
OPV_TypSize(typ->BaseTyp);
|
||||||
typ->size = typ->n * typ->BaseTyp->size;
|
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)
|
static void OPV_SizeCast (LONGINT from, LONGINT to)
|
||||||
{
|
{
|
||||||
if ((from != to && (from > 4 || to > 4))) {
|
if ((from != to && (from > 4 || to != 4))) {
|
||||||
switch (to) {
|
switch (to) {
|
||||||
case 1:
|
case 1:
|
||||||
OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14);
|
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);
|
OPM_WriteString((CHAR*)"__SETOF(", 9);
|
||||||
OPV_Entier(n, -1);
|
OPV_Entier(n, -1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
} else if (__IN(to, 0x70)) {
|
} else if (to == 5) {
|
||||||
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
||||||
OPM_WriteString((CHAR*)"__SHORT", 8);
|
OPM_WriteString((CHAR*)"__SHORT", 8);
|
||||||
if (OPV_SideEffects(n)) {
|
if (OPV_SideEffects(n)) {
|
||||||
|
|
@ -589,7 +589,7 @@ static void OPV_design (OPT_Node n, INTEGER prec)
|
||||||
obj = n->obj;
|
obj = n->obj;
|
||||||
class = n->class;
|
class = n->class;
|
||||||
designPrec = OPV_Precedence(class, n->subcl, n->typ->form, comp);
|
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;
|
designPrec = 9;
|
||||||
}
|
}
|
||||||
if (prec > designPrec) {
|
if (prec > designPrec) {
|
||||||
|
|
@ -688,7 +688,7 @@ static void OPV_design (OPT_Node n, INTEGER prec)
|
||||||
if (__IN(3, OPM_opt)) {
|
if (__IN(3, OPM_opt)) {
|
||||||
if (typ->comp == 4) {
|
if (typ->comp == 4) {
|
||||||
OPM_WriteString((CHAR*)"__GUARDR(", 10);
|
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_WriteStringVar((void*)obj->scope->name, 256);
|
||||||
OPM_WriteString((CHAR*)"__curr->", 9);
|
OPM_WriteString((CHAR*)"__curr->", 9);
|
||||||
OPC_Ident(obj);
|
OPC_Ident(obj);
|
||||||
|
|
@ -797,10 +797,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) {
|
if ((__IN(form, 0x0180) && n->typ->form == 5)) {
|
||||||
OPM_WriteString((CHAR*)"(double)", 9);
|
OPM_WriteString((CHAR*)"(double)", 9);
|
||||||
prec = 9;
|
prec = 9;
|
||||||
} else if (__IN(form, 0x70)) {
|
} else if (form == 5) {
|
||||||
OPV_SizeCast(n->typ->size, typ->size);
|
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)) {
|
if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) {
|
||||||
OPV_expr(n->left, prec);
|
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);
|
OPV_ParIntLiteral(n->conval->intval, n->typ->size);
|
||||||
} else {
|
} else {
|
||||||
OPV_expr(n, prec);
|
OPV_expr(n, prec);
|
||||||
|
|
@ -965,7 +965,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 29:
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
@ -1115,7 +1115,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPM_WriteString((CHAR*)" ^ ", 4);
|
OPM_WriteString((CHAR*)" ^ ", 4);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)" / ", 4);
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
|
||||||
Platform_ArgVecPtr av = NIL;
|
Platform_ArgVecPtr av = NIL;
|
||||||
Platform_MainStackFrame = argvadr;
|
Platform_MainStackFrame = argvadr;
|
||||||
Platform_ArgCount = argc;
|
Platform_ArgCount = argc;
|
||||||
av = __VAL(Platform_ArgVecPtr, argvadr);
|
av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr;
|
||||||
Platform_ArgVector = (*av)[0];
|
Platform_ArgVector = (*av)[0];
|
||||||
Platform_HaltCode = -128;
|
Platform_HaltCode = -128;
|
||||||
Platform_HeapInitHeap();
|
Platform_HeapInitHeap();
|
||||||
|
|
@ -280,7 +280,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
|
||||||
{
|
{
|
||||||
Platform_ArgVec av = NIL;
|
Platform_ArgVec av = NIL;
|
||||||
if (n < Platform_ArgCount) {
|
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);
|
__COPY(*(*av)[__X(n, 1024)], val, val__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -296,11 +296,11 @@ void Platform_GetIntArg (INTEGER n, LONGINT *val)
|
||||||
i = 1;
|
i = 1;
|
||||||
}
|
}
|
||||||
k = 0;
|
k = 0;
|
||||||
d = s[__X(i, 64)] - 48;
|
d = (SYSTEM_INT16)s[__X(i, 64)] - 48;
|
||||||
while ((d >= 0 && d <= 9)) {
|
while ((d >= 0 && d <= 9)) {
|
||||||
k = k * 10 + d;
|
k = k * 10 + d;
|
||||||
i += 1;
|
i += 1;
|
||||||
d = s[__X(i, 64)] - 48;
|
d = (SYSTEM_INT16)s[__X(i, 64)] - 48;
|
||||||
}
|
}
|
||||||
if (s[0] == '-') {
|
if (s[0] == '-') {
|
||||||
k = -k;
|
k = -k;
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,9 @@ void Reals_SetExpo (REAL *x, INTEGER ex)
|
||||||
{
|
{
|
||||||
CHAR c;
|
CHAR c;
|
||||||
__GET((SYSTEM_ADRINT)x + 3, c, CHAR);
|
__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);
|
__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)
|
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;
|
l = b__len;
|
||||||
while (i < l) {
|
while (i < l) {
|
||||||
by = __VAL(CHAR, b[__X(i, b__len)]);
|
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), d__len)] = Reals_ToHex(__ASHR((SYSTEM_INT16)by, 4));
|
||||||
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK(by, -16));
|
d[__X(__ASHL(i, 1) + 1, d__len)] = Reals_ToHex(__MASK((SYSTEM_INT16)by, -16));
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ void Strings_Extract (CHAR *source, LONGINT source__len, INTEGER pos, INTEGER n,
|
||||||
INTEGER len, destLen, i;
|
INTEGER len, destLen, i;
|
||||||
__DUP(source, source__len, CHAR);
|
__DUP(source, source__len, CHAR);
|
||||||
len = Strings_Length(source, source__len);
|
len = Strings_Length(source, source__len);
|
||||||
destLen = dest__len - 1;
|
destLen = (SYSTEM_INT16)dest__len - 1;
|
||||||
if (pos < 0) {
|
if (pos < 0) {
|
||||||
pos = 0;
|
pos = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -746,7 +746,7 @@ static void ReadScaleFactor__32 (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (('0' <= *Scan__31_s->ch && *Scan__31_s->ch <= '9')) {
|
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);
|
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 ('9' < ch) {
|
||||||
if (('A' <= ch && ch <= 'F')) {
|
if (('A' <= ch && ch <= 'F')) {
|
||||||
hex = 1;
|
hex = 1;
|
||||||
ch = (CHAR)(ch - 7);
|
ch = (CHAR)((SYSTEM_INT16)ch - 7);
|
||||||
} else if (('a' <= ch && ch <= 'f')) {
|
} else if (('a' <= ch && ch <= 'f')) {
|
||||||
hex = 1;
|
hex = 1;
|
||||||
ch = (CHAR)(ch - 39);
|
ch = (CHAR)((SYSTEM_INT16)ch - 39);
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -833,13 +833,13 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
if (i - j > 8) {
|
if (i - j > 8) {
|
||||||
j = i - 8;
|
j = i - 8;
|
||||||
}
|
}
|
||||||
k = d[__X(j, 32)] - 48;
|
k = (SYSTEM_INT16)d[__X(j, 32)] - 48;
|
||||||
j += 1;
|
j += 1;
|
||||||
if ((i - j == 7 && k >= 8)) {
|
if ((i - j == 7 && k >= 8)) {
|
||||||
k -= 16;
|
k -= 16;
|
||||||
}
|
}
|
||||||
while (j < i) {
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
if (neg) {
|
if (neg) {
|
||||||
|
|
@ -860,12 +860,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
y = (LONGREAL)0;
|
y = (LONGREAL)0;
|
||||||
g = (LONGREAL)1;
|
g = (LONGREAL)1;
|
||||||
do {
|
do {
|
||||||
y = y * (LONGREAL)10 + (d[__X(j, 32)] - 48);
|
y = y * (LONGREAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == h));
|
} while (!(j == h));
|
||||||
while (j < i) {
|
while (j < i) {
|
||||||
g = g / (LONGREAL)(LONGREAL)10;
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
ReadScaleFactor__32();
|
ReadScaleFactor__32();
|
||||||
|
|
@ -892,12 +892,12 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
x = (REAL)0;
|
x = (REAL)0;
|
||||||
f = (REAL)1;
|
f = (REAL)1;
|
||||||
do {
|
do {
|
||||||
x = x * (REAL)10 + (d[__X(j, 32)] - 48);
|
x = x * (REAL)10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == h));
|
} while (!(j == h));
|
||||||
while (j < i) {
|
while (j < i) {
|
||||||
f = f / (REAL)(REAL)10;
|
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;
|
j += 1;
|
||||||
}
|
}
|
||||||
if (ch == 'E') {
|
if (ch == 'E') {
|
||||||
|
|
@ -929,7 +929,7 @@ void Texts_Scan (Texts_Scanner *S, LONGINT *S__typ)
|
||||||
(*S).class = 3;
|
(*S).class = 3;
|
||||||
k = 0;
|
k = 0;
|
||||||
do {
|
do {
|
||||||
k = k * 10 + (d[__X(j, 32)] - 48);
|
k = k * 10 + ((SYSTEM_INT16)d[__X(j, 32)] - 48);
|
||||||
j += 1;
|
j += 1;
|
||||||
} while (!(j == i));
|
} while (!(j == i));
|
||||||
if (neg) {
|
if (neg) {
|
||||||
|
|
@ -1319,7 +1319,7 @@ void Texts_WriteLongReal (Texts_Writer *W, LONGINT *W__typ, LONGREAL x, INTEGER
|
||||||
} else {
|
} else {
|
||||||
Texts_Write(&*W, W__typ, ' ');
|
Texts_Write(&*W, W__typ, ' ');
|
||||||
}
|
}
|
||||||
e = __ASHR((e - 1023) * 77, 8);
|
e = (SYSTEM_INT16)__ASHR((e - 1023) * 77, 8);
|
||||||
if (e >= 0) {
|
if (e >= 0) {
|
||||||
x = x / (LONGREAL)Reals_TenL(e);
|
x = x / (LONGREAL)Reals_TenL(e);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -868,7 +868,7 @@ void Files_ReadSet (Files_Rider *R, LONGINT *R__typ, SET *x)
|
||||||
LONGINT l;
|
LONGINT l;
|
||||||
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
Files_ReadBytes(&*R, R__typ, (void*)b, 4, 4);
|
||||||
l = ((b[0] + __ASHL(b[1], 8)) + __ASHL(b[2], 16)) + __ASHL(b[3], 24);
|
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)
|
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];
|
CHAR b[4];
|
||||||
LONGINT i;
|
LONGINT i;
|
||||||
i = __VAL(LONGINT, x);
|
i = (LONGINT)x;
|
||||||
b[0] = (CHAR)i;
|
b[0] = (CHAR)i;
|
||||||
b[1] = (CHAR)__ASHR(i, 8);
|
b[1] = (CHAR)__ASHR(i, 8);
|
||||||
b[2] = (CHAR)__ASHR(i, 16);
|
b[2] = (CHAR)__ASHR(i, 16);
|
||||||
|
|
|
||||||
|
|
@ -328,11 +328,11 @@ SYSTEM_PTR Heap_NEWBLK (LONGINT size)
|
||||||
Heap_Lock();
|
Heap_Lock();
|
||||||
blksz = __ASHL(__ASHR(size + 63, 5), 5);
|
blksz = __ASHL(__ASHR(size + 63, 5), 5);
|
||||||
new = Heap_NEWREC((SYSTEM_ADRINT)&blksz);
|
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 - 8, 0, LONGINT);
|
||||||
__PUT(tag, blksz, LONGINT);
|
__PUT(tag, blksz, LONGINT);
|
||||||
__PUT(tag + 8, -8, LONGINT);
|
__PUT(tag + 8, -8, LONGINT);
|
||||||
__PUT(__VAL(LONGINT, new) - 8, tag, LONGINT);
|
__PUT((LONGINT)(SYSTEM_ADRINT)new - 8, tag, LONGINT);
|
||||||
Heap_Unlock();
|
Heap_Unlock();
|
||||||
_o_result = new;
|
_o_result = new;
|
||||||
return _o_result;
|
return _o_result;
|
||||||
|
|
@ -361,7 +361,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
__GET(tag, offset, LONGINT);
|
__GET(tag, offset, LONGINT);
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
p = Heap_FetchAddress(fld);
|
p = Heap_FetchAddress(fld);
|
||||||
__PUT(fld, __VAL(SYSTEM_PTR, n), SYSTEM_PTR);
|
__PUT(fld, (SYSTEM_PTR)(SYSTEM_ADRINT)n, SYSTEM_PTR);
|
||||||
} else {
|
} else {
|
||||||
fld = q + offset;
|
fld = q + offset;
|
||||||
n = Heap_FetchAddress(fld);
|
n = Heap_FetchAddress(fld);
|
||||||
|
|
@ -370,7 +370,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
if (!__ODD(tagbits)) {
|
if (!__ODD(tagbits)) {
|
||||||
__PUT(n - 8, tagbits + 1, LONGINT);
|
__PUT(n - 8, tagbits + 1, LONGINT);
|
||||||
__PUT(q - 8, tag + 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;
|
p = q;
|
||||||
q = n;
|
q = n;
|
||||||
tag = tagbits;
|
tag = tagbits;
|
||||||
|
|
@ -385,7 +385,7 @@ static void Heap_Mark (LONGINT q)
|
||||||
|
|
||||||
static void Heap_MarkP (SYSTEM_PTR p)
|
static void Heap_MarkP (SYSTEM_PTR p)
|
||||||
{
|
{
|
||||||
Heap_Mark(__VAL(LONGINT, p));
|
Heap_Mark((LONGINT)(SYSTEM_ADRINT)p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Heap_Scan (void)
|
static void Heap_Scan (void)
|
||||||
|
|
@ -554,7 +554,7 @@ static void Heap_Finalize (void)
|
||||||
} else {
|
} else {
|
||||||
prev->next = n->next;
|
prev->next = n->next;
|
||||||
}
|
}
|
||||||
(*n->finalize)(__VAL(SYSTEM_PTR, n->obj));
|
(*n->finalize)((SYSTEM_PTR)(SYSTEM_ADRINT)n->obj);
|
||||||
if (prev == NIL) {
|
if (prev == NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -573,7 +573,7 @@ void Heap_FINALL (void)
|
||||||
while (Heap_fin != NIL) {
|
while (Heap_fin != NIL) {
|
||||||
n = Heap_fin;
|
n = Heap_fin;
|
||||||
Heap_fin = Heap_fin->next;
|
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;
|
Heap_FinNode f;
|
||||||
__NEW(f, Heap_FinDesc);
|
__NEW(f, Heap_FinDesc);
|
||||||
f->obj = __VAL(LONGINT, obj);
|
f->obj = (LONGINT)(SYSTEM_ADRINT)obj;
|
||||||
f->finalize = finalize;
|
f->finalize = finalize;
|
||||||
f->marked = 1;
|
f->marked = 1;
|
||||||
f->next = Heap_fin;
|
f->next = Heap_fin;
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,7 @@ void OPB_Index (OPT_Node *x, OPT_Node y)
|
||||||
f = y->typ->form;
|
f = y->typ->form;
|
||||||
if ((*x)->class >= 7) {
|
if ((*x)->class >= 7) {
|
||||||
OPB_err(79);
|
OPB_err(79);
|
||||||
} else if (!__IN(f, 0x70) || __IN(y->class, 0x0300)) {
|
} else if (f != 5 || __IN(y->class, 0x0300)) {
|
||||||
OPB_err(80);
|
OPB_err(80);
|
||||||
y->typ = OPT_inttyp;
|
y->typ = OPT_inttyp;
|
||||||
}
|
}
|
||||||
|
|
@ -466,7 +466,7 @@ void OPB_In (OPT_Node *x, OPT_Node y)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if ((__IN(f, 0x70) && y->typ->form == 9)) {
|
} else if ((f == 5 && y->typ->form == 9)) {
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) {
|
if (k < 0 || k > (SYSTEM_INT64)OPM_MaxSet) {
|
||||||
|
|
@ -568,14 +568,14 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x01f0)) {
|
if (!__IN(f, 0x01a0)) {
|
||||||
OPB_err(96);
|
OPB_err(96);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(f, 0x03f0)) {
|
if (__IN(f, 0x03a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-9223372036854775807-1)) {
|
if (z->conval->intval == (-9223372036854775807-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -596,9 +596,9 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 21:
|
case 21:
|
||||||
if (__IN(f, 0x01f0)) {
|
if (__IN(f, 0x01a0)) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->conval->intval == (-9223372036854775807-1)) {
|
if (z->conval->intval == (-9223372036854775807-1)) {
|
||||||
OPB_err(203);
|
OPB_err(203);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -630,7 +630,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
z->conval->intval = OPB_BoolToInt(__ODD(z->conval->intval));
|
||||||
z->obj = NIL;
|
z->obj = NIL;
|
||||||
|
|
@ -655,7 +655,7 @@ void OPB_MOp (SHORTINT op, OPT_Node *x)
|
||||||
z->typ = OPT_linttyp;
|
z->typ = OPT_linttyp;
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
if ((__IN(f, 0x70) && z->class == 7)) {
|
if ((f == 5 && z->class == 7)) {
|
||||||
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
if ((0 <= z->conval->intval && z->conval->intval <= -1)) {
|
||||||
z = NewOp__29(op, typ, z);
|
z = NewOp__29(op, typ, z);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -778,7 +778,7 @@ static INTEGER ConstCmp__14 (void)
|
||||||
case 0:
|
case 0:
|
||||||
res = 9;
|
res = 9;
|
||||||
break;
|
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) {
|
if ((*ConstOp__13_s->xval)->intval < (*ConstOp__13_s->yval)->intval) {
|
||||||
res = 11;
|
res = 11;
|
||||||
} else if ((*ConstOp__13_s->xval)->intval > (*ConstOp__13_s->yval)->intval) {
|
} 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;
|
__GUARDEQP(yval, OPT_ConstDesc) = *xval;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (x->typ->size <= y->typ->size) {
|
if (x->typ->size <= y->typ->size) {
|
||||||
x->typ = y->typ;
|
x->typ = y->typ;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -885,7 +885,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 8) {
|
} else if (g == 8) {
|
||||||
|
|
@ -897,7 +897,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
y->typ = x->typ;
|
y->typ = x->typ;
|
||||||
yval->realval = yval->intval;
|
yval->realval = yval->intval;
|
||||||
} else if (g == 7) {
|
} else if (g == 7) {
|
||||||
|
|
@ -941,7 +941,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
xv = xval->intval;
|
xv = xval->intval;
|
||||||
yv = yval->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))) {
|
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;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->realval = xval->intval / (REAL)yval->intval;
|
xval->realval = xval->intval / (REAL)yval->intval;
|
||||||
OPB_CheckRealType(7, 205, xval);
|
OPB_CheckRealType(7, 205, xval);
|
||||||
|
|
@ -989,7 +989,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = __DIV(xval->intval, yval->intval);
|
xval->intval = __DIV(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1001,7 +1001,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (yval->intval != 0) {
|
if (yval->intval != 0) {
|
||||||
xval->intval = __MOD(xval->intval, yval->intval);
|
xval->intval = __MOD(xval->intval, yval->intval);
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1020,7 +1020,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval);
|
temp = (yval->intval >= 0 && xval->intval <= 9223372036854775807 - yval->intval);
|
||||||
if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) {
|
if (temp || (yval->intval < 0 && xval->intval >= (-9223372036854775807-1) - yval->intval)) {
|
||||||
xval->intval += yval->intval;
|
xval->intval += yval->intval;
|
||||||
|
|
@ -1043,7 +1043,7 @@ static void OPB_ConstOp (INTEGER op, OPT_Node x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
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)) {
|
if ((yval->intval >= 0 && xval->intval >= (-9223372036854775807-1) + yval->intval) || (yval->intval < 0 && xval->intval <= 9223372036854775807 + yval->intval)) {
|
||||||
xval->intval -= yval->intval;
|
xval->intval -= yval->intval;
|
||||||
OPB_SetIntType(x);
|
OPB_SetIntType(x);
|
||||||
|
|
@ -1123,8 +1123,8 @@ static void OPB_Convert (OPT_Node *x, OPT_Struct typ)
|
||||||
f = (*x)->typ->form;
|
f = (*x)->typ->form;
|
||||||
g = typ->form;
|
g = typ->form;
|
||||||
if ((*x)->class == 7) {
|
if ((*x)->class == 7) {
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
if (f > g) {
|
if (f > g) {
|
||||||
OPB_SetIntType(*x);
|
OPB_SetIntType(*x);
|
||||||
if ((*x)->typ->size > typ->size) {
|
if ((*x)->typ->size > typ->size) {
|
||||||
|
|
@ -1248,17 +1248,17 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if ((__IN(g, 0x70) && y->typ->size < z->typ->size)) {
|
if ((g == 5 && y->typ->size < z->typ->size)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x01f0)) {
|
} else if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(100);
|
OPB_err(100);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (__IN(g, 0x70)) {
|
if (g == 5) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&z, y->typ);
|
OPB_Convert(&z, y->typ);
|
||||||
|
|
@ -1267,7 +1267,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (__IN(g, 0x01f0)) {
|
if (__IN(g, 0x01a0)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
} else if (__IN(g, 0x0180)) {
|
} else if (__IN(g, 0x0180)) {
|
||||||
OPB_Convert(&y, z->typ);
|
OPB_Convert(&y, z->typ);
|
||||||
|
|
@ -1306,7 +1306,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 1:
|
case 1:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (z->class == 7) {
|
if (z->class == 7) {
|
||||||
val = z->conval->intval;
|
val = z->conval->intval;
|
||||||
if (val == 1) {
|
if (val == 1) {
|
||||||
|
|
@ -1346,7 +1346,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((y->class == 7 && y->conval->intval == 0)) {
|
if ((y->class == 7 && y->conval->intval == 0)) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
}
|
}
|
||||||
|
|
@ -1365,7 +1365,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
val = y->conval->intval;
|
val = y->conval->intval;
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
|
|
@ -1388,7 +1388,7 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (y->class == 7) {
|
if (y->class == 7) {
|
||||||
if (y->conval->intval == 0) {
|
if (y->conval->intval == 0) {
|
||||||
OPB_err(205);
|
OPB_err(205);
|
||||||
|
|
@ -1420,12 +1420,12 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(105);
|
OPB_err(105);
|
||||||
typ = OPT_undftyp;
|
typ = OPT_undftyp;
|
||||||
}
|
}
|
||||||
do_ = 1;
|
do_ = 1;
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if ((z->class == 7 && z->conval->intval == 0)) {
|
if ((z->class == 7 && z->conval->intval == 0)) {
|
||||||
do_ = 0;
|
do_ = 0;
|
||||||
z = y;
|
z = y;
|
||||||
|
|
@ -1439,11 +1439,11 @@ void OPB_Op (SHORTINT op, OPT_Node *x, OPT_Node y)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(f, 0x03f1)) {
|
if (!__IN(f, 0x03e1)) {
|
||||||
OPB_err(106);
|
OPB_err(106);
|
||||||
typ = OPT_undftyp;
|
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);
|
NewOp__39(op, typ, &z, y);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1499,7 +1499,7 @@ void OPB_SetRange (OPT_Node *x, OPT_Node y)
|
||||||
LONGINT k, l;
|
LONGINT k, l;
|
||||||
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
if ((((*x)->class == 8 || (*x)->class == 9) || y->class == 8) || y->class == 9) {
|
||||||
OPB_err(126);
|
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) {
|
if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) {
|
if (0 > k || k > (SYSTEM_INT64)OPM_MaxSet) {
|
||||||
|
|
@ -1534,7 +1534,7 @@ void OPB_SetElem (OPT_Node *x)
|
||||||
LONGINT k;
|
LONGINT k;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x70)) {
|
} else if ((*x)->typ->form != 5) {
|
||||||
OPB_err(93);
|
OPB_err(93);
|
||||||
} else if ((*x)->class == 7) {
|
} else if ((*x)->class == 7) {
|
||||||
k = (*x)->conval->intval;
|
k = (*x)->conval->intval;
|
||||||
|
|
@ -1584,7 +1584,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
case 0: case 10:
|
case 0: case 10:
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
if (!((__IN(g, 0x7a) && y->size == 1))) {
|
if (!((__IN(g, 0x2a) && y->size == 1))) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1593,18 +1593,18 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
if (!__IN(g, 0x70) || x->size < y->size) {
|
if (g != 5 || x->size < y->size) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
if (!__IN(g, 0xf0)) {
|
if (!__IN(g, 0xe0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
if (!__IN(g, 0x01f0)) {
|
if (!__IN(g, 0x01e0)) {
|
||||||
OPB_err(113);
|
OPB_err(113);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
@ -1687,7 +1687,7 @@ static void OPB_CheckAssign (OPT_Struct x, OPT_Node ynode)
|
||||||
OPM_LogWLn();
|
OPM_LogWLn();
|
||||||
break;
|
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);
|
OPB_Convert(&ynode, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1705,7 +1705,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
switch (fctno) {
|
switch (fctno) {
|
||||||
case 0:
|
case 0:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1778,7 +1778,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(0);
|
x = OPB_NewIntConst(0);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMinimum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1809,7 +1809,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
x = OPB_NewIntConst(255);
|
x = OPB_NewIntConst(255);
|
||||||
x->typ = OPT_chartyp;
|
x->typ = OPT_chartyp;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
x = OPB_NewIntConst(OPM_SignedMaximum(x->typ->size));
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -1833,7 +1833,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 9:
|
case 9:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x71)) {
|
} else if (__IN(f, 0x21)) {
|
||||||
OPB_Convert(&x, OPT_chartyp);
|
OPB_Convert(&x, OPT_chartyp);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1843,7 +1843,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 10:
|
case 10:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
typ = OPT_ShorterOrLongerType(x->typ, -1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1859,7 +1859,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 11:
|
case 11:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
typ = OPT_ShorterOrLongerType(x->typ, 1);
|
||||||
if (typ == NIL) {
|
if (typ == NIL) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -1877,7 +1877,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 13: case 14:
|
case 13: case 14:
|
||||||
if (OPB_NotVar(x)) {
|
if (OPB_NotVar(x)) {
|
||||||
OPB_err(112);
|
OPB_err(112);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else if (x->readonly) {
|
} else if (x->readonly) {
|
||||||
OPB_err(76);
|
OPB_err(76);
|
||||||
|
|
@ -1912,7 +1912,7 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) {
|
if (x->typ->size != (SYSTEM_INT64)OPM_LIntSize) {
|
||||||
OPB_Convert(&x, OPT_linttyp);
|
OPB_Convert(&x, OPT_linttyp);
|
||||||
}
|
}
|
||||||
|
|
@ -1944,22 +1944,22 @@ void OPB_StPar0 (OPT_Node *par0, INTEGER fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x027a)) {
|
} else if (!__IN(f, 0x022a)) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 24: case 25: case 28: case 31:
|
case 24: case 25: case 28: case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 26: case 27:
|
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) {
|
if (x->conval->intval < 0 || x->conval->intval > -1) {
|
||||||
OPB_err(220);
|
OPB_err(220);
|
||||||
}
|
}
|
||||||
|
|
@ -2037,7 +2037,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
} else {
|
} else {
|
||||||
if (x->typ != p->typ) {
|
if (x->typ != p->typ) {
|
||||||
if ((x->class == 7 && __IN(f, 0x70))) {
|
if ((x->class == 7 && f == 5)) {
|
||||||
OPB_Convert(&x, p->typ);
|
OPB_Convert(&x, p->typ);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2050,7 +2050,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 15: case 16:
|
case 15: case 16:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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))) {
|
if ((x->class == 7 && (0 > x->conval->intval || x->conval->intval > (SYSTEM_INT64)OPM_MaxSet))) {
|
||||||
OPB_err(202);
|
OPB_err(202);
|
||||||
}
|
}
|
||||||
|
|
@ -2061,7 +2061,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
p->typ = OPT_notyp;
|
p->typ = OPT_notyp;
|
||||||
break;
|
break;
|
||||||
case 17:
|
case 17:
|
||||||
if (!__IN(f, 0x70) || x->class != 7) {
|
if (!(f == 5) || x->class != 7) {
|
||||||
OPB_err(69);
|
OPB_err(69);
|
||||||
} else if (x->typ->size == 1) {
|
} else if (x->typ->size == 1) {
|
||||||
L = (SYSTEM_INT32)x->conval->intval;
|
L = (SYSTEM_INT32)x->conval->intval;
|
||||||
|
|
@ -2110,7 +2110,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 19:
|
case 19:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
if ((p->class == 7 && x->class == 7)) {
|
if ((p->class == 7 && x->class == 7)) {
|
||||||
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
if (-OPB_maxExp > x->conval->intval || x->conval->intval > OPB_maxExp) {
|
||||||
OPB_err(208);
|
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) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp == 3) {
|
} 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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
OPB_err(63);
|
||||||
}
|
}
|
||||||
|
|
@ -2154,7 +2154,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 22: case 23:
|
case 22: case 23:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (!__IN(f, 0x70)) {
|
} else if (f != 5) {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
} else {
|
} else {
|
||||||
if (fctno == 22) {
|
if (fctno == 22) {
|
||||||
|
|
@ -2186,7 +2186,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 28:
|
case 28:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(12, 26, p, x);
|
p = NewOp__53(12, 26, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2210,7 +2210,7 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 30:
|
case 30:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
p = NewOp__53(19, 30, p, x);
|
p = NewOp__53(19, 30, p, x);
|
||||||
} else {
|
} else {
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
|
|
@ -2220,16 +2220,16 @@ void OPB_StPar1 (OPT_Node *par0, OPT_Node x, SHORTINT fctno)
|
||||||
case 31:
|
case 31:
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
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);
|
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);
|
OPB_err(111);
|
||||||
x->typ = OPT_linttyp;
|
x->typ = OPT_linttyp;
|
||||||
}
|
}
|
||||||
p->link = x;
|
p->link = x;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
if ((__IN(f, 0x70) && x->class == 7)) {
|
if ((f == 5 && x->class == 7)) {
|
||||||
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
if ((0 <= x->conval->intval && x->conval->intval <= 255)) {
|
||||||
OPB_BindNodes(28, OPT_notyp, &x, x);
|
OPB_BindNodes(28, OPT_notyp, &x, x);
|
||||||
x->conval = OPT_NewConst();
|
x->conval = OPT_NewConst();
|
||||||
|
|
@ -2272,7 +2272,7 @@ void OPB_StParN (OPT_Node *par0, OPT_Node x, INTEGER fctno, INTEGER n)
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (p->typ->comp != 3) {
|
} else if (p->typ->comp != 3) {
|
||||||
OPB_err(64);
|
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))) {
|
if ((x->class == 7 && (x->conval->intval <= 0 || x->conval->intval > OPM_MaxIndex))) {
|
||||||
OPB_err(63);
|
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)) {
|
} else if ((fctno == 31 && n == 2)) {
|
||||||
if (x->class == 8 || x->class == 9) {
|
if (x->class == 8 || x->class == 9) {
|
||||||
OPB_err(126);
|
OPB_err(126);
|
||||||
} else if (__IN(f, 0x70)) {
|
} else if (f == 5) {
|
||||||
node = OPT_NewNode(19);
|
node = OPT_NewNode(19);
|
||||||
node->subcl = 31;
|
node->subcl = 31;
|
||||||
node->right = p;
|
node->right = p;
|
||||||
|
|
@ -2376,7 +2376,7 @@ static void OPB_DynArrParCheck (OPT_Struct ftyp, OPT_Struct atyp, BOOLEAN fvarpa
|
||||||
ftyp = ftyp->BaseTyp;
|
ftyp = ftyp->BaseTyp;
|
||||||
atyp = atyp->BaseTyp;
|
atyp = atyp->BaseTyp;
|
||||||
if ((fvarpar && ftyp == OPT_bytetyp)) {
|
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)) {
|
if (__IN(18, OPM_opt)) {
|
||||||
OPB_err(-301);
|
OPB_err(-301);
|
||||||
}
|
}
|
||||||
|
|
@ -2459,7 +2459,7 @@ void OPB_Param (OPT_Node ap, OPT_Object fp)
|
||||||
OPB_err(111);
|
OPB_err(111);
|
||||||
}
|
}
|
||||||
} else if ((fp->typ == OPT_sysptrtyp && ap->typ->form == 13)) {
|
} 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);
|
OPB_err(123);
|
||||||
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
} else if ((fp->typ->form == 13 && ap->class == 5)) {
|
||||||
OPB_err(123);
|
OPB_err(123);
|
||||||
|
|
|
||||||
|
|
@ -1879,7 +1879,7 @@ void OPC_Case (LONGINT caseVal, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(caseVal);
|
OPC_CharacterLiteral(caseVal);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(caseVal);
|
OPM_WriteInt(caseVal);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
@ -1977,7 +1977,7 @@ void OPC_Constant (OPT_Const con, INTEGER form)
|
||||||
case 3:
|
case 3:
|
||||||
OPC_CharacterLiteral(con->intval);
|
OPC_CharacterLiteral(con->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_WriteInt(con->intval);
|
OPM_WriteInt(con->intval);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
|
|
|
||||||
|
|
@ -533,12 +533,12 @@ void OPM_err (INTEGER n)
|
||||||
|
|
||||||
void OPM_FPrint (LONGINT *fp, LONGINT val)
|
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)
|
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)
|
void OPM_FPrintReal (LONGINT *fp, REAL real)
|
||||||
|
|
@ -752,7 +752,7 @@ void OPM_SymWInt (LONGINT i)
|
||||||
|
|
||||||
void OPM_SymWSet (SET s)
|
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)
|
void OPM_SymWReal (REAL r)
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ static void OPP_CheckSysFlag (INTEGER *sysflag, INTEGER default_)
|
||||||
OPP_err(135);
|
OPP_err(135);
|
||||||
}
|
}
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
sf = x->conval->intval;
|
sf = x->conval->intval;
|
||||||
if (sf < 0 || sf > 1) {
|
if (sf < 0 || sf > 1) {
|
||||||
OPP_err(220);
|
OPP_err(220);
|
||||||
|
|
@ -269,7 +269,7 @@ static void OPP_ArrayType (OPT_Struct *typ, OPT_Struct *banned)
|
||||||
*typ = OPT_NewStr(15, 2);
|
*typ = OPT_NewStr(15, 2);
|
||||||
(*typ)->sysflag = sysflag;
|
(*typ)->sysflag = sysflag;
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
if (__IN(x->typ->form, 0x70)) {
|
if (x->typ->form == 5) {
|
||||||
n = x->conval->intval;
|
n = x->conval->intval;
|
||||||
if (n <= 0 || n > OPM_MaxIndex) {
|
if (n <= 0 || n > OPM_MaxIndex) {
|
||||||
OPP_err(63);
|
OPP_err(63);
|
||||||
|
|
@ -626,7 +626,7 @@ static void OPP_StandProcCall (OPT_Node *x)
|
||||||
OPT_Node y = NIL;
|
OPT_Node y = NIL;
|
||||||
SHORTINT m;
|
SHORTINT m;
|
||||||
INTEGER n;
|
INTEGER n;
|
||||||
m = (SYSTEM_INT8)(*x)->obj->adr;
|
m = (SYSTEM_INT8)((SYSTEM_INT32)(*x)->obj->adr);
|
||||||
n = 0;
|
n = 0;
|
||||||
if (OPP_sym == 30) {
|
if (OPP_sym == 30) {
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
|
|
@ -1174,14 +1174,14 @@ static void OPP_CaseLabelList (OPT_Node *lab, OPT_Struct LabelTyp, INTEGER *n, O
|
||||||
for (;;) {
|
for (;;) {
|
||||||
OPP_ConstExpression(&x);
|
OPP_ConstExpression(&x);
|
||||||
f = x->typ->form;
|
f = x->typ->form;
|
||||||
if (__IN(f, 0x78)) {
|
if (__IN(f, 0x28)) {
|
||||||
xval = x->conval->intval;
|
xval = x->conval->intval;
|
||||||
} else {
|
} else {
|
||||||
OPP_err(61);
|
OPP_err(61);
|
||||||
xval = 1;
|
xval = 1;
|
||||||
}
|
}
|
||||||
if (__IN(f, 0x70)) {
|
if (f == 5) {
|
||||||
if (!__IN(LabelTyp->form, 0x70) || LabelTyp->size < x->typ->size) {
|
if (!(LabelTyp->form == 5) || LabelTyp->size < x->typ->size) {
|
||||||
OPP_err(60);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
} else if (LabelTyp->form != f) {
|
} 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);
|
OPS_Get(&OPP_sym);
|
||||||
OPP_ConstExpression(&y);
|
OPP_ConstExpression(&y);
|
||||||
yval = y->conval->intval;
|
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);
|
OPP_err(60);
|
||||||
}
|
}
|
||||||
if (yval < xval) {
|
if (yval < xval) {
|
||||||
|
|
@ -1254,7 +1254,7 @@ static void CasePart__31 (OPT_Node *x)
|
||||||
*StatSeq__30_s->pos = OPM_errpos;
|
*StatSeq__30_s->pos = OPM_errpos;
|
||||||
if ((*x)->class == 8 || (*x)->class == 9) {
|
if ((*x)->class == 8 || (*x)->class == 9) {
|
||||||
OPP_err(126);
|
OPP_err(126);
|
||||||
} else if (!__IN((*x)->typ->form, 0x78)) {
|
} else if (!__IN((*x)->typ->form, 0x38)) {
|
||||||
OPP_err(125);
|
OPP_err(125);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(25);
|
OPP_CheckSym(25);
|
||||||
|
|
@ -1440,7 +1440,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
OPS_Get(&OPP_sym);
|
OPS_Get(&OPP_sym);
|
||||||
if (OPP_sym == 38) {
|
if (OPP_sym == 38) {
|
||||||
OPP_qualident(&id);
|
OPP_qualident(&id);
|
||||||
if (!__IN(id->typ->form, 0x70)) {
|
if (!(id->typ->form == 5)) {
|
||||||
OPP_err(68);
|
OPP_err(68);
|
||||||
}
|
}
|
||||||
OPP_CheckSym(34);
|
OPP_CheckSym(34);
|
||||||
|
|
@ -1472,7 +1472,7 @@ static void OPP_StatSeq (OPT_Node *stat)
|
||||||
SetPos__35(z);
|
SetPos__35(z);
|
||||||
OPB_Link(&*stat, &last, z);
|
OPB_Link(&*stat, &last, z);
|
||||||
y = OPB_NewLeaf(t);
|
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);
|
OPP_err(113);
|
||||||
}
|
}
|
||||||
OPB_Link(&*stat, &last, x);
|
OPB_Link(&*stat, &last, x);
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, INTEGER dir)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
INTEGER i;
|
INTEGER i;
|
||||||
__ASSERT(__IN(x->form, 0x70), 0);
|
__ASSERT(x->form == 5, 0);
|
||||||
__ASSERT(dir == 1 || dir == -1, 0);
|
__ASSERT(dir == 1 || dir == -1, 0);
|
||||||
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
__ASSERT(x->BaseTyp == OPT_undftyp, 0);
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
@ -650,7 +650,7 @@ void OPT_FPrintObj (OPT_Object obj)
|
||||||
f = obj->typ->form;
|
f = obj->typ->form;
|
||||||
OPM_FPrint(&fprint, f);
|
OPM_FPrint(&fprint, f);
|
||||||
switch (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);
|
OPM_FPrint(&fprint, obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -851,7 +851,7 @@ static void OPT_InConstant (LONGINT f, OPT_Const conval)
|
||||||
OPM_SymRCh(&ch);
|
OPM_SymRCh(&ch);
|
||||||
conval->intval = ch;
|
conval->intval = ch;
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
conval->intval = OPM_SymRInt();
|
conval->intval = OPM_SymRInt();
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
|
|
@ -980,7 +980,7 @@ static OPT_Object OPT_InTProc (SHORTINT mno)
|
||||||
static OPT_Struct OPT_InTyp (LONGINT tag)
|
static OPT_Struct OPT_InTyp (LONGINT tag)
|
||||||
{
|
{
|
||||||
OPT_Struct _o_result;
|
OPT_Struct _o_result;
|
||||||
if (__IN(tag, 0x70)) {
|
if (tag == 5) {
|
||||||
_o_result = OPT_IntType(OPM_SymRInt());
|
_o_result = OPT_IntType(OPM_SymRInt());
|
||||||
return _o_result;
|
return _o_result;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1440,7 +1440,7 @@ static void OPT_OutStr (OPT_Struct typ)
|
||||||
OPT_Object strobj = NIL;
|
OPT_Object strobj = NIL;
|
||||||
if (typ->ref < OPT_expCtxt.ref) {
|
if (typ->ref < OPT_expCtxt.ref) {
|
||||||
OPM_SymWInt(-typ->ref);
|
OPM_SymWInt(-typ->ref);
|
||||||
if (__IN(typ->ref, 0x70)) {
|
if (typ->ref == 5) {
|
||||||
OPM_SymWInt(typ->size);
|
OPM_SymWInt(typ->size);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -1538,7 +1538,7 @@ static void OPT_OutConstant (OPT_Object obj)
|
||||||
case 2: case 3:
|
case 2: case 3:
|
||||||
OPM_SymWCh((CHAR)obj->conval->intval);
|
OPM_SymWCh((CHAR)obj->conval->intval);
|
||||||
break;
|
break;
|
||||||
case 4: case 5: case 6:
|
case 5:
|
||||||
OPM_SymWInt(obj->conval->intval);
|
OPM_SymWInt(obj->conval->intval);
|
||||||
OPM_SymWInt(obj->typ->size);
|
OPM_SymWInt(obj->typ->size);
|
||||||
break;
|
break;
|
||||||
|
|
@ -1877,7 +1877,7 @@ export void *OPT__init(void)
|
||||||
OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
|
OPT_EnterTyp((CHAR*)"INTEGER", 5, OPM_IntSize, &OPT_inttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
OPT_EnterTyp((CHAR*)"LONGINT", 5, OPM_LIntSize, &OPT_linttyp);
|
||||||
OPT_EnterTyp((CHAR*)"LONGREAL", 8, OPM_LRealSize, &OPT_lrltyp);
|
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*)"FALSE", 0);
|
||||||
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
OPT_EnterBoolConst((CHAR*)"TRUE", 1);
|
||||||
OPT_EnterProc((CHAR*)"HALT", 0);
|
OPT_EnterProc((CHAR*)"HALT", 0);
|
||||||
|
|
@ -1905,9 +1905,7 @@ export void *OPT__init(void)
|
||||||
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
OPT_impCtxt.ref[1] = OPT_bytetyp;
|
||||||
OPT_impCtxt.ref[2] = OPT_booltyp;
|
OPT_impCtxt.ref[2] = OPT_booltyp;
|
||||||
OPT_impCtxt.ref[3] = OPT_chartyp;
|
OPT_impCtxt.ref[3] = OPT_chartyp;
|
||||||
OPT_impCtxt.ref[4] = OPT_sinttyp;
|
|
||||||
OPT_impCtxt.ref[5] = OPT_inttyp;
|
OPT_impCtxt.ref[5] = OPT_inttyp;
|
||||||
OPT_impCtxt.ref[6] = OPT_linttyp;
|
|
||||||
OPT_impCtxt.ref[7] = OPT_realtyp;
|
OPT_impCtxt.ref[7] = OPT_realtyp;
|
||||||
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
OPT_impCtxt.ref[8] = OPT_lrltyp;
|
||||||
OPT_impCtxt.ref[9] = OPT_settyp;
|
OPT_impCtxt.ref[9] = OPT_settyp;
|
||||||
|
|
|
||||||
|
|
@ -475,7 +475,7 @@ static void OPV_Entier (OPT_Node n, INTEGER prec)
|
||||||
|
|
||||||
static void OPV_SizeCast (LONGINT from, LONGINT to)
|
static void OPV_SizeCast (LONGINT from, LONGINT to)
|
||||||
{
|
{
|
||||||
if ((from != to && (from > 4 || to > 4))) {
|
if ((from != to && (from > 4 || to != 4))) {
|
||||||
switch (to) {
|
switch (to) {
|
||||||
case 1:
|
case 1:
|
||||||
OPM_WriteString((CHAR*)"(SYSTEM_INT8)", 14);
|
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);
|
OPM_WriteString((CHAR*)"__SETOF(", 9);
|
||||||
OPV_Entier(n, -1);
|
OPV_Entier(n, -1);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
} else if (__IN(to, 0x70)) {
|
} else if (to == 5) {
|
||||||
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
if ((newtype->size < n->typ->size && __IN(2, OPM_opt))) {
|
||||||
OPM_WriteString((CHAR*)"__SHORT", 8);
|
OPM_WriteString((CHAR*)"__SHORT", 8);
|
||||||
if (OPV_SideEffects(n)) {
|
if (OPV_SideEffects(n)) {
|
||||||
|
|
@ -798,10 +798,10 @@ static void OPV_ActualPar (OPT_Node n, OPT_Object fp)
|
||||||
OPM_WriteString((CHAR*)"(void*)", 8);
|
OPM_WriteString((CHAR*)"(void*)", 8);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((__IN(form, 0x0180) && __IN(n->typ->form, 0x70))) {
|
if ((__IN(form, 0x0180) && n->typ->form == 5)) {
|
||||||
OPM_WriteString((CHAR*)"(double)", 9);
|
OPM_WriteString((CHAR*)"(double)", 9);
|
||||||
prec = 9;
|
prec = 9;
|
||||||
} else if (__IN(form, 0x70)) {
|
} else if (form == 5) {
|
||||||
OPV_SizeCast(n->typ->size, typ->size);
|
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)) {
|
if ((((mode == 2 && n->class == 11)) && n->subcl == 29)) {
|
||||||
OPV_expr(n->left, prec);
|
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);
|
OPV_ParIntLiteral(n->conval->intval, n->typ->size);
|
||||||
} else {
|
} else {
|
||||||
OPV_expr(n, prec);
|
OPV_expr(n, prec);
|
||||||
|
|
@ -966,7 +966,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 29:
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
@ -1116,7 +1116,7 @@ static void OPV_expr (OPT_Node n, INTEGER prec)
|
||||||
OPM_WriteString((CHAR*)" ^ ", 4);
|
OPM_WriteString((CHAR*)" ^ ", 4);
|
||||||
} else {
|
} else {
|
||||||
OPM_WriteString((CHAR*)" / ", 4);
|
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('(');
|
OPM_Write('(');
|
||||||
OPC_Ident(n->typ->strobj);
|
OPC_Ident(n->typ->strobj);
|
||||||
OPM_Write(')');
|
OPM_Write(')');
|
||||||
|
|
|
||||||
|
|
@ -242,7 +242,7 @@ void Platform_Init (INTEGER argc, LONGINT argvadr)
|
||||||
Platform_ArgVecPtr av = NIL;
|
Platform_ArgVecPtr av = NIL;
|
||||||
Platform_MainStackFrame = argvadr;
|
Platform_MainStackFrame = argvadr;
|
||||||
Platform_ArgCount = argc;
|
Platform_ArgCount = argc;
|
||||||
av = __VAL(Platform_ArgVecPtr, argvadr);
|
av = (Platform_ArgVecPtr)(SYSTEM_ADRINT)argvadr;
|
||||||
Platform_ArgVector = (*av)[0];
|
Platform_ArgVector = (*av)[0];
|
||||||
Platform_HaltCode = -128;
|
Platform_HaltCode = -128;
|
||||||
Platform_HeapInitHeap();
|
Platform_HeapInitHeap();
|
||||||
|
|
@ -281,7 +281,7 @@ void Platform_GetArg (INTEGER n, CHAR *val, LONGINT val__len)
|
||||||
{
|
{
|
||||||
Platform_ArgVec av = NIL;
|
Platform_ArgVec av = NIL;
|
||||||
if (n < Platform_ArgCount) {
|
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);
|
__COPY(*(*av)[__X(n, 1024)], val, val__len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
BEGIN
|
BEGIN
|
||||||
f := y^.typ^.form;
|
f := y^.typ^.form;
|
||||||
IF x^.class >= OPT.Nconst THEN err(79)
|
IF x^.class >= OPT.Nconst THEN err(79)
|
||||||
ELSIF ~(f IN OPT.intSet) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ;
|
ELSIF (f # OPT.Int) OR (y^.class IN {OPT.Nproc, OPT.Ntype}) THEN err(80); y^.typ := OPT.inttyp END ;
|
||||||
IF x^.typ^.comp = OPT.Array THEN typ := x^.typ^.BaseTyp;
|
IF x^.typ^.comp = OPT.Array THEN typ := x^.typ^.BaseTyp;
|
||||||
IF (y^.class = OPT.Nconst) & ((y^.conval^.intval < 0) OR (y^.conval^.intval >= x^.typ^.n)) THEN err(81) END
|
IF (y^.class = OPT.Nconst) & ((y^.conval^.intval < 0) OR (y^.conval^.intval >= x^.typ^.n)) THEN err(81) END
|
||||||
ELSIF x^.typ^.comp = OPT.DynArr THEN typ := x^.typ^.BaseTyp;
|
ELSIF x^.typ^.comp = OPT.DynArr THEN typ := x^.typ^.BaseTyp;
|
||||||
|
|
@ -241,7 +241,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
VAR f: INTEGER; k: LONGINT;
|
VAR f: INTEGER; k: LONGINT;
|
||||||
BEGIN f := x^.typ^.form;
|
BEGIN f := x^.typ^.form;
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF (f IN OPT.intSet) & (y^.typ^.form = OPT.Set) THEN
|
ELSIF (f = OPT.Int) & (y^.typ^.form = OPT.Set) THEN
|
||||||
IF x^.class = OPT.Nconst THEN
|
IF x^.class = OPT.Nconst THEN
|
||||||
k := x^.conval^.intval;
|
k := x^.conval^.intval;
|
||||||
IF (k < 0) OR (k > OPM.MaxSet) THEN err(202)
|
IF (k < 0) OR (k > OPM.MaxSet) THEN err(202)
|
||||||
|
|
@ -298,10 +298,10 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
ELSE err(98)
|
ELSE err(98)
|
||||||
END
|
END
|
||||||
|OPS.plus: IF ~(f IN OPT.intSet + OPT.realSet) THEN err(96) END
|
|OPS.plus: IF ~(f IN {OPT.Int} + OPT.realSet) THEN err(96) END
|
||||||
|OPS.minus: IF f IN OPT.intSet + OPT.realSet +{OPT.Set}THEN
|
|OPS.minus: IF f IN {OPT.Int, OPT.Set} + OPT.realSet THEN
|
||||||
IF z^.class = OPT.Nconst THEN
|
IF z^.class = OPT.Nconst THEN
|
||||||
IF f IN OPT.intSet THEN
|
IF f = OPT.Int THEN
|
||||||
IF z^.conval^.intval = MIN(LONGINT) THEN err(203)
|
IF z^.conval^.intval = MIN(LONGINT) THEN err(203)
|
||||||
ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z)
|
ELSE z^.conval^.intval := -z^.conval^.intval; SetIntType(z)
|
||||||
END
|
END
|
||||||
|
|
@ -313,9 +313,9 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
ELSE err(97)
|
ELSE err(97)
|
||||||
END
|
END
|
||||||
|OPT.abs: IF f IN OPT.intSet + OPT.realSet THEN
|
|OPT.abs: IF f IN {OPT.Int} + OPT.realSet THEN
|
||||||
IF z^.class = OPT.Nconst THEN
|
IF z^.class = OPT.Nconst THEN
|
||||||
IF f IN OPT.intSet THEN
|
IF f = OPT.Int THEN
|
||||||
IF z^.conval^.intval = MIN(LONGINT) THEN err(203)
|
IF z^.conval^.intval = MIN(LONGINT) THEN err(203)
|
||||||
ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z)
|
ELSE z^.conval^.intval := ABS(z^.conval^.intval); SetIntType(z)
|
||||||
END
|
END
|
||||||
|
|
@ -333,7 +333,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
ELSE err(111); z^.typ := OPT.chartyp
|
ELSE err(111); z^.typ := OPT.chartyp
|
||||||
END
|
END
|
||||||
|OPT.odd: IF f IN OPT.intSet THEN
|
|OPT.odd: IF f = OPT.Int THEN
|
||||||
IF z^.class = OPT.Nconst THEN
|
IF z^.class = OPT.Nconst THEN
|
||||||
z^.conval^.intval := BoolToInt(ODD(z^.conval^.intval)); z^.obj := NIL
|
z^.conval^.intval := BoolToInt(ODD(z^.conval^.intval)); z^.obj := NIL
|
||||||
ELSE z := NewOp(op, typ, z)
|
ELSE z := NewOp(op, typ, z)
|
||||||
|
|
@ -348,7 +348,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
ELSE err(127)
|
ELSE err(127)
|
||||||
END ;
|
END ;
|
||||||
z^.typ := OPT.linttyp
|
z^.typ := OPT.linttyp
|
||||||
|OPT.cc: IF (f IN OPT.intSet) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*)
|
|OPT.cc: IF (f = OPT.Int) & (z^.class = OPT.Nconst) THEN (*SYSTEM.CC*)
|
||||||
IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END
|
IF (0 <= z^.conval^.intval) & (z^.conval^.intval <= OPM.MaxCC) THEN z := NewOp(op, typ, z) ELSE err(219) END
|
||||||
ELSE err(69)
|
ELSE err(69)
|
||||||
END ;
|
END ;
|
||||||
|
|
@ -426,7 +426,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
|OPT.Undef: res := OPS.eql
|
|OPT.Undef: res := OPS.eql
|
||||||
|OPT.Byte,
|
|OPT.Byte,
|
||||||
OPT.Char
|
OPT.Char
|
||||||
..OPT.LInt: IF xval^.intval < yval^.intval THEN res := OPS.lss
|
..OPT.Int: IF xval^.intval < yval^.intval THEN res := OPS.lss
|
||||||
ELSIF xval^.intval > yval^.intval THEN res := OPS.gtr
|
ELSIF xval^.intval > yval^.intval THEN res := OPS.gtr
|
||||||
ELSE res := OPS.eql
|
ELSE res := OPS.eql
|
||||||
END
|
END
|
||||||
|
|
@ -463,19 +463,17 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
|OPT.Char: IF g = OPT.String THEN CharToString(x)
|
|OPT.Char: IF g = OPT.String THEN CharToString(x)
|
||||||
ELSE err(100); y^.typ := x^.typ; yval^ := xval^
|
ELSE err(100); y^.typ := x^.typ; yval^ := xval^
|
||||||
END ;
|
END ;
|
||||||
|OPT.SInt,
|
|OPT.Int: IF g = OPT.Int THEN
|
||||||
OPT.Int,
|
|
||||||
OPT.LInt: IF g IN OPT.intSet THEN
|
|
||||||
IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := OPT.IntType(x.typ.size) END
|
IF x.typ.size <= y.typ.size THEN x.typ := y.typ ELSE x.typ := OPT.IntType(x.typ.size) END
|
||||||
ELSIF g = OPT.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval
|
ELSIF g = OPT.Real THEN x^.typ := OPT.realtyp; xval^.realval := xval^.intval
|
||||||
ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval
|
ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp; xval^.realval := xval^.intval
|
||||||
ELSE err(100); y^.typ := x^.typ; yval^ := xval^
|
ELSE err(100); y^.typ := x^.typ; yval^ := xval^
|
||||||
END
|
END
|
||||||
|OPT.Real: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval
|
|OPT.Real: IF g = OPT.Int THEN y^.typ := x^.typ; yval^.realval := yval^.intval
|
||||||
ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp
|
ELSIF g = OPT.LReal THEN x^.typ := OPT.lrltyp
|
||||||
ELSE err(100); y^.typ := x^.typ; yval^ := xval^
|
ELSE err(100); y^.typ := x^.typ; yval^ := xval^
|
||||||
END
|
END
|
||||||
|OPT.LReal: IF g IN OPT.intSet THEN y^.typ := x^.typ; yval^.realval := yval^.intval
|
|OPT.LReal: IF g = OPT.Int THEN y^.typ := x^.typ; yval^.realval := yval^.intval
|
||||||
ELSIF g = OPT.Real THEN y^.typ := OPT.lrltyp
|
ELSIF g = OPT.Real THEN y^.typ := OPT.lrltyp
|
||||||
ELSE err(100); y^.typ := x^.typ; yval^ := xval^
|
ELSE err(100); y^.typ := x^.typ; yval^ := xval^
|
||||||
END
|
END
|
||||||
|
|
@ -490,7 +488,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
f := x^.typ^.form
|
f := x^.typ^.form
|
||||||
END ; (* {x^.typ = y^.typ} *)
|
END ; (* {x^.typ = y^.typ} *)
|
||||||
CASE op OF
|
CASE op OF
|
||||||
|OPS.times: IF f IN OPT.intSet THEN xv := xval^.intval; yv := yval^.intval;
|
|OPS.times: IF f = OPT.Int THEN xv := xval^.intval; yv := yval^.intval;
|
||||||
IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *)
|
IF (xv = 0) OR (yv = 0) OR (* division with negative numbers is not defined *)
|
||||||
(xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR
|
(xv > 0) & (yv > 0) & (yv <= MAX(LONGINT) DIV xv) OR
|
||||||
(xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR
|
(xv > 0) & (yv < 0) & (yv >= MIN(LONGINT) DIV xv) OR
|
||||||
|
|
@ -509,7 +507,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
xval^.setval := xval^.setval * yval^.setval
|
xval^.setval := xval^.setval * yval^.setval
|
||||||
ELSIF f # OPT.Undef THEN err(101)
|
ELSIF f # OPT.Undef THEN err(101)
|
||||||
END
|
END
|
||||||
|OPS.slash: IF f IN OPT.intSet THEN
|
|OPS.slash: IF f = OPT.Int THEN
|
||||||
IF yval^.intval # 0 THEN
|
IF yval^.intval # 0 THEN
|
||||||
xval^.realval := xval^.intval / yval^.intval; CheckRealType(OPT.Real, 205, xval)
|
xval^.realval := xval^.intval / yval^.intval; CheckRealType(OPT.Real, 205, xval)
|
||||||
ELSE err(205); xval^.realval := 1.0
|
ELSE err(205); xval^.realval := 1.0
|
||||||
|
|
@ -525,14 +523,14 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
xval^.setval := xval^.setval / yval^.setval
|
xval^.setval := xval^.setval / yval^.setval
|
||||||
ELSIF f # OPT.Undef THEN err(102)
|
ELSIF f # OPT.Undef THEN err(102)
|
||||||
END
|
END
|
||||||
|OPS.div: IF f IN OPT.intSet THEN
|
|OPS.div: IF f = OPT.Int THEN
|
||||||
IF yval^.intval # 0 THEN
|
IF yval^.intval # 0 THEN
|
||||||
xval^.intval := xval^.intval DIV yval^.intval; SetIntType(x)
|
xval^.intval := xval^.intval DIV yval^.intval; SetIntType(x)
|
||||||
ELSE err(205)
|
ELSE err(205)
|
||||||
END
|
END
|
||||||
ELSIF f # OPT.Undef THEN err(103)
|
ELSIF f # OPT.Undef THEN err(103)
|
||||||
END
|
END
|
||||||
|OPS.mod: IF f IN OPT.intSet THEN
|
|OPS.mod: IF f = OPT.Int THEN
|
||||||
IF yval^.intval # 0 THEN
|
IF yval^.intval # 0 THEN
|
||||||
xval^.intval := xval^.intval MOD yval^.intval; SetIntType(x)
|
xval^.intval := xval^.intval MOD yval^.intval; SetIntType(x)
|
||||||
ELSE err(205)
|
ELSE err(205)
|
||||||
|
|
@ -543,7 +541,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
xval^.intval := BoolToInt(IntToBool(xval^.intval) & IntToBool(yval^.intval))
|
xval^.intval := BoolToInt(IntToBool(xval^.intval) & IntToBool(yval^.intval))
|
||||||
ELSE err(94)
|
ELSE err(94)
|
||||||
END
|
END
|
||||||
|OPS.plus: IF f IN OPT.intSet THEN
|
|OPS.plus: IF f = OPT.Int THEN
|
||||||
temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval);
|
temp := (yval^.intval >= 0) & (xval^.intval <= MAX(LONGINT) - yval^.intval);
|
||||||
IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN
|
IF temp OR (yval^.intval < 0) & (xval^.intval >= MIN(LONGINT) - yval^.intval) THEN
|
||||||
INC(xval^.intval, yval^.intval); SetIntType(x)
|
INC(xval^.intval, yval^.intval); SetIntType(x)
|
||||||
|
|
@ -559,7 +557,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
xval^.setval := xval^.setval + yval^.setval
|
xval^.setval := xval^.setval + yval^.setval
|
||||||
ELSIF f # OPT.Undef THEN err(105)
|
ELSIF f # OPT.Undef THEN err(105)
|
||||||
END
|
END
|
||||||
|OPS.minus: IF f IN OPT.intSet THEN
|
|OPS.minus: IF f = OPT.Int THEN
|
||||||
IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR
|
IF (yval^.intval >= 0) & (xval^.intval >= MIN(LONGINT) + yval^.intval) OR
|
||||||
(yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN
|
(yval^.intval < 0) & (xval^.intval <= MAX(LONGINT) + yval^.intval) THEN
|
||||||
DEC(xval^.intval, yval^.intval); SetIntType(x)
|
DEC(xval^.intval, yval^.intval); SetIntType(x)
|
||||||
|
|
@ -598,12 +596,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
END ConstOp;
|
END ConstOp;
|
||||||
|
|
||||||
PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct);
|
PROCEDURE Convert(VAR x: OPT.Node; typ: OPT.Struct); (* Convert node x to new type typ *)
|
||||||
VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL;
|
VAR node: OPT.Node; f, g: INTEGER; k: LONGINT; r: LONGREAL;
|
||||||
BEGIN f := x^.typ^.form; g := typ^.form;
|
BEGIN f := x^.typ^.form; g := typ^.form;
|
||||||
IF x^.class = OPT.Nconst THEN
|
IF x^.class = OPT.Nconst THEN
|
||||||
IF f IN OPT.intSet THEN
|
IF f = OPT.Int THEN
|
||||||
IF g IN OPT.intSet THEN
|
IF g = OPT.Int THEN
|
||||||
IF f > g THEN SetIntType(x);
|
IF f > g THEN SetIntType(x);
|
||||||
IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END
|
IF x.typ.size > typ.size THEN err(203); x^.conval^.intval := 1 END
|
||||||
END
|
END
|
||||||
|
|
@ -668,17 +666,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
g := y^.typ^.form;
|
g := y^.typ^.form;
|
||||||
CASE z^.typ^.form OF
|
CASE z^.typ^.form OF
|
||||||
|OPT.Char: IF z^.class = OPT.Nconst THEN CharToString(z) ELSE err(100) END
|
|OPT.Char: IF z^.class = OPT.Nconst THEN CharToString(z) ELSE err(100) END
|
||||||
|OPT.SInt,
|
|OPT.Int: IF (g = OPT.Int) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ)
|
||||||
OPT.Int,
|
ELSIF g IN {OPT.Int} + OPT.realSet THEN Convert(z, y.typ)
|
||||||
OPT.LInt: IF (g IN OPT.intSet) & (y.typ.size < z.typ.size) THEN Convert(y, z.typ)
|
|
||||||
ELSIF g IN OPT.intSet + OPT.realSet THEN Convert(z, y.typ)
|
|
||||||
ELSE err(100)
|
ELSE err(100)
|
||||||
END
|
END
|
||||||
|OPT.Real: IF g IN OPT.intSet THEN Convert(y, z^.typ)
|
|OPT.Real: IF g = OPT.Int THEN Convert(y, z^.typ)
|
||||||
ELSIF g IN OPT.realSet THEN Convert(z, y^.typ)
|
ELSIF g IN OPT.realSet THEN Convert(z, y^.typ)
|
||||||
ELSE err(100)
|
ELSE err(100)
|
||||||
END
|
END
|
||||||
|OPT.LReal: IF g IN OPT.intSet + OPT.realSet THEN Convert(y, z^.typ)
|
|OPT.LReal: IF g IN {OPT.Int} + OPT.realSet THEN Convert(y, z^.typ)
|
||||||
ELSIF g IN OPT.realSet THEN Convert(y, z^.typ) (* DCWB: Surely this line does nothing. *)
|
ELSIF g IN OPT.realSet THEN Convert(y, z^.typ) (* DCWB: Surely this line does nothing. *)
|
||||||
ELSE err(100)
|
ELSE err(100)
|
||||||
END
|
END
|
||||||
|
|
@ -693,7 +689,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
typ := z^.typ; f := typ^.form; g := y^.typ^.form;
|
typ := z^.typ; f := typ^.form; g := y^.typ^.form;
|
||||||
CASE op OF
|
CASE op OF
|
||||||
|OPS.times: do := TRUE;
|
|OPS.times: do := TRUE;
|
||||||
IF f IN OPT.intSet THEN
|
IF f = OPT.Int THEN
|
||||||
IF z^.class = OPT.Nconst THEN val := z^.conval^.intval;
|
IF z^.class = OPT.Nconst THEN val := z^.conval^.intval;
|
||||||
IF val = 1 THEN do := FALSE; z := y
|
IF val = 1 THEN do := FALSE; z := y
|
||||||
ELSIF val = 0 THEN do := FALSE
|
ELSIF val = 0 THEN do := FALSE
|
||||||
|
|
@ -711,7 +707,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
ELSIF ~(f IN {OPT.Undef, OPT.Real..OPT.Set}) THEN err(105); typ := OPT.undftyp
|
ELSIF ~(f IN {OPT.Undef, OPT.Real..OPT.Set}) THEN err(105); typ := OPT.undftyp
|
||||||
END ;
|
END ;
|
||||||
IF do THEN NewOp(op, typ, z, y) END
|
IF do THEN NewOp(op, typ, z, y) END
|
||||||
|OPS.slash: IF f IN OPT.intSet THEN
|
|OPS.slash: IF f = OPT.Int THEN
|
||||||
IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN err(205) END ;
|
IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN err(205) END ;
|
||||||
Convert(z, OPT.realtyp); Convert(y, OPT.realtyp);
|
Convert(z, OPT.realtyp); Convert(y, OPT.realtyp);
|
||||||
typ := OPT.realtyp
|
typ := OPT.realtyp
|
||||||
|
|
@ -721,7 +717,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END ;
|
END ;
|
||||||
NewOp(op, typ, z, y)
|
NewOp(op, typ, z, y)
|
||||||
|OPS.div: do := TRUE;
|
|OPS.div: do := TRUE;
|
||||||
IF f IN OPT.intSet THEN
|
IF f = OPT.Int THEN
|
||||||
IF y^.class = OPT.Nconst THEN val := y^.conval^.intval;
|
IF y^.class = OPT.Nconst THEN val := y^.conval^.intval;
|
||||||
IF val = 0 THEN err(205)
|
IF val = 0 THEN err(205)
|
||||||
ELSIF val = 1 THEN do := FALSE
|
ELSIF val = 1 THEN do := FALSE
|
||||||
|
|
@ -732,7 +728,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
ELSIF f # OPT.Undef THEN err(103); typ := OPT.undftyp
|
ELSIF f # OPT.Undef THEN err(103); typ := OPT.undftyp
|
||||||
END ;
|
END ;
|
||||||
IF do THEN NewOp(op, typ, z, y) END
|
IF do THEN NewOp(op, typ, z, y) END
|
||||||
|OPS.mod: IF f IN OPT.intSet THEN
|
|OPS.mod: IF f = OPT.Int THEN
|
||||||
IF y^.class = OPT.Nconst THEN
|
IF y^.class = OPT.Nconst THEN
|
||||||
IF y^.conval^.intval = 0 THEN err(205)
|
IF y^.conval^.intval = 0 THEN err(205)
|
||||||
ELSIF log(y^.conval^.intval) = 1 THEN
|
ELSIF log(y^.conval^.intval) = 1 THEN
|
||||||
|
|
@ -752,15 +748,15 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
ELSIF f # OPT.Undef THEN err(94); z^.typ := OPT.undftyp
|
ELSIF f # OPT.Undef THEN err(94); z^.typ := OPT.undftyp
|
||||||
END
|
END
|
||||||
|OPS.plus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(105); typ := OPT.undftyp END ;
|
|OPS.plus: IF ~(f IN {OPT.Undef, OPT.Int..OPT.Set}) THEN err(105); typ := OPT.undftyp END ;
|
||||||
do := TRUE;
|
do := TRUE;
|
||||||
IF f IN OPT.intSet THEN
|
IF f = OPT.Int THEN
|
||||||
IF (z^.class = OPT.Nconst) & (z^.conval^.intval = 0) THEN do := FALSE; z := y END ;
|
IF (z^.class = OPT.Nconst) & (z^.conval^.intval = 0) THEN do := FALSE; z := y END ;
|
||||||
IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN do := FALSE END
|
IF (y^.class = OPT.Nconst) & (y^.conval^.intval = 0) THEN do := FALSE END
|
||||||
END ;
|
END ;
|
||||||
IF do THEN NewOp(op, typ, z, y) END
|
IF do THEN NewOp(op, typ, z, y) END
|
||||||
|OPS.minus: IF ~(f IN {OPT.Undef, OPT.SInt..OPT.Set}) THEN err(106); typ := OPT.undftyp END ;
|
|OPS.minus: IF ~(f IN {OPT.Undef, OPT.Int..OPT.Set}) THEN err(106); typ := OPT.undftyp END ;
|
||||||
IF ~(f IN OPT.intSet) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END
|
IF (f # OPT.Int) OR (y^.class # OPT.Nconst) OR (y^.conval^.intval # 0) THEN NewOp(op, typ, z, y) END
|
||||||
|OPS.or: IF f = OPT.Bool THEN
|
|OPS.or: IF f = OPT.Bool THEN
|
||||||
IF z^.class = OPT.Nconst THEN
|
IF z^.class = OPT.Nconst THEN
|
||||||
IF ~IntToBool(z^.conval^.intval) THEN z := y END
|
IF ~IntToBool(z^.conval^.intval) THEN z := y END
|
||||||
|
|
@ -795,7 +791,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
VAR k, l: LONGINT;
|
VAR k, l: LONGINT;
|
||||||
BEGIN
|
BEGIN
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) OR (y^.class = OPT.Ntype) OR (y^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF (x^.typ^.form IN OPT.intSet) & (y^.typ^.form IN OPT.intSet) THEN
|
ELSIF (x^.typ^.form = OPT.Int) & (y^.typ^.form = OPT.Int) THEN
|
||||||
IF x^.class = OPT.Nconst THEN
|
IF x^.class = OPT.Nconst THEN
|
||||||
k := x^.conval^.intval;
|
k := x^.conval^.intval;
|
||||||
IF (0 > k) OR (k > OPM.MaxSet) THEN err(202) END
|
IF (0 > k) OR (k > OPM.MaxSet) THEN err(202) END
|
||||||
|
|
@ -821,7 +817,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
VAR k: LONGINT;
|
VAR k: LONGINT;
|
||||||
BEGIN
|
BEGIN
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF ~(x^.typ^.form IN OPT.intSet) THEN err(93)
|
ELSIF x^.typ^.form # OPT.Int THEN err(93)
|
||||||
ELSIF x^.class = OPT.Nconst THEN
|
ELSIF x^.class = OPT.Nconst THEN
|
||||||
k := x^.conval^.intval;
|
k := x^.conval^.intval;
|
||||||
IF (0 <= k) & (k <= OPM.MaxSet) THEN x^.conval^.setval := {k}
|
IF (0 <= k) & (k <= OPM.MaxSet) THEN x^.conval^.setval := {k}
|
||||||
|
|
@ -854,15 +850,13 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
CASE f OF
|
CASE f OF
|
||||||
OPT.Undef,
|
OPT.Undef,
|
||||||
OPT.String:
|
OPT.String:
|
||||||
| OPT.Byte: IF ~((g IN ({OPT.Byte, OPT.Char} + OPT.intSet)) & (y.size = 1)) THEN err(113) END
|
| OPT.Byte: IF ~((g IN {OPT.Byte, OPT.Char, OPT.Int}) & (y.size = 1)) THEN err(113) END
|
||||||
| OPT.Bool,
|
| OPT.Bool,
|
||||||
OPT.Char,
|
OPT.Char,
|
||||||
OPT.Set: IF g # f THEN err(113) END
|
OPT.Set: IF g # f THEN err(113) END
|
||||||
| OPT.SInt,
|
| OPT.Int: IF (g # OPT.Int) OR (x.size < y.size) THEN err(113) END
|
||||||
OPT.Int,
|
| OPT.Real: IF ~(g IN {OPT.Int..OPT.Real}) THEN err(113) END
|
||||||
OPT.LInt: IF ~(g IN OPT.intSet) OR (x.size < y.size) THEN err(113) END
|
| OPT.LReal: IF ~(g IN {OPT.Int..OPT.LReal}) THEN err(113) END
|
||||||
| OPT.Real: IF ~(g IN {OPT.SInt..OPT.Real}) THEN err(113) END
|
|
||||||
| OPT.LReal: IF ~(g IN {OPT.SInt..OPT.LReal}) THEN err(113) END
|
|
||||||
| OPT.Pointer: IF (x = y) OR (g = OPT.NilTyp) OR (x = OPT.sysptrtyp) & (g = OPT.Pointer) THEN (* ok *)
|
| OPT.Pointer: IF (x = y) OR (g = OPT.NilTyp) OR (x = OPT.sysptrtyp) & (g = OPT.Pointer) THEN (* ok *)
|
||||||
ELSIF g = OPT.Pointer THEN
|
ELSIF g = OPT.Pointer THEN
|
||||||
p := x^.BaseTyp; q := y^.BaseTyp;
|
p := x^.BaseTyp; q := y^.BaseTyp;
|
||||||
|
|
@ -909,7 +903,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
ELSE OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn;
|
ELSE OPM.LogWStr("unhandled case in OPB.CheckAssign, f = "); OPM.LogWNum(f, 0); OPM.LogWLn;
|
||||||
END ;
|
END ;
|
||||||
IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.SInt..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN
|
IF (ynode^.class = OPT.Nconst) & (g < f) & (g IN {OPT.Int..OPT.Real}) & (f IN {OPT.Int..OPT.LReal}) THEN
|
||||||
Convert(ynode, x)
|
Convert(ynode, x)
|
||||||
END
|
END
|
||||||
END CheckAssign;
|
END CheckAssign;
|
||||||
|
|
@ -928,7 +922,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
BEGIN x := par0; f := x^.typ^.form;
|
BEGIN x := par0; f := x^.typ^.form;
|
||||||
CASE fctno OF
|
CASE fctno OF
|
||||||
|OPT.haltfn: (*HALT*)
|
|OPT.haltfn: (*HALT*)
|
||||||
IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN
|
IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN
|
||||||
IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN
|
IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN
|
||||||
BindNodes(OPT.Ntrap, OPT.notyp, x, x)
|
BindNodes(OPT.Ntrap, OPT.notyp, x, x)
|
||||||
ELSE err(218)
|
ELSE err(218)
|
||||||
|
|
@ -974,9 +968,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
CASE f OF
|
CASE f OF
|
||||||
OPT.Bool: x := NewBoolConst(FALSE)
|
OPT.Bool: x := NewBoolConst(FALSE)
|
||||||
| OPT.Char: x := NewIntConst(0); x^.typ := OPT.chartyp
|
| OPT.Char: x := NewIntConst(0); x^.typ := OPT.chartyp
|
||||||
| OPT.SInt,
|
| OPT.Int: x := NewIntConst(OPM.SignedMinimum(x.typ.size))
|
||||||
OPT.Int,
|
|
||||||
OPT.LInt: x := NewIntConst(OPM.SignedMinimum(x.typ.size))
|
|
||||||
| OPT.Set: x := NewIntConst(0); x^.typ := OPT.inttyp
|
| OPT.Set: x := NewIntConst(0); x^.typ := OPT.inttyp
|
||||||
| OPT.Real: x := NewRealConst(OPM.MinReal, OPT.realtyp)
|
| OPT.Real: x := NewRealConst(OPM.MinReal, OPT.realtyp)
|
||||||
| OPT.LReal: x := NewRealConst(OPM.MinLReal, OPT.lrltyp)
|
| OPT.LReal: x := NewRealConst(OPM.MinLReal, OPT.lrltyp)
|
||||||
|
|
@ -989,9 +981,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
CASE f OF
|
CASE f OF
|
||||||
OPT.Bool: x := NewBoolConst(TRUE)
|
OPT.Bool: x := NewBoolConst(TRUE)
|
||||||
| OPT.Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp
|
| OPT.Char: x := NewIntConst(0FFH); x^.typ := OPT.chartyp
|
||||||
| OPT.SInt,
|
| OPT.Int: x := NewIntConst(OPM.SignedMaximum(x.typ.size))
|
||||||
OPT.Int,
|
|
||||||
OPT.LInt: x := NewIntConst(OPM.SignedMaximum(x.typ.size))
|
|
||||||
| OPT.Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp
|
| OPT.Set: x := NewIntConst(OPM.MaxSet); x^.typ := OPT.inttyp
|
||||||
| OPT.Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp)
|
| OPT.Real: x := NewRealConst(OPM.MaxReal, OPT.realtyp)
|
||||||
| OPT.LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp)
|
| OPT.LReal: x := NewRealConst(OPM.MaxLReal, OPT.lrltyp)
|
||||||
|
|
@ -1001,12 +991,12 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
|OPT.chrfn: (*CHR*)
|
|OPT.chrfn: (*CHR*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN {OPT.Undef} + OPT.intSet THEN Convert(x, OPT.chartyp)
|
ELSIF f IN {OPT.Undef, OPT.Int} THEN Convert(x, OPT.chartyp)
|
||||||
ELSE err(111); x^.typ := OPT.chartyp
|
ELSE err(111); x^.typ := OPT.chartyp
|
||||||
END
|
END
|
||||||
|OPT.shortfn: (*SHORT*)
|
|OPT.shortfn: (*SHORT*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
typ := OPT.ShorterOrLongerType(x.typ, -1);
|
typ := OPT.ShorterOrLongerType(x.typ, -1);
|
||||||
IF typ = NIL THEN err(111) ELSE Convert(x, typ) END
|
IF typ = NIL THEN err(111) ELSE Convert(x, typ) END
|
||||||
ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp)
|
ELSIF f = OPT.LReal THEN Convert(x, OPT.realtyp)
|
||||||
|
|
@ -1014,7 +1004,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
|OPT.longfn: (*LONG*)
|
|OPT.longfn: (*LONG*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
typ := OPT.ShorterOrLongerType(x.typ, 1);
|
typ := OPT.ShorterOrLongerType(x.typ, 1);
|
||||||
IF typ = NIL THEN err(111) ELSE Convert(x, typ) END
|
IF typ = NIL THEN err(111) ELSE Convert(x, typ) END
|
||||||
ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp)
|
ELSIF f = OPT.Real THEN Convert(x, OPT.lrltyp)
|
||||||
|
|
@ -1024,7 +1014,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
|OPT.incfn,
|
|OPT.incfn,
|
||||||
OPT.decfn: (*INC, DEC*)
|
OPT.decfn: (*INC, DEC*)
|
||||||
IF NotVar(x) THEN err(112)
|
IF NotVar(x) THEN err(112)
|
||||||
ELSIF ~(f IN OPT.intSet) THEN err(111)
|
ELSIF f # OPT.Int THEN err(111)
|
||||||
ELSIF x^.readonly THEN err(76)
|
ELSIF x^.readonly THEN err(76)
|
||||||
END
|
END
|
||||||
|OPT.inclfn,
|
|OPT.inclfn,
|
||||||
|
|
@ -1043,7 +1033,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
|OPT.ashfn: (*ASH*)
|
|OPT.ashfn: (*ASH*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END
|
IF x.typ.size # OPM.LIntSize THEN Convert(x, OPT.linttyp) END
|
||||||
ELSE err(111); x^.typ := OPT.linttyp
|
ELSE err(111); x^.typ := OPT.linttyp
|
||||||
END
|
END
|
||||||
|
|
@ -1061,19 +1051,19 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
|OPT.lshfn,
|
|OPT.lshfn,
|
||||||
OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*)
|
OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF ~(f IN OPT.intSet + {OPT.Byte, OPT.Char, OPT.Set}) THEN err(111)
|
ELSIF ~(f IN {OPT.Int, OPT.Byte, OPT.Char, OPT.Set}) THEN err(111)
|
||||||
END
|
END
|
||||||
|OPT.getfn,
|
|OPT.getfn,
|
||||||
OPT.putfn,
|
OPT.putfn,
|
||||||
OPT.bitfn,
|
OPT.bitfn,
|
||||||
OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*)
|
OPT.movefn: (*SYSTEM.GET, SYSTEM.PUT, SYSTEM.BIT, SYSTEM.MOVE*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp)
|
ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp)
|
||||||
ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp
|
ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp
|
||||||
END
|
END
|
||||||
|OPT.getrfn,
|
|OPT.getrfn,
|
||||||
OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*)
|
OPT.putrfn: (*SYSTEM.GETREG, SYSTEM.PUTREG*)
|
||||||
IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN
|
IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN
|
||||||
IF (x^.conval^.intval < OPM.MinRegNr) OR (x^.conval^.intval > OPM.MaxRegNr) THEN err(220) END
|
IF (x^.conval^.intval < OPM.MinRegNr) OR (x^.conval^.intval > OPM.MaxRegNr) THEN err(220) END
|
||||||
ELSE err(69)
|
ELSE err(69)
|
||||||
END
|
END
|
||||||
|
|
@ -1114,7 +1104,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); p^.typ := OPT.notyp
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126); p^.typ := OPT.notyp
|
||||||
ELSE
|
ELSE
|
||||||
IF x^.typ # p^.typ THEN
|
IF x^.typ # p^.typ THEN
|
||||||
IF (x^.class = OPT.Nconst) & (f IN OPT.intSet) THEN Convert(x, p^.typ)
|
IF (x^.class = OPT.Nconst) & (f = OPT.Int) THEN Convert(x, p^.typ)
|
||||||
ELSE err(111)
|
ELSE err(111)
|
||||||
END
|
END
|
||||||
END ;
|
END ;
|
||||||
|
|
@ -1124,7 +1114,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
|OPT.inclfn,
|
|OPT.inclfn,
|
||||||
OPT.exclfn: (*INCL, EXCL*)
|
OPT.exclfn: (*INCL, EXCL*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202)
|
IF (x^.class = OPT.Nconst) & ((0 > x^.conval^.intval) OR (x^.conval^.intval > OPM.MaxSet)) THEN err(202)
|
||||||
END ;
|
END ;
|
||||||
p := NewOp(OPT.Nassign, fctno, p, x)
|
p := NewOp(OPT.Nassign, fctno, p, x)
|
||||||
|
|
@ -1132,7 +1122,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END ;
|
END ;
|
||||||
p^.typ := OPT.notyp
|
p^.typ := OPT.notyp
|
||||||
|OPT.lenfn: (*LEN*)
|
|OPT.lenfn: (*LEN*)
|
||||||
IF ~(f IN OPT.intSet) OR (x^.class # OPT.Nconst) THEN err(69)
|
IF ~(f = OPT.Int) OR (x^.class # OPT.Nconst) THEN err(69)
|
||||||
ELSIF x.typ.size = 1 THEN (* Hard limit of 127 dimensions *)
|
ELSIF x.typ.size = 1 THEN (* Hard limit of 127 dimensions *)
|
||||||
L := SHORT(x^.conval^.intval); typ := p^.typ;
|
L := SHORT(x^.conval^.intval); typ := p^.typ;
|
||||||
WHILE (L > 0) & (typ^.comp IN {OPT.DynArr, OPT.Array}) DO typ := typ^.BaseTyp; DEC(L) END ;
|
WHILE (L > 0) & (typ^.comp IN {OPT.DynArr, OPT.Array}) DO typ := typ^.BaseTyp; DEC(L) END ;
|
||||||
|
|
@ -1156,7 +1146,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
p^.typ := OPT.notyp
|
p^.typ := OPT.notyp
|
||||||
|OPT.ashfn: (*ASH*)
|
|OPT.ashfn: (*ASH*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
IF (p^.class = OPT.Nconst) & (x^.class = OPT.Nconst) THEN
|
IF (p^.class = OPT.Nconst) & (x^.class = OPT.Nconst) THEN
|
||||||
IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1
|
IF (-maxExp > x^.conval^.intval) OR (x^.conval^.intval > maxExp) THEN err(208); p^.conval^.intval := 1
|
||||||
ELSIF x^.conval^.intval >= 0 THEN
|
ELSIF x^.conval^.intval >= 0 THEN
|
||||||
|
|
@ -1174,7 +1164,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
|OPT.newfn: (*NEW(p, x...)*)
|
|OPT.newfn: (*NEW(p, x...)*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF p^.typ^.comp = OPT.DynArr THEN
|
ELSIF p^.typ^.comp = OPT.DynArr THEN
|
||||||
IF f IN OPT.intSet THEN
|
IF f = OPT.Int THEN
|
||||||
IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END
|
IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END
|
||||||
ELSE err(111)
|
ELSE err(111)
|
||||||
END ;
|
END ;
|
||||||
|
|
@ -1184,7 +1174,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
|OPT.lshfn,
|
|OPT.lshfn,
|
||||||
OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*)
|
OPT.rotfn: (*SYSTEM.LSH, SYSTEM.ROT*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF ~(f IN OPT.intSet) THEN err(111)
|
ELSIF f # OPT.Int THEN err(111)
|
||||||
ELSE
|
ELSE
|
||||||
IF fctno = OPT.lshfn THEN p := NewOp(OPT.Ndop, OPT.lsh, p, x) ELSE p := NewOp(OPT.Ndop, OPT.rot, p, x) END ;
|
IF fctno = OPT.lshfn THEN p := NewOp(OPT.Ndop, OPT.lsh, p, x) ELSE p := NewOp(OPT.Ndop, OPT.rot, p, x) END ;
|
||||||
p^.typ := p^.left^.typ
|
p^.typ := p^.left^.typ
|
||||||
|
|
@ -1205,7 +1195,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
p^.typ := OPT.notyp
|
p^.typ := OPT.notyp
|
||||||
|OPT.bitfn: (*SYSTEM.BIT*)
|
|OPT.bitfn: (*SYSTEM.BIT*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
p := NewOp(OPT.Ndop, OPT.bit, p, x)
|
p := NewOp(OPT.Ndop, OPT.bit, p, x)
|
||||||
ELSE err(111)
|
ELSE err(111)
|
||||||
END ;
|
END ;
|
||||||
|
|
@ -1229,19 +1219,19 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
x^.typ := p^.typ; p := x
|
x^.typ := p^.typ; p := x
|
||||||
|OPT.sysnewfn: (*SYSTEM.NEW*)
|
|OPT.sysnewfn: (*SYSTEM.NEW*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
p := NewOp(OPT.Nassign, OPT.sysnewfn, p, x)
|
p := NewOp(OPT.Nassign, OPT.sysnewfn, p, x)
|
||||||
ELSE err(111)
|
ELSE err(111)
|
||||||
END ;
|
END ;
|
||||||
p^.typ := OPT.notyp
|
p^.typ := OPT.notyp
|
||||||
|OPT.movefn: (*SYSTEM.MOVE*)
|
|OPT.movefn: (*SYSTEM.MOVE*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF (x^.class = OPT.Nconst) & (f IN OPT.intSet) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp)
|
ELSIF (x^.class = OPT.Nconst) & (f = OPT.Int) & (x.typ.size < OPT.linttyp.size) THEN Convert(x, OPT.linttyp)
|
||||||
ELSIF ~((x.typ.form IN {OPT.Pointer} + OPT.intSet) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp
|
ELSIF ~((x.typ.form IN {OPT.Pointer, OPT.Int}) & (x.typ.size = OPM.PointerSize)) THEN err(111); x^.typ := OPT.linttyp
|
||||||
END;
|
END;
|
||||||
p^.link := x
|
p^.link := x
|
||||||
|OPT.assertfn: (*ASSERT*)
|
|OPT.assertfn: (*ASSERT*)
|
||||||
IF (f IN OPT.intSet) & (x^.class = OPT.Nconst) THEN
|
IF (f = OPT.Int) & (x^.class = OPT.Nconst) THEN
|
||||||
IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN
|
IF (OPM.MinHaltNr <= x^.conval^.intval) & (x^.conval^.intval <= OPM.MaxHaltNr) THEN
|
||||||
BindNodes(OPT.Ntrap, OPT.notyp, x, x);
|
BindNodes(OPT.Ntrap, OPT.notyp, x, x);
|
||||||
x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.errpos;
|
x^.conval := OPT.NewConst(); x^.conval^.intval := OPM.errpos;
|
||||||
|
|
@ -1266,7 +1256,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
IF fctno = OPT.newfn THEN (*NEW(p, ..., x...*)
|
IF fctno = OPT.newfn THEN (*NEW(p, ..., x...*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF p^.typ^.comp # OPT.DynArr THEN err(64)
|
ELSIF p^.typ^.comp # OPT.DynArr THEN err(64)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ;
|
IF (x^.class = OPT.Nconst) & ((x^.conval^.intval <= 0) OR (x^.conval^.intval > OPM.MaxIndex)) THEN err(63) END ;
|
||||||
node := p^.right; WHILE node^.link # NIL DO node := node^.link END;
|
node := p^.right; WHILE node^.link # NIL DO node := node^.link END;
|
||||||
node^.link := x; p^.typ := p^.typ^.BaseTyp
|
node^.link := x; p^.typ := p^.typ^.BaseTyp
|
||||||
|
|
@ -1274,7 +1264,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
END
|
END
|
||||||
ELSIF (fctno = OPT.movefn) & (n = 2) THEN (*SYSTEM.MOVE*)
|
ELSIF (fctno = OPT.movefn) & (n = 2) THEN (*SYSTEM.MOVE*)
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF f IN OPT.intSet THEN
|
ELSIF f = OPT.Int THEN
|
||||||
node := OPT.NewNode(OPT.Nassign); node^.subcl := OPT.movefn; node^.right := p;
|
node := OPT.NewNode(OPT.Nassign); node^.subcl := OPT.movefn; node^.right := p;
|
||||||
node^.left := p^.link; p^.link := x; p := node
|
node^.left := p^.link; p^.link := x; p := node
|
||||||
ELSE err(111)
|
ELSE err(111)
|
||||||
|
|
@ -1333,7 +1323,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
BEGIN (* ftyp^.comp = OPT.DynArr *)
|
BEGIN (* ftyp^.comp = OPT.DynArr *)
|
||||||
f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp;
|
f := atyp^.comp; ftyp := ftyp^.BaseTyp; atyp := atyp^.BaseTyp;
|
||||||
IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *)
|
IF fvarpar & (ftyp = OPT.bytetyp) THEN (* ok, but ... *)
|
||||||
IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (atyp.size = 1)) THEN
|
IF ~(f IN {OPT.Array, OPT.DynArr}) OR ~((atyp.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (atyp.size = 1)) THEN
|
||||||
IF OPM.verbose IN OPM.opt THEN err(-301) END
|
IF OPM.verbose IN OPM.opt THEN err(-301) END
|
||||||
END
|
END
|
||||||
ELSIF f IN {OPT.Array, OPT.DynArr} THEN
|
ELSIF f IN {OPT.Array, OPT.DynArr} THEN
|
||||||
|
|
@ -1386,7 +1376,7 @@ MODULE OPB; (* RC 6.3.89 / 21.2.94 *) (* object model 17.1.93 *)
|
||||||
WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ;
|
WHILE (q # fp^.typ) & (q # NIL) & (q # OPT.undftyp) DO q := q^.BaseTyp END ;
|
||||||
IF q = NIL THEN err(111) END
|
IF q = NIL THEN err(111) END
|
||||||
ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *)
|
ELSIF (fp^.typ = OPT.sysptrtyp) & (ap^.typ^.form = OPT.Pointer) THEN (* ok *)
|
||||||
ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char} + OPT.intSet) & (ap.typ.size = 1))) THEN err(123)
|
ELSIF (ap^.typ # fp^.typ) & ~((fp^.typ^.form = OPT.Byte) & ((ap.typ.form IN {OPT.Byte..OPT.Char, OPT.Int}) & (ap.typ.size = 1))) THEN err(123)
|
||||||
ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123)
|
ELSIF (fp^.typ^.form = OPT.Pointer) & (ap^.class = OPT.Nguard) THEN err(123)
|
||||||
END
|
END
|
||||||
ELSIF fp^.typ^.comp = OPT.DynArr THEN
|
ELSIF fp^.typ^.comp = OPT.DynArr THEN
|
||||||
|
|
|
||||||
|
|
@ -1237,9 +1237,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *)
|
||||||
OPM.WriteString('case ');
|
OPM.WriteString('case ');
|
||||||
CASE form OF
|
CASE form OF
|
||||||
| OPT.Char: CharacterLiteral(caseVal)
|
| OPT.Char: CharacterLiteral(caseVal)
|
||||||
| OPT.SInt,
|
| OPT.Int: OPM.WriteInt(caseVal);
|
||||||
OPT.Int,
|
|
||||||
OPT.LInt: OPM.WriteInt(caseVal);
|
|
||||||
ELSE OPM.LogWStr("unhandled case in OPC.Case, form = "); OPM.LogWNum(form, 0); OPM.LogWLn;
|
ELSE OPM.LogWStr("unhandled case in OPC.Case, form = "); OPM.LogWNum(form, 0); OPM.LogWLn;
|
||||||
END;
|
END;
|
||||||
OPM.WriteString(': ');
|
OPM.WriteString(': ');
|
||||||
|
|
@ -1295,9 +1293,7 @@ MODULE OPC; (* copyright (c) J. Templ 12.7.95 / 3.7.96 *)
|
||||||
| OPT.Byte: OPM.WriteInt(con^.intval)
|
| OPT.Byte: OPM.WriteInt(con^.intval)
|
||||||
| OPT.Bool: OPM.WriteInt(con^.intval)
|
| OPT.Bool: OPM.WriteInt(con^.intval)
|
||||||
| OPT.Char: CharacterLiteral(con.intval)
|
| OPT.Char: CharacterLiteral(con.intval)
|
||||||
| OPT.SInt,
|
| OPT.Int: OPM.WriteInt(con^.intval)
|
||||||
OPT.Int,
|
|
||||||
OPT.LInt: OPM.WriteInt(con^.intval)
|
|
||||||
| OPT.Real: OPM.WriteReal(con^.realval, "f")
|
| OPT.Real: OPM.WriteReal(con^.realval, "f")
|
||||||
| OPT.LReal: OPM.WriteReal(con^.realval, 0X)
|
| OPT.LReal: OPM.WriteReal(con^.realval, 0X)
|
||||||
| OPT.Set: OPM.WriteString("0x");
|
| OPT.Set: OPM.WriteString("0x");
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
|
||||||
IF sym = OPS.lbrak THEN OPS.Get(sym);
|
IF sym = OPS.lbrak THEN OPS.Get(sym);
|
||||||
IF ~OPT.SYSimported THEN err(135) END;
|
IF ~OPT.SYSimported THEN err(135) END;
|
||||||
ConstExpression(x);
|
ConstExpression(x);
|
||||||
IF x^.typ^.form IN OPT.intSet THEN sf := x^.conval^.intval;
|
IF x^.typ^.form = OPT.Int THEN sf := x^.conval^.intval;
|
||||||
IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END
|
IF (sf < 0) OR (sf > OPM.MaxSysFlag) THEN err(220); sf := 0 END
|
||||||
ELSE err(51); sf := 0
|
ELSE err(51); sf := 0
|
||||||
END ;
|
END ;
|
||||||
|
|
@ -152,7 +152,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
|
||||||
END
|
END
|
||||||
ELSE
|
ELSE
|
||||||
typ := OPT.NewStr(OPT.Comp, OPT.Array); typ^.sysflag := sysflag; ConstExpression(x);
|
typ := OPT.NewStr(OPT.Comp, OPT.Array); typ^.sysflag := sysflag; ConstExpression(x);
|
||||||
IF x^.typ^.form IN OPT.intSet THEN n := x^.conval^.intval;
|
IF x^.typ^.form = OPT.Int THEN n := x^.conval^.intval;
|
||||||
IF (n <= 0) OR (n > OPM.MaxIndex) THEN err(63); n := 1 END
|
IF (n <= 0) OR (n > OPM.MaxIndex) THEN err(63); n := 1 END
|
||||||
ELSE err(51); n := 1
|
ELSE err(51); n := 1
|
||||||
END ;
|
END ;
|
||||||
|
|
@ -669,16 +669,16 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
|
||||||
VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT;
|
VAR x, y, lastlab: OPT.Node; i, f: INTEGER; xval, yval: LONGINT;
|
||||||
BEGIN lab := NIL; lastlab := NIL;
|
BEGIN lab := NIL; lastlab := NIL;
|
||||||
LOOP ConstExpression(x); f := x^.typ^.form;
|
LOOP ConstExpression(x); f := x^.typ^.form;
|
||||||
IF f IN OPT.intSet + {OPT.Char} THEN xval := x^.conval^.intval
|
IF f IN {OPT.Int, OPT.Char} THEN xval := x^.conval^.intval
|
||||||
ELSE err(61); xval := 1
|
ELSE err(61); xval := 1
|
||||||
END;
|
END;
|
||||||
IF f IN OPT.intSet THEN
|
IF f = OPT.Int THEN
|
||||||
IF ~(LabelTyp.form IN OPT.intSet) OR (LabelTyp.size < x.typ.size) THEN err(60) END
|
IF ~(LabelTyp.form = OPT.Int) OR (LabelTyp.size < x.typ.size) THEN err(60) END
|
||||||
ELSIF LabelTyp.form # f THEN err(60)
|
ELSIF LabelTyp.form # f THEN err(60)
|
||||||
END ;
|
END ;
|
||||||
IF sym = OPS.upto THEN
|
IF sym = OPS.upto THEN
|
||||||
OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval;
|
OPS.Get(sym); ConstExpression(y); yval := y^.conval^.intval;
|
||||||
IF (y^.typ^.form # f) & ~((f IN OPT.intSet) & (y^.typ^.form IN OPT.intSet)) THEN err(60) END ;
|
IF (y^.typ^.form # f) & ~((f = OPT.Int) & (y^.typ^.form = OPT.Int)) THEN err(60) END ;
|
||||||
IF yval < xval THEN err(63); yval := xval END
|
IF yval < xval THEN err(63); yval := xval END
|
||||||
ELSE yval := xval
|
ELSE yval := xval
|
||||||
END ;
|
END ;
|
||||||
|
|
@ -714,7 +714,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
|
||||||
BEGIN
|
BEGIN
|
||||||
Expression(x); pos := OPM.errpos;
|
Expression(x); pos := OPM.errpos;
|
||||||
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
IF (x^.class = OPT.Ntype) OR (x^.class = OPT.Nproc) THEN err(126)
|
||||||
ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.LInt}) THEN err(125)
|
ELSIF ~(x^.typ^.form IN {OPT.Char..OPT.Int}) THEN err(125)
|
||||||
END ;
|
END ;
|
||||||
CheckSym(OPS.of); cases := NIL; lastcase := NIL; n := 0;
|
CheckSym(OPS.of); cases := NIL; lastcase := NIL; n := 0;
|
||||||
LOOP
|
LOOP
|
||||||
|
|
@ -802,7 +802,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
|
||||||
ELSIF sym = OPS.for THEN
|
ELSIF sym = OPS.for THEN
|
||||||
OPS.Get(sym);
|
OPS.Get(sym);
|
||||||
IF sym = OPS.ident THEN qualident(id);
|
IF sym = OPS.ident THEN qualident(id);
|
||||||
IF ~(id^.typ^.form IN OPT.intSet) THEN err(68) END ;
|
IF ~(id^.typ^.form = OPT.Int) THEN err(68) END ;
|
||||||
CheckSym(OPS.becomes); Expression(y); pos := OPM.errpos;
|
CheckSym(OPS.becomes); Expression(y); pos := OPM.errpos;
|
||||||
x := OPB.NewLeaf(id); OPB.Assign(x, y); SetPos(x);
|
x := OPB.NewLeaf(id); OPB.Assign(x, y); SetPos(x);
|
||||||
CheckSym(OPS.to); Expression(y); pos := OPM.errpos;
|
CheckSym(OPS.to); Expression(y); pos := OPM.errpos;
|
||||||
|
|
@ -817,7 +817,7 @@ MODULE OPP; (* NW, RC 6.3.89 / 10.2.94 *) (* object model 4.12.93 *)
|
||||||
END ;
|
END ;
|
||||||
z := OPB.NewLeaf(t); OPB.Assign(z, y); SetPos(z); OPB.Link(stat, last, z);
|
z := OPB.NewLeaf(t); OPB.Assign(z, y); SetPos(z); OPB.Link(stat, last, z);
|
||||||
y := OPB.NewLeaf(t)
|
y := OPB.NewLeaf(t)
|
||||||
ELSIF ~(y^.typ^.form IN OPT.intSet) OR (y.typ.size > x.left.typ.size) THEN err(113)
|
ELSIF ~(y^.typ^.form = OPT.Int) OR (y.typ.size > x.left.typ.size) THEN err(113)
|
||||||
END ;
|
END ;
|
||||||
OPB.Link(stat, last, x);
|
OPB.Link(stat, last, x);
|
||||||
IF sym = OPS.by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ;
|
IF sym = OPS.by THEN OPS.Get(sym); ConstExpression(z) ELSE z := OPB.NewIntConst(1) END ;
|
||||||
|
|
|
||||||
|
|
@ -91,12 +91,12 @@ TYPE
|
||||||
CONST
|
CONST
|
||||||
(* Struct.form values *)
|
(* Struct.form values *)
|
||||||
Undef* = 0; Byte* = 1; Bool* = 2; Char* = 3;
|
Undef* = 0; Byte* = 1; Bool* = 2; Char* = 3;
|
||||||
SInt* = 4; Int* = 5; LInt* = 6;
|
Int* = 5;
|
||||||
Real* = 7; LReal* = 8; Set* = 9; String* = 10;
|
Real* = 7; LReal* = 8; Set* = 9; String* = 10;
|
||||||
NilTyp* = 11; NoTyp* = 12; Pointer* = 13; ProcTyp* = 14;
|
NilTyp* = 11; NoTyp* = 12; Pointer* = 13; ProcTyp* = 14;
|
||||||
Comp* = 15;
|
Comp* = 15;
|
||||||
|
|
||||||
intSet* = {SInt..LInt}; realSet* = {Real, LReal};
|
realSet* = {Real, LReal};
|
||||||
|
|
||||||
(* Struct.comp - Composite structure forms *)
|
(* Struct.comp - Composite structure forms *)
|
||||||
Basic* = 1; Array* = 2; DynArr* = 3; Record* = 4;
|
Basic* = 1; Array* = 2; DynArr* = 3; Record* = 4;
|
||||||
|
|
@ -224,7 +224,7 @@ END IntType;
|
||||||
PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct;
|
PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct;
|
||||||
VAR i: INTEGER;
|
VAR i: INTEGER;
|
||||||
BEGIN
|
BEGIN
|
||||||
ASSERT(x.form IN intSet);
|
ASSERT(x.form = Int);
|
||||||
ASSERT((dir = 1) OR (dir = -1));
|
ASSERT((dir = 1) OR (dir = -1));
|
||||||
(* Not sure if StPar0 (which calls this) always gets the baseiest type. This
|
(* Not sure if StPar0 (which calls this) always gets the baseiest type. This
|
||||||
ASSERT will tell me. *)
|
ASSERT will tell me. *)
|
||||||
|
|
@ -517,9 +517,7 @@ BEGIN
|
||||||
CASE f OF
|
CASE f OF
|
||||||
| Bool,
|
| Bool,
|
||||||
Char,
|
Char,
|
||||||
SInt,
|
Int: OPM.FPrint(fprint, obj^.conval^.intval)
|
||||||
Int,
|
|
||||||
LInt: OPM.FPrint(fprint, obj^.conval^.intval)
|
|
||||||
| Set: OPM.FPrintSet(fprint, obj^.conval^.setval)
|
| Set: OPM.FPrintSet(fprint, obj^.conval^.setval)
|
||||||
| Real: rval := SHORT(obj^.conval^.realval); OPM.FPrintReal(fprint, rval)
|
| Real: rval := SHORT(obj^.conval^.realval); OPM.FPrintReal(fprint, rval)
|
||||||
| LReal: OPM.FPrintLReal(fprint, obj^.conval^.realval)
|
| LReal: OPM.FPrintLReal(fprint, obj^.conval^.realval)
|
||||||
|
|
@ -632,9 +630,7 @@ BEGIN
|
||||||
| Byte,
|
| Byte,
|
||||||
Char,
|
Char,
|
||||||
Bool: OPM.SymRCh(ch); conval^.intval := ORD(ch)
|
Bool: OPM.SymRCh(ch); conval^.intval := ORD(ch)
|
||||||
| SInt,
|
| Int: conval^.intval := OPM.SymRInt()
|
||||||
Int,
|
|
||||||
LInt: conval^.intval := OPM.SymRInt()
|
|
||||||
| Set: OPM.SymRSet(conval^.setval)
|
| Set: OPM.SymRSet(conval^.setval)
|
||||||
| Real: OPM.SymRReal(rval); conval^.realval := rval;
|
| Real: OPM.SymRReal(rval); conval^.realval := rval;
|
||||||
conval^.intval := OPM.ConstNotAlloc
|
conval^.intval := OPM.ConstNotAlloc
|
||||||
|
|
@ -706,7 +702,7 @@ END InTProc;
|
||||||
|
|
||||||
PROCEDURE InTyp(tag: LONGINT): Struct;
|
PROCEDURE InTyp(tag: LONGINT): Struct;
|
||||||
BEGIN
|
BEGIN
|
||||||
IF tag IN intSet THEN
|
IF tag = Int THEN
|
||||||
RETURN IntType(OPM.SymRInt())
|
RETURN IntType(OPM.SymRInt())
|
||||||
ELSE
|
ELSE
|
||||||
RETURN impCtxt.ref[tag]
|
RETURN impCtxt.ref[tag]
|
||||||
|
|
@ -1027,7 +1023,7 @@ END Import;
|
||||||
VAR strobj: Object;
|
VAR strobj: Object;
|
||||||
BEGIN
|
BEGIN
|
||||||
IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref);
|
IF (typ^.ref < expCtxt.ref) THEN OPM.SymWInt(-typ^.ref);
|
||||||
IF typ.ref IN intSet THEN OPM.SymWInt(typ.size) END
|
IF typ.ref = Int THEN OPM.SymWInt(typ.size) END
|
||||||
ELSE
|
ELSE
|
||||||
OPM.SymWInt(Sstruct);
|
OPM.SymWInt(Sstruct);
|
||||||
typ^.ref := expCtxt.ref; INC(expCtxt.ref);
|
typ^.ref := expCtxt.ref; INC(expCtxt.ref);
|
||||||
|
|
@ -1072,9 +1068,7 @@ END Import;
|
||||||
CASE f OF
|
CASE f OF
|
||||||
| Bool,
|
| Bool,
|
||||||
Char: OPM.SymWCh(CHR(obj^.conval^.intval))
|
Char: OPM.SymWCh(CHR(obj^.conval^.intval))
|
||||||
| SInt,
|
| Int: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size)
|
||||||
Int,
|
|
||||||
LInt: OPM.SymWInt(obj^.conval^.intval); OPM.SymWInt(obj.typ.size)
|
|
||||||
| Set: OPM.SymWSet(obj^.conval^.setval)
|
| Set: OPM.SymWSet(obj^.conval^.setval)
|
||||||
| Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval)
|
| Real: rval := SHORT(obj^.conval^.realval); OPM.SymWReal(rval)
|
||||||
| LReal: OPM.SymWLReal(obj^.conval^.realval)
|
| LReal: OPM.SymWLReal(obj^.conval^.realval)
|
||||||
|
|
@ -1222,7 +1216,8 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0;
|
||||||
(*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*)
|
(*EnterTyp("LONGINT", LInt, OPM.LIntSize, linttyp);*)
|
||||||
EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp);
|
EnterTyp("LONGINT", Int, OPM.LIntSize, linttyp);
|
||||||
EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp);
|
EnterTyp("LONGREAL", LReal, OPM.LRealSize, lrltyp);
|
||||||
EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp);
|
(*EnterTyp("SHORTINT", SInt, OPM.SIntSize, sinttyp);*)
|
||||||
|
EnterTyp("SHORTINT", Int, OPM.SIntSize, sinttyp);
|
||||||
|
|
||||||
EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *)
|
EnterBoolConst("FALSE", 0); (* 0 and 1 are compiler internal representation only *)
|
||||||
EnterBoolConst("TRUE", 1);
|
EnterBoolConst("TRUE", 1);
|
||||||
|
|
@ -1253,9 +1248,9 @@ BEGIN topScope := NIL; OpenScope(0, NIL); OPM.errpos := 0;
|
||||||
impCtxt.ref[Byte] := bytetyp;
|
impCtxt.ref[Byte] := bytetyp;
|
||||||
impCtxt.ref[Bool] := booltyp;
|
impCtxt.ref[Bool] := booltyp;
|
||||||
impCtxt.ref[Char] := chartyp;
|
impCtxt.ref[Char] := chartyp;
|
||||||
impCtxt.ref[SInt] := sinttyp;
|
(*impCtxt.ref[SInt] := sinttyp;*)
|
||||||
impCtxt.ref[Int] := inttyp;
|
impCtxt.ref[Int] := inttyp;
|
||||||
impCtxt.ref[LInt] := linttyp;
|
(*impCtxt.ref[LInt] := linttyp;*)
|
||||||
impCtxt.ref[Real] := realtyp;
|
impCtxt.ref[Real] := realtyp;
|
||||||
impCtxt.ref[LReal] := lrltyp;
|
impCtxt.ref[LReal] := lrltyp;
|
||||||
impCtxt.ref[Set] := settyp;
|
impCtxt.ref[Set] := settyp;
|
||||||
|
|
|
||||||
|
|
@ -297,7 +297,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
|
|
||||||
PROCEDURE SizeCast(from, to: LONGINT);
|
PROCEDURE SizeCast(from, to: LONGINT);
|
||||||
BEGIN
|
BEGIN
|
||||||
IF (from # to) & ((from > OPM.CIntSize) OR (to > OPM.CIntSize)) THEN
|
IF (from # to) & ((from > OPM.CIntSize) OR (to # OPM.CIntSize)) THEN
|
||||||
CASE to OF
|
CASE to OF
|
||||||
|1: OPM.WriteString("(SYSTEM_INT8)");
|
|1: OPM.WriteString("(SYSTEM_INT8)");
|
||||||
|2: OPM.WriteString("(SYSTEM_INT16)");
|
|2: OPM.WriteString("(SYSTEM_INT16)");
|
||||||
|
|
@ -312,7 +312,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
VAR from, to: INTEGER;
|
VAR from, to: INTEGER;
|
||||||
BEGIN from := n^.typ^.form; to := newtype.form;
|
BEGIN from := n^.typ^.form; to := newtype.form;
|
||||||
IF to = OPT.Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen)
|
IF to = OPT.Set THEN OPM.WriteString(SetOfFunc); Entier(n, MinPrec); OPM.Write(CloseParen)
|
||||||
ELSIF to IN OPT.intSet THEN
|
ELSIF to = OPT.Int THEN
|
||||||
IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN
|
IF (newtype.size < n.typ.size) & (OPM.ranchk IN OPM.opt) THEN
|
||||||
OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END;
|
OPM.WriteString("__SHORT"); IF SideEffects(n) THEN OPM.Write("F") END;
|
||||||
OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma);
|
OPM.Write(OpenParen); Entier(n, MinPrec); OPM.WriteString(Comma);
|
||||||
|
|
@ -474,13 +474,9 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
OPM.WriteString("(void*)") (* type extension *)
|
OPM.WriteString("(void*)") (* type extension *)
|
||||||
END
|
END
|
||||||
ELSE
|
ELSE
|
||||||
IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form IN OPT.intSet) THEN (* real promotion *)
|
IF (form IN {OPT.Real, OPT.LReal}) & (n^.typ^.form = OPT.Int) THEN (* real promotion *)
|
||||||
OPM.WriteString("(double)"); prec := 9
|
OPM.WriteString("(double)"); prec := 9
|
||||||
(*
|
ELSIF form = OPT.Int THEN
|
||||||
ELSIF (form IN OPT.intSet) & (typ.size = OPM.LIntSize) & (n.typ.form <= OPT.LInt) & (n.typ.size < OPM.LIntSize) THEN (* integral promotion *)
|
|
||||||
OPM.WriteString("(LONGINT)"); prec := 9
|
|
||||||
*)
|
|
||||||
ELSIF form IN OPT.intSet THEN
|
|
||||||
SizeCast(n.typ.size, typ.size)
|
SizeCast(n.typ.size, typ.size)
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
@ -490,7 +486,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
END;
|
END;
|
||||||
IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN
|
IF (mode = OPT.VarPar) & (n^.class = OPT.Nmop) & (n^.subcl = OPT.val) THEN
|
||||||
expr(n^.left, prec) (* avoid cast in lvalue *)
|
expr(n^.left, prec) (* avoid cast in lvalue *)
|
||||||
ELSIF (form IN OPT.intSet) & (n^.class = OPT.Nconst) THEN
|
ELSIF (form = OPT.Int) & (n^.class = OPT.Nconst) THEN
|
||||||
ParIntLiteral(n.conval.intval, n.typ.size)
|
ParIntLiteral(n.conval.intval, n.typ.size)
|
||||||
ELSE
|
ELSE
|
||||||
expr(n, prec)
|
expr(n, prec)
|
||||||
|
|
@ -582,8 +578,8 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
expr(l, exprPrec)
|
expr(l, exprPrec)
|
||||||
END
|
END
|
||||||
| OPT.val: IF ~(l^.class IN {OPT.Nvar, OPT.Nvarpar, OPT.Nfield, OPT.Nindex}) (*SYSTEM*)
|
| OPT.val: IF ~(l^.class IN {OPT.Nvar, OPT.Nvarpar, OPT.Nfield, OPT.Nindex}) (*SYSTEM*)
|
||||||
OR (n^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp})
|
OR (n^.typ^.form IN {OPT.Int, OPT.Pointer, OPT.Set, OPT.ProcTyp})
|
||||||
& (l^.typ^.form IN {OPT.LInt, OPT.Pointer, OPT.Set, OPT.ProcTyp})
|
& (l^.typ^.form IN {OPT.Int, OPT.Pointer, OPT.Set, OPT.ProcTyp})
|
||||||
& (n^.typ^.size = l^.typ^.size)
|
& (n^.typ^.size = l^.typ^.size)
|
||||||
THEN
|
THEN
|
||||||
OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen);
|
OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen);
|
||||||
|
|
@ -670,7 +666,7 @@ MODULE OPV; (* J. Templ 16.2.95 / 3.7.96
|
||||||
END
|
END
|
||||||
| OPS.slash: IF form = OPT.Set THEN OPM.WriteString(" ^ ")
|
| OPS.slash: IF form = OPT.Set THEN OPM.WriteString(" ^ ")
|
||||||
ELSE OPM.WriteString(" / ");
|
ELSE OPM.WriteString(" / ");
|
||||||
IF (r^.obj = NIL) OR (r^.obj^.typ^.form IN OPT.intSet) THEN
|
IF (r^.obj = NIL) OR (r^.obj^.typ^.form = OPT.Int) THEN
|
||||||
OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen)
|
OPM.Write(OpenParen); OPC.Ident(n^.typ^.strobj); OPM.Write(CloseParen)
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue