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

@ -52,7 +52,7 @@ MODULE OPS; (* NW, RC 6.3.89 / 18.10.92 *) (* object model 3.6.92 *)
name*: Name;
str*: String;
numtyp*: INTEGER; (* 1 = char, 2 = integer, 3 = real, 4 = longreal *)
intval*: SYSTEM.INT64; (* integer value or string length *)
intval*: LONGINT (* todo SYSTEM.INT64 *); (* integer value or string length *)
realval*: REAL;
lrlval*: LONGREAL;

View file

@ -217,8 +217,10 @@ PROCEDURE IntType*(size: LONGINT): Struct;
(* Selects smallest standard integer type for given size in bytes *)
VAR i: INTEGER;
BEGIN
i := 1; WHILE (IntTypes[i].size < size) & (IntTypes[i+1] # NIL) DO INC(i) END;
RETURN IntTypes[i];
i := 1; WHILE i < LEN(IntTypes) - 1 DO (* First and last entries are always NIL *)
IF (IntTypes[i] # NIL) & (IntTypes[i].size >= size) THEN RETURN IntTypes[i] END;
INC(i)
END;
END IntType;
PROCEDURE ShorterOrLongerType*(x: Struct; dir: INTEGER): Struct;