Closed kekcleader closed 2 years ago
Suggested solution:
IF SIZE(SET) = SIZE(INTEGER) THEN i := SYSTEM.VAL(INTEGER, x)
ELSE i := SYSTEM.VAL(LONGINT, x)
END;
However, the previous suggested solution still produces a warning message.
This works with no warning messages:
PROCEDURE WriteSet* (VAR R: Rider; x: SET);
VAR b: ARRAY 4 OF CHAR; i: LONGINT;
y: SYSTEM.SET64;
BEGIN
IF SIZE(SET) = SIZE(INTEGER) THEN i := SYSTEM.VAL(INTEGER, x)
ELSE y := x; i := SYSTEM.VAL(LONGINT, y)
END;
b[0] := CHR(i); b[1] := CHR(i DIV 100H); b[2] := CHR(i DIV 10000H); b[3] := CHR(i DIV 1000000H);
WriteBytes(R, b, 4)
END WriteSet;
thank you for reporting. this looks reasonable. never used -OC, Dave implemented it.
i already committed this.
Since SET is now 32-bit with -OC, this expression in FIles.Mod is no longer correct:
SYSTEM.VAL(LONGINT, x)
, where x is of type SET. A compiler warning is generated during VOC runtime compilation process for -OC:The full procedure code: