Compiler register limits.
Posted: Fri Oct 21, 2016 9:15 pm
The compiler complains that this code is too complicted, but I think it is relatively simple, and that the compiler should be able to handle it.
If you change the TYPE to POINTER TO REAL (also 64-bits) there is no problem.
If you change the TYPE to POINTER TO REAL (also 64-bits) there is no problem.
Code: Select all
MODULE PrivTest;
TYPE
Vector* = POINTER TO ARRAY OF LONGINT;
PROCEDURE Rotate* (vec : Vector; s : INTEGER) : Vector;
VAR
n, k : INTEGER;
w : Vector;
BEGIN
IF vec # NIL THEN
n := LEN (vec); k := n;
NEW (w, n);
WHILE k > 0 DO DEC (k); w [(k + s) MOD n] := vec [k] END
END;
RETURN w
END Rotate;
END PrivTest.