Fix import of SYSTEM.INT64 type on 32 bit platforms.

This commit is contained in:
David Brown 2016-09-15 17:39:30 +01:00
parent dc699db9f5
commit 21964471d8
13 changed files with 53 additions and 36 deletions

View file

@ -17,7 +17,7 @@ typedef
export OPS_Name OPS_name;
export OPS_String OPS_str;
export int16 OPS_numtyp;
export int64 OPS_intval;
export int32 OPS_intval;
export REAL OPS_realval;
export LONGREAL OPS_lrlval;
static CHAR OPS_ch;
@ -178,7 +178,7 @@ static void OPS_Number (void)
OPS_numtyp = 1;
if (n <= 2) {
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -192,7 +192,7 @@ static void OPS_Number (void)
OPS_intval = -1;
}
while (i < n) {
OPS_intval = __ASHL(OPS_intval, 4) + (int64)Ord__7(dig[i], 1);
OPS_intval = __ASHL(OPS_intval, 4) + Ord__7(dig[i], 1);
i += 1;
}
} else {
@ -203,8 +203,8 @@ static void OPS_Number (void)
while (i < n) {
d = Ord__7(dig[i], 0);
i += 1;
if (OPS_intval <= (int64)__DIV(9223372036854775807 - d, 10)) {
OPS_intval = OPS_intval * 10 + (int64)d;
if ((int64)OPS_intval <= __DIV(9223372036854775807 - (int64)d, 10)) {
OPS_intval = OPS_intval * 10 + d;
} else {
OPS_err(203);
}