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

View file

@ -15,7 +15,7 @@ typedef
import OPS_Name OPS_name;
import OPS_String OPS_str;
import int16 OPS_numtyp;
import int64 OPS_intval;
import int32 OPS_intval;
import REAL OPS_realval;
import LONGREAL OPS_lrlval;

View file

@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int32 size)
OPT_Struct _o_result;
int16 i;
i = 1;
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
while (i < 19) {
if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) {
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
}
i += 1;
}
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
__RETCHK;
}
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)

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

View file

@ -15,7 +15,7 @@ typedef
import OPS_Name OPS_name;
import OPS_String OPS_str;
import int16 OPS_numtyp;
import int64 OPS_intval;
import int32 OPS_intval;
import REAL OPS_realval;
import LONGREAL OPS_lrlval;

View file

@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int32 size)
OPT_Struct _o_result;
int16 i;
i = 1;
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
while (i < 19) {
if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) {
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
}
i += 1;
}
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
__RETCHK;
}
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)

View file

@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int64 size)
OPT_Struct _o_result;
int32 i;
i = 1;
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
while (i < 19) {
if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) {
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
}
i += 1;
}
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
__RETCHK;
}
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir)

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

View file

@ -15,7 +15,7 @@ typedef
import OPS_Name OPS_name;
import OPS_String OPS_str;
import int16 OPS_numtyp;
import int64 OPS_intval;
import int32 OPS_intval;
import REAL OPS_realval;
import LONGREAL OPS_lrlval;

View file

@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int32 size)
OPT_Struct _o_result;
int16 i;
i = 1;
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
while (i < 19) {
if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) {
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
}
i += 1;
}
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
__RETCHK;
}
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int16 dir)

View file

@ -167,11 +167,14 @@ OPT_Struct OPT_IntType (int64 size)
OPT_Struct _o_result;
int32 i;
i = 1;
while ((OPT_IntTypes[__X(i, 20)]->size < size && OPT_IntTypes[__X(i + 1, 20)] != NIL)) {
while (i < 19) {
if ((OPT_IntTypes[__X(i, 20)] != NIL && OPT_IntTypes[__X(i, 20)]->size >= size)) {
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
}
i += 1;
}
_o_result = OPT_IntTypes[__X(i, 20)];
return _o_result;
__RETCHK;
}
OPT_Struct OPT_ShorterOrLongerType (OPT_Struct x, int32 dir)