Original meaning of VAL restored. Many library files disabled until use of VAL in 64 bits fixed.

This commit is contained in:
David Brown 2016-08-16 20:30:05 +01:00
parent 8f82f6e47b
commit 80f5e51789
29 changed files with 261 additions and 174 deletions

View file

@ -615,9 +615,12 @@ Especially Length would become fairly complex.
END ReadLInt;
PROCEDURE ReadSet* (VAR R: Rider; VAR x: SET);
VAR b: ARRAY 4 OF CHAR;
(* Reads 32 bits as a SET value (even on 64 bit systems. See Oakwood appendix 1.2.5.4 *)
VAR b: ARRAY 4 OF CHAR; l: LONGINT;
BEGIN ReadBytes(R, b, 4);
x := SYSTEM.VAL(SET, ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H)
(* Need to read via a LONGINT to provide correct behaviour for 64 bit sets. *)
l := ORD(b[0]) + ORD(b[1])*100H + ORD(b[2])*10000H + ORD(b[3])*1000000H;
x := SYSTEM.VAL(SET, l)
END ReadSet;
PROCEDURE ReadReal* (VAR R: Rider; VAR x: REAL);

View file

@ -134,8 +134,8 @@ static int __str_cmp(CHAR *x, CHAR *y){
/* SYSTEM ops */
#define __VAL(t, x) ((t)(x))
#define __VALP(t, x) ((t)(uintptr_t)(x))
#define __VAL(t, x) (*(t*)&(x))
#define __GET(a, x, t) x= *(t*)(uintptr_t)(a)
#define __PUT(a, x, t) *(t*)(uintptr_t)(a)=x